From fd41570d4f6ccb757f78fe92aab499b8c3bcca6d Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:19:31 -0500 Subject: [PATCH 01/17] temp commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 354803e5..45216347 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## News V3.0.0 is released with Shakapacker v7 support, including SSR. Please try it out and report any issues. We'll try to address any critical issues ASAP. -For version 2.7 documentation checkout [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch. +For version 2.7 documentation, visit the [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch. ## Summary React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits: From b1a0745ab0288c10ee87de52b8b50534fa7de69c Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 18:47:16 -0500 Subject: [PATCH 02/17] add linting gems to dev Gemfile --- Gemfile | 3 +++ Gemfile.lock | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 8926579c..d60f3f49 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,6 @@ source "http://rubygems.org/" gemspec # This is an optional dev-dependency, required whenever sprockets is required +gem "rubocop" +gem "rubocop-minitest" +gem "rubocop-performance" diff --git a/Gemfile.lock b/Gemfile.lock index 4583cca9..73b8b9f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,7 @@ GEM bundler rake thor (>= 0.14.0) + ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -92,6 +93,7 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.3.0) + language_server-protocol (3.17.0.3) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -102,12 +104,8 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.0.2) - mini_portile2 (2.8.5) minitest (5.17.0) nenv (0.3.0) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) nokogiri (1.14.3-x86_64-linux) @@ -116,6 +114,10 @@ GEM nenv (~> 0.1) shellany (~> 0.0) package_json (0.1.0) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -138,12 +140,33 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) rake (13.0.1) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.6.0) rexml (3.2.5) + rubocop (1.63.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-minitest (0.35.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) @@ -161,13 +184,13 @@ GEM tilt (2.1.0) tzinfo (1.2.10) thread_safe (~> 0.1) + unicode-display_width (2.5.0) websocket (1.2.9) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.6) PLATFORMS - ruby x86_64-darwin-20 x86_64-linux @@ -186,6 +209,9 @@ DEPENDENCIES package_json pry-byebug react-rails! + rubocop + rubocop-minitest + rubocop-performance selenium-webdriver test-unit (~> 2.5) From fd4624b4911c51bf4b5dbab8e3eb5f12e94c8cb0 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:26:22 -0500 Subject: [PATCH 03/17] update npm global installation of yalc --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f81b04b4..ceb64820 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -89,7 +89,7 @@ jobs: with: persist-credentials: false - uses: actions/setup-node@v3 - - run: npm -g install yalc ${{ matrix.js_package_manager.installer }} + - run: sudo npm -g install yalc ${{ matrix.js_package_manager.installer }} - run: yalc publish - name: Save root node_modules to cache uses: actions/cache@v3 From 081e33c4ab9e474982abf6af37d2a8dba3aa6abe Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:26:42 -0500 Subject: [PATCH 04/17] linting --- test/dummy/config/initializers/backtrace_silencers.rb | 1 + test/dummy/config/initializers/inflections.rb | 1 + test/dummy/config/initializers/mime_types.rb | 1 + test/react/jsx_test.rb | 2 +- test/react/rails/controller_lifecycle_test.rb | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb index d0f0d3b5..4b63f289 100644 --- a/test/dummy/config/initializers/backtrace_silencers.rb +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb index aa7435fb..dc847422 100644 --- a/test/dummy/config/initializers/inflections.rb +++ b/test/dummy/config/initializers/inflections.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb index f75864f9..df5ec138 100644 --- a/test/dummy/config/initializers/mime_types.rb +++ b/test/dummy/config/initializers/mime_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/test/react/jsx_test.rb b/test/react/jsx_test.rb index c9ed8d43..25bb14ac 100644 --- a/test/react/jsx_test.rb +++ b/test/react/jsx_test.rb @@ -22,7 +22,7 @@ STR class NullTransformer - def initialize(_options = {}); end # rubocop:disable-line Style/RedundantInitialize + def initialize(_options = {}); end # rubocop:disable Style/RedundantInitialize def transform(_code) "TRANSFORMED CODE!;\n" diff --git a/test/react/rails/controller_lifecycle_test.rb b/test/react/rails/controller_lifecycle_test.rb index 03690109..4992cde9 100644 --- a/test/react/rails/controller_lifecycle_test.rb +++ b/test/react/rails/controller_lifecycle_test.rb @@ -41,7 +41,7 @@ def teardown get "/pages/1" helper_obj = controller.__react_component_helper - assert(helper_obj.is_a?(DummyHelperImplementation), "It uses the view helper implementation class") + assert_kind_of(DummyHelperImplementation, helper_obj, "It uses the view helper implementation class") end test "it calls setup and teardown methods" do From 02a5b7228329be599f9108fc03d90cadcd9bd99d Mon Sep 17 00:00:00 2001 From: chmod600 Date: Sat, 27 Apr 2024 16:32:44 -0700 Subject: [PATCH 05/17] Update get-started.md Using webpackconfig throws a deprecation warning and encourages user to use generateWebpackConfig() instead. --- docs/get-started.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/get-started.md b/docs/get-started.md index 97f1a300..3d34a279 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -194,12 +194,16 @@ Then modify the webpack config to use it as a plugin: ```js // config/webpack/webpack.config.js -const { webpackConfig, merge } = require("shakapacker"); -const ForkTSCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); +const { generateWebpackConfig, merge } = require('shakapacker') +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -module.exports = merge(webpackConfig, { - plugins: [new ForkTSCheckerWebpackPlugin()], -}); +const webpackConfig = generateWebpackConfig() + +module.exports = merge( + webpackConfig, { + plugins: [new ForkTsCheckerWebpackPlugin()] + } +); ``` Doing this will allow React-Rails to support the .tsx extension. Additionally, it is recommended to add `ts` and `tsx` to the `server_renderer_extensions` in your application configuration: From ee8f57dd7da2604c60dd71dcd76da6d4d7dc19cc Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 11 May 2024 16:11:59 -1000 Subject: [PATCH 06/17] Update README.md Removed outdated links. --- README.md | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 45216347..0b9de761 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ [![npm](https://img.shields.io/npm/v/react_ujs.svg?style=flat-square)](https://www.npmjs.com/package/react_ujs) [![Ruby](https://github.com/reactjs/react-rails/actions/workflows/ruby.yml/badge.svg)](https://github.com/reactjs/react-rails/actions/workflows/ruby.yml) -## News -V3.0.0 is released with Shakapacker v7 support, including SSR. Please try it out and report any issues. We'll try to address any critical issues ASAP. - For version 2.7 documentation, visit the [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch. ## Summary @@ -16,6 +13,14 @@ React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) * Supports Sprockets 4.x, 3.x * Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](http://es6-features.org/), [TypeScript](https://www.typescriptlang.org/), [CoffeeScript](http://coffeescript.org/) +--- + +While ShakaCode will continue to support this gem, you might consider migrating to [React on Rails](https://github.com/shakacode/react_on_rails) or [React on Rails Pro with proper Node rendering](https://www.shakacode.com/react-on-rails-pro/). + +Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/master/react_ujs/index.js) implementation compared to the [ReactOnRails Node package](https://github.com/shakacode/react_on_rails/tree/master/node_package) which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as [React Server Components](https://react.dev/reference/rsc/server-components). + +You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/master/docs/migrating-from-react-rails-to-react_on_rails.md). + --- ## ShakaCode Support @@ -34,7 +39,7 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by= ## Resources * [Click to join **React + Rails Slack**](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE). Then join the channel `#react-rails`. -* If you are upgrading, you might consider migrating to the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. +* If upgrading, consider migrating to the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. * Source code example utilizing React-Rails: https://github.com/BookOfGreg/react-rails-example-app ## Documentation @@ -77,32 +82,24 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by= - [HMR](docs/common-errors.md#hmr) - [Tests in component directory](docs/common-errors.md#tests-in-component-directory) -After reading this README file, additional information about React-Rails can be found in the Wiki page: +After reading this README file, additional information about React-Rails can be found on the Wiki page: https://github.com/reactjs/React-Rails/wiki -The Wiki page features a significant amount of additional information about React-Rails which includes instructional articles and answers to the most frequently asked questions. +The Wiki page features a significant amount of additional information about React-Rails, including instructional articles and answers to the most frequently asked questions. ## Related Projects -- [webpacker-react](https://github.com/renchap/webpacker-react): Integration of React with Rails utilizing Webpack with Hot Module Replacement (HMR). -- [The React on Rails Course](https://learnetto.com/users/hrishio/courses/the-free-react-on-rails-5-course) A video course which teaches the basics of React and how to get started using it in Rails with `react-rails`. - [react\_on\_rails](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Redux, React-Router. -- [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) Simple live-reloader for `react-rails`. +- [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro/):React on Rails with Node rendering and many other performance enhancements. - [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering. - [Ruby Hyperstack](https://hyperstack.org/): Use Ruby to build reactive user interfaces with React. ## Contributing -๐ŸŽ‰ Thanks for taking the time to contribute! ๐ŸŽ‰ - -With 5 Million+ downloads of the react-rails Gem and another 2 Million+ downloads of react_ujs on NPM, you're helping the biggest React + Rails community! - -By contributing to React-Rails, you agree to abide by the [code of conduct](https://github.com/reactjs/react-rails/blob/main/CODE_OF_CONDUCT.md). - -You can always help by submitting patches or triaging issues. Even offering reproduction steps to issues is incredibly helpful! +๐ŸŽ‰ Thanks for taking the time to contribute! ๐ŸŽ‰ See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. # Supporters -The following companies support the development of this and other open-source projects maintained by ShakaCode by providing licenses to the ShakaCode team. ShakaCode stands by the usefulness of these products! +The following companies provide licenses to the ShakaCode team, supporting the development of this and other open-source projects maintained by ShakaCode. ShakaCode stands by the usefulness of these products!

@@ -130,5 +127,3 @@ The following companies support the development of this and other open-source pr BrowserStack - -Please see our [Contribution guide](https://github.com/reactjs/react-rails/blob/main/CONTRIBUTING.md) for more info. From 9dbc6040c7e38ea07c8f1b1e58537cba74ff6c91 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Tue, 14 May 2024 21:07:32 -0500 Subject: [PATCH 07/17] refactoring & ci fixes --- .github/workflows/rubocop.yml | 7 +- .github/workflows/ruby.yml | 3 +- Appraisals | 11 -- Gemfile | 4 - Gemfile.lock | 158 ++++++++++++------ LintingGemfile | 7 + LintingGemfile.lock | 47 ++++++ gemfiles/base.gemfile.lock | 145 ++++++++-------- gemfiles/shakapacker.gemfile | 1 - gemfiles/shakapacker.gemfile.lock | 141 ++++++++-------- gemfiles/sprockets_3.gemfile | 1 - gemfiles/sprockets_3.gemfile.lock | 143 ++++++++-------- gemfiles/sprockets_4.gemfile | 1 - gemfiles/sprockets_4.gemfile.lock | 143 ++++++++-------- react-rails.gemspec | 3 +- .../app/views/layouts/application.html.erb | 1 - test/dummy/config/application.rb | 5 + test/dummy/package.json | 6 +- test/dummy/yarn.lock | 40 ++--- test/react/rails/railtie_test.rb | 2 +- test/react/rails/react_rails_ujs_test.rb | 4 +- .../server_rendering/exec_js_renderer_test.rb | 2 +- test/react_asset_test.rb | 2 +- test/server_rendered_html_test.rb | 8 +- test/support/sprockets_helpers.rb | 6 +- test/support/webpacker_helpers.rb | 6 +- test/test_helper.rb | 12 +- 27 files changed, 503 insertions(+), 406 deletions(-) create mode 100644 LintingGemfile create mode 100644 LintingGemfile.lock diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 480e75eb..a6ae7a86 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -14,6 +14,9 @@ jobs: matrix: os: [ubuntu-latest] ruby: ['2.7', '3.0'] + env: + # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/LintingGemfile steps: - uses: actions/checkout@v4 @@ -23,7 +26,5 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Install linting gems - run: gem install rubocop rubocop-performance rubocop-minitest - name: Run rubocop - run: rubocop + run: bundle exec rubocop diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ceb64820..e25ee781 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -105,12 +105,13 @@ jobs: with: bundler: 2.4.9 ruby-version: ${{ matrix.ruby }} + - run: bundle config set --local path 'test/dummy/vendor/bundle' - run: ./test/bin/create-fake-js-package-managers ${{ matrix.js_package_manager.installer }} - name: Save dummy app ruby gems to cache uses: actions/cache@v3 with: path: test/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile.lock') }} + key: dummy-app-gem-cache-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.gemfile)) }} - name: Install Ruby Gems for dummy app run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=test/dummy/vendor/bundle || bundle _2.4.9_ install --frozen --path=test/dummy/vendor/bundle --jobs=4 --retry=3 - run: cd test/dummy && yalc add react_ujs && ${{ matrix.js_package_manager.installer }} install diff --git a/Appraisals b/Appraisals index 967ed8ec..cce17d3b 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,4 @@ appraise 'sprockets_4' do - gem 'rails', '~> 7.0.x' gem 'sprockets', '~> 4.0.x' gem 'sprockets-rails' gem 'turbolinks', '~> 5' @@ -7,7 +6,6 @@ appraise 'sprockets_4' do end appraise 'sprockets_3' do - gem 'rails', '~> 7.0.x' gem 'sprockets', '~> 3.5' gem 'sprockets-rails' gem 'turbolinks', '~> 5' @@ -15,14 +13,5 @@ appraise 'sprockets_3' do end appraise 'shakapacker' do - gem 'rails', '~> 7.0.x' gem 'shakapacker', '7.2.0' end - -appraise 'base' do - # Appraisal adds `turbolinks` to this gemfile because it is - # present in `./Gemfile`. - # But it causes this gemfile to break, so it must be removed - # from `./gemfiles/rails_5_no_sprockets.gemfile` manually. - gem 'rails', '~> 7.0.x' -end diff --git a/Gemfile b/Gemfile index d60f3f49..c56c88f8 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,3 @@ source "http://rubygems.org/" gemspec -# This is an optional dev-dependency, required whenever sprockets is required -gem "rubocop" -gem "rubocop-minitest" -gem "rubocop-performance" diff --git a/Gemfile.lock b/Gemfile.lock index 73b8b9f5..e6383b94 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,32 +11,77 @@ PATH GEM remote: http://rubygems.org/ specs: - actionpack (6.0.2.1) - actionview (= 6.0.2.1) - activesupport (= 6.0.2.1) - rack (~> 2.0, >= 2.0.8) + actioncable (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.1) + actionpack (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activesupport (= 7.0.8.1) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.8.1) + actionview (= 7.0.8.1) + activesupport (= 7.0.8.1) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (6.0.2.1) - activesupport (= 6.0.2.1) + actiontext (7.0.8.1) + actionpack (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.8.1) + activesupport (= 7.0.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (6.0.2.1) + activejob (7.0.8.1) + activesupport (= 7.0.8.1) + globalid (>= 0.3.6) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activestorage (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activesupport (= 7.0.8.1) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) appraisal (2.4.1) bundler rake thor (>= 0.14.0) - ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -65,6 +110,7 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) + date (3.3.4) docile (1.1.5) erubi (1.9.0) es5-shim-rails (4.0.1) @@ -74,6 +120,8 @@ GEM ffi (1.15.5) formatador (1.1.0) gem-release (2.2.2) + globalid (1.2.1) + activesupport (>= 6.1) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -93,7 +141,6 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.3.0) - language_server-protocol (3.17.0.3) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -101,11 +148,29 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) matrix (0.4.2) method_source (1.0.0) - mini_mime (1.0.2) + mini_mime (1.1.2) minitest (5.17.0) + minitest-retry (0.2.2) + minitest (>= 5.0) nenv (0.3.0) + net-imap (0.4.11) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol + nio4r (2.7.3) nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) nokogiri (1.14.3-x86_64-linux) @@ -114,10 +179,6 @@ GEM nenv (~> 0.1) shellany (~> 0.0) package_json (0.1.0) - parallel (1.24.0) - parser (3.3.0.5) - ast (~> 2.4.1) - racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -129,44 +190,38 @@ GEM rack (2.2.6.4) rack-test (2.0.2) rack (>= 1.3) + rails (7.0.8.1) + actioncable (= 7.0.8.1) + actionmailbox (= 7.0.8.1) + actionmailer (= 7.0.8.1) + actionpack (= 7.0.8.1) + actiontext (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activemodel (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) + bundler (>= 1.15.0) + railties (= 7.0.8.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.4) loofah (~> 2.19, >= 2.19.1) - railties (6.0.2.1) - actionpack (= 6.0.2.1) - activesupport (= 6.0.2.1) + railties (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) - rainbow (3.1.1) + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) rake (13.0.1) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.6.0) rexml (3.2.5) - rubocop (1.63.1) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-minitest (0.35.0) - rubocop (>= 1.61, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-performance (1.21.0) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) @@ -180,12 +235,14 @@ GEM simplecov-html (0.10.2) test-unit (2.5.5) thor (1.2.1) - thread_safe (0.3.6) tilt (2.1.0) - tzinfo (1.2.10) - thread_safe (~> 0.1) - unicode-display_width (2.5.0) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) websocket (1.2.9) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.6) @@ -206,12 +263,11 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) + minitest-retry package_json pry-byebug + rails (~> 7.0.7, >= 7.0.7.2) react-rails! - rubocop - rubocop-minitest - rubocop-performance selenium-webdriver test-unit (~> 2.5) diff --git a/LintingGemfile b/LintingGemfile new file mode 100644 index 00000000..7edffc5a --- /dev/null +++ b/LintingGemfile @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +source "http://rubygems.org/" +# To install gems from this Gemfile locally, use BUNDLE_GEMFILE=./LintingGemfile bundle exec rubocop +gem "rubocop" +gem "rubocop-minitest" +gem "rubocop-performance" diff --git a/LintingGemfile.lock b/LintingGemfile.lock new file mode 100644 index 00000000..85af7abf --- /dev/null +++ b/LintingGemfile.lock @@ -0,0 +1,47 @@ +GEM + remote: http://rubygems.org/ + specs: + ast (2.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + parallel (1.24.0) + parser (3.3.1.0) + ast (~> 2.4.1) + racc + racc (1.7.3) + rainbow (3.1.1) + regexp_parser (2.9.0) + rexml (3.2.6) + rubocop (1.63.5) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-minitest (0.35.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (1.13.0) + unicode-display_width (2.5.0) + +PLATFORMS + x86_64-darwin-20 + x86_64-linux + +DEPENDENCIES + rubocop + rubocop-minitest + rubocop-performance + +BUNDLED WITH + 2.4.9 diff --git a/gemfiles/base.gemfile.lock b/gemfiles/base.gemfile.lock index a21eb747..d2f56557 100644 --- a/gemfiles/base.gemfile.lock +++ b/gemfiles/base.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - react-rails (3.1.1) + react-rails (3.2.0) babel-transpiler (>= 0.7.0) connection_pool execjs @@ -11,67 +11,67 @@ PATH GEM remote: http://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailbox (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.0.8.1) + actionpack (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8.1) + actionview (= 7.0.8.1) + activesupport (= 7.0.8.1) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actiontext (7.0.8.1) + actionpack (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.0.8.1) + activesupport (= 7.0.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + activejob (7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activestorage (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activesupport (= 7.0.8.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.0.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -110,7 +110,7 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.0) crass (1.0.6) - date (3.3.3) + date (3.3.4) docile (1.1.5) erubi (1.12.0) es5-shim-rails (4.0.1) @@ -120,8 +120,8 @@ GEM ffi (1.15.5) formatador (1.1.0) gem-release (2.2.2) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -153,22 +153,26 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) minitest (5.18.0) + minitest-retry (0.2.2) + minitest (>= 5.0) nenv (0.3.0) - net-imap (0.3.4) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) + nio4r (2.7.3) + nokogiri (1.13.8-x86_64-darwin) + racc (~> 1.4) nokogiri (1.13.8-x86_64-linux) racc (~> 1.4) notiffany (0.1.3) @@ -186,28 +190,28 @@ GEM rack (2.2.7) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails (7.0.8.1) + actioncable (= 7.0.8.1) + actionmailbox (= 7.0.8.1) + actionmailer (= 7.0.8.1) + actionpack (= 7.0.8.1) + actiontext (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activemodel (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.0.8.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + railties (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) method_source rake (>= 12.2) thor (~> 1.0) @@ -217,9 +221,9 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.7.0) - rexml (3.2.5) + rexml (3.2.6) rubyzip (2.3.2) - selenium-webdriver (4.8.3) + selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -230,13 +234,13 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) test-unit (2.5.5) - thor (1.2.1) - tilt (2.1.0) - timeout (0.3.2) + thor (1.2.2) + tilt (2.2.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - websocket (1.2.9) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -259,6 +263,7 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) + minitest-retry package_json pry-byebug rails (~> 7.0.x) diff --git a/gemfiles/shakapacker.gemfile b/gemfiles/shakapacker.gemfile index bbd6c5b4..f062cae0 100644 --- a/gemfiles/shakapacker.gemfile +++ b/gemfiles/shakapacker.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org/" -gem "rails", "~> 7.0.x" gem "shakapacker", "7.2.0" gemspec path: "../" diff --git a/gemfiles/shakapacker.gemfile.lock b/gemfiles/shakapacker.gemfile.lock index 7c2d6480..695ef2f6 100644 --- a/gemfiles/shakapacker.gemfile.lock +++ b/gemfiles/shakapacker.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - react-rails (3.1.1) + react-rails (3.2.0) babel-transpiler (>= 0.7.0) connection_pool execjs @@ -11,67 +11,67 @@ PATH GEM remote: http://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailbox (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.0.8.1) + actionpack (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8.1) + actionview (= 7.0.8.1) + activesupport (= 7.0.8.1) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actiontext (7.0.8.1) + actionpack (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.0.8.1) + activesupport (= 7.0.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + activejob (7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activestorage (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activesupport (= 7.0.8.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.0.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -110,7 +110,7 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.0) crass (1.0.6) - date (3.3.3) + date (3.3.4) docile (1.1.5) erubi (1.12.0) es5-shim-rails (4.0.1) @@ -153,22 +153,24 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) minitest (5.18.0) + minitest-retry (0.2.2) + minitest (>= 5.0) nenv (0.3.0) - net-imap (0.3.4) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) + nio4r (2.7.3) nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) nokogiri (1.14.3-x86_64-linux) @@ -190,28 +192,28 @@ GEM rack rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails (7.0.8.1) + actioncable (= 7.0.8.1) + actionmailbox (= 7.0.8.1) + actionmailer (= 7.0.8.1) + actionpack (= 7.0.8.1) + actiontext (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activemodel (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.0.8.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + railties (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) method_source rake (>= 12.2) thor (~> 1.0) @@ -221,9 +223,9 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.7.0) - rexml (3.2.5) + rexml (3.2.6) rubyzip (2.3.2) - selenium-webdriver (4.8.3) + selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -241,13 +243,13 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) test-unit (2.5.5) - thor (1.2.1) - tilt (2.1.0) - timeout (0.3.2) + thor (1.2.2) + tilt (2.2.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - websocket (1.2.9) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -270,9 +272,10 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) + minitest-retry package_json pry-byebug - rails (~> 7.0.x) + rails (~> 7.0.7, >= 7.0.7.2) react-rails! selenium-webdriver shakapacker (= 7.2.0) diff --git a/gemfiles/sprockets_3.gemfile b/gemfiles/sprockets_3.gemfile index ca312487..cfbf1cf3 100644 --- a/gemfiles/sprockets_3.gemfile +++ b/gemfiles/sprockets_3.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org/" -gem "rails", "~> 7.0.x" gem "sprockets", "~> 3.5" gem "sprockets-rails" gem "turbolinks", "~> 5" diff --git a/gemfiles/sprockets_3.gemfile.lock b/gemfiles/sprockets_3.gemfile.lock index d6c11456..a0d24d1c 100644 --- a/gemfiles/sprockets_3.gemfile.lock +++ b/gemfiles/sprockets_3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - react-rails (3.1.1) + react-rails (3.2.0) babel-transpiler (>= 0.7.0) connection_pool execjs @@ -11,67 +11,67 @@ PATH GEM remote: http://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailbox (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.0.8.1) + actionpack (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8.1) + actionview (= 7.0.8.1) + activesupport (= 7.0.8.1) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actiontext (7.0.8.1) + actionpack (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.0.8.1) + activesupport (= 7.0.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + activejob (7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activestorage (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activesupport (= 7.0.8.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.0.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -96,7 +96,6 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - childprocess (3.0.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) coderay (1.1.2) @@ -110,7 +109,7 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.2.2) crass (1.0.6) - date (3.3.3) + date (3.3.4) docile (1.1.5) erubi (1.11.0) es5-shim-rails (4.0.1) @@ -154,23 +153,25 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) method_source (0.9.2) mini_mime (1.1.2) mini_racer (0.6.4) libv8-node (~> 16.19.0.0) minitest (5.16.3) + minitest-retry (0.2.2) + minitest (>= 5.0) nenv (0.3.0) - net-imap (0.3.4) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) + nio4r (2.7.3) nokogiri (1.13.8-x86_64-darwin) racc (~> 1.4) nokogiri (1.13.8-x86_64-linux) @@ -190,28 +191,28 @@ GEM rack (2.2.4) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails (7.0.8.1) + actioncable (= 7.0.8.1) + actionmailbox (= 7.0.8.1) + actionmailer (= 7.0.8.1) + actionpack (= 7.0.8.1) + actiontext (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activemodel (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.0.8.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + railties (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) method_source rake (>= 12.2) thor (~> 1.0) @@ -221,10 +222,12 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.6.0) - rubyzip (2.0.0) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) - rubyzip (>= 1.2.2) + rexml (3.2.6) + rubyzip (2.3.2) + selenium-webdriver (4.9.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) shellany (0.0.1) simplecov (0.13.0) docile (~> 1.1.0) @@ -241,13 +244,14 @@ GEM test-unit (2.5.5) thor (1.2.1) tilt (2.0.10) - timeout (0.3.2) + timeout (0.4.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -271,9 +275,10 @@ DEPENDENCIES jbuilder listen (~> 3.0.0) mini_racer + minitest-retry package_json pry-byebug - rails (~> 7.0.x) + rails (~> 7.0.7, >= 7.0.7.2) react-rails! selenium-webdriver sprockets (~> 3.5) diff --git a/gemfiles/sprockets_4.gemfile b/gemfiles/sprockets_4.gemfile index 245032a2..f58f2eb4 100644 --- a/gemfiles/sprockets_4.gemfile +++ b/gemfiles/sprockets_4.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org/" -gem "rails", "~> 7.0.x" gem "sprockets", "~> 4.0.x" gem "sprockets-rails" gem "turbolinks", "~> 5" diff --git a/gemfiles/sprockets_4.gemfile.lock b/gemfiles/sprockets_4.gemfile.lock index 0de2c85b..bbce0d50 100644 --- a/gemfiles/sprockets_4.gemfile.lock +++ b/gemfiles/sprockets_4.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - react-rails (3.1.1) + react-rails (3.2.0) babel-transpiler (>= 0.7.0) connection_pool execjs @@ -11,67 +11,67 @@ PATH GEM remote: http://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailbox (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.0.8.1) + actionpack (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activesupport (= 7.0.8.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8.1) + actionview (= 7.0.8.1) + activesupport (= 7.0.8.1) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + actiontext (7.0.8.1) + actionpack (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.0.8.1) + activesupport (= 7.0.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + activejob (7.0.8.1) + activesupport (= 7.0.8.1) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activestorage (7.0.8.1) + actionpack (= 7.0.8.1) + activejob (= 7.0.8.1) + activerecord (= 7.0.8.1) + activesupport (= 7.0.8.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.0.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -96,7 +96,6 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - childprocess (3.0.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) coderay (1.1.2) @@ -110,7 +109,7 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.2.2) crass (1.0.6) - date (3.3.3) + date (3.3.4) docile (1.1.5) erubi (1.11.0) es5-shim-rails (4.0.1) @@ -154,23 +153,25 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) method_source (0.9.2) mini_mime (1.1.2) mini_racer (0.6.4) libv8-node (~> 16.19.0.0) minitest (5.16.3) + minitest-retry (0.2.2) + minitest (>= 5.0) nenv (0.3.0) - net-imap (0.3.4) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) + nio4r (2.7.3) nokogiri (1.13.8-x86_64-darwin) racc (~> 1.4) nokogiri (1.13.8-x86_64-linux) @@ -190,28 +191,28 @@ GEM rack (2.2.4) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails (7.0.8.1) + actioncable (= 7.0.8.1) + actionmailbox (= 7.0.8.1) + actionmailer (= 7.0.8.1) + actionpack (= 7.0.8.1) + actiontext (= 7.0.8.1) + actionview (= 7.0.8.1) + activejob (= 7.0.8.1) + activemodel (= 7.0.8.1) + activerecord (= 7.0.8.1) + activestorage (= 7.0.8.1) + activesupport (= 7.0.8.1) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.0.8.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + railties (7.0.8.1) + actionpack (= 7.0.8.1) + activesupport (= 7.0.8.1) method_source rake (>= 12.2) thor (~> 1.0) @@ -221,10 +222,12 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.6.0) - rubyzip (2.0.0) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) - rubyzip (>= 1.2.2) + rexml (3.2.6) + rubyzip (2.3.2) + selenium-webdriver (4.9.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) shellany (0.0.1) simplecov (0.13.0) docile (~> 1.1.0) @@ -241,13 +244,14 @@ GEM test-unit (2.5.5) thor (1.2.1) tilt (2.0.10) - timeout (0.3.2) + timeout (0.4.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -271,9 +275,10 @@ DEPENDENCIES jbuilder listen (~> 3.0.0) mini_racer + minitest-retry package_json pry-byebug - rails (~> 7.0.x) + rails (~> 7.0.7, >= 7.0.7.2) react-rails! selenium-webdriver sprockets (~> 4.0.x) diff --git a/react-rails.gemspec b/react-rails.gemspec index 39f06120..474de2e8 100644 --- a/react-rails.gemspec +++ b/react-rails.gemspec @@ -29,7 +29,8 @@ Gem::Specification.new do |s| s.add_development_dependency 'test-unit', '~> 2.5' s.add_development_dependency 'pry-byebug' s.add_development_dependency 'package_json' - + s.add_development_dependency 'rails', '~> 7.0.7', '>= 7.0.7.2' + s.add_development_dependency 'minitest-retry' s.add_dependency 'connection_pool' s.add_dependency 'execjs' diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb index 30727da9..6bf5f844 100644 --- a/test/dummy/app/views/layouts/application.html.erb +++ b/test/dummy/app/views/layouts/application.html.erb @@ -3,7 +3,6 @@ Dummy <% if ShakapackerHelpers.available? %> - <%= javascript_include_tag "turbolinks_only", "data-turbolinks-track" => true %> <%= javascript_pack_tag "application" %> <% elsif SprocketsHelpers.available? %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index d517d901..5a417885 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require File.expand_path("boot", __dir__) +require_relative("../../support/sprockets_helpers") +require_relative("../../support/webpacker_helpers") # Pick the frameworks you want: # require "active_record/railtie" @@ -18,6 +20,9 @@ module Dummy class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.0 + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/test/dummy/package.json b/test/dummy/package.json index e2bec6b0..f0b00f25 100644 --- a/test/dummy/package.json +++ b/test/dummy/package.json @@ -17,10 +17,10 @@ "css-minimizer-webpack-plugin": "^2.0.0", "mini-css-extract-plugin": "^1.6.2", "pnp-webpack-plugin": "^1.7.0", - "react": "^17.0.2", - "react-dom": "^17.0.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react_ujs": "file:.yalc/react_ujs", - "shakapacker": "7.0.2", + "shakapacker": "7.2.0", "style-loader": "^3.3.1", "terser-webpack-plugin": "^5.3.3", "webpack": "^5.73.0", diff --git a/test/dummy/yarn.lock b/test/dummy/yarn.lock index 00473501..17a62b91 100644 --- a/test/dummy/yarn.lock +++ b/test/dummy/yarn.lock @@ -4062,15 +4062,6 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" -react-dom@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.2" - react-dom@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" @@ -4089,14 +4080,6 @@ react-refresh@^0.13.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.13.0.tgz#cbd01a4482a177a5da8d44c9755ebb1f26d5a1c1" integrity sha512-XP8A9BT0CpRBD+NYLLeIhld/RqG9+gktUjW1FkE+Vm7OCinbG1SshcK5tb9ls4kzvjZr9mOQc7HYgBngEyPAXg== -react@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" @@ -4104,8 +4087,13 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" -react_ujs@^2.7.1, "react_ujs@file:.yalc/react_ujs": +react_ujs@^2.7.1: version "2.7.1" + resolved "https://registry.yarnpkg.com/react_ujs/-/react_ujs-2.7.1.tgz#d87cbcb82593fe59d30fc5dbc51800d1571001a8" + integrity sha512-nQ/y/Vn2hZQXjNxFKY4pV5hAQbG3o/8yaRzq3nJAAdk7tMgey/EsMKoDOWlEQxZ+D3J4BtwquW1oCESMiHSHnQ== + +"react_ujs@file:.yalc/react_ujs": + version "3.2.0" dependencies: "@babel/preset-react" "^7.22.5" css-loader "^6.8.1" @@ -4259,14 +4247,6 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scheduler@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" - integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -4414,10 +4394,10 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shakapacker@7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.0.2.tgz#cd7cb5075fdbf4d06e60d894f9076c8e56643a98" - integrity sha512-TF2GFb0E28fvQpn2L6RdvAHJRZmFMTvpJg93102tCbFywHq3tmTqwD/ijvlD+eMuZ8d1i3AMTnhO+45ayN3dYg== +shakapacker@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.2.0.tgz#0b8e03663800d7f2b07e2c93ed3270d4c5cf7306" + integrity sha512-DYqRKjjeeObYXB/OuEUcdy86zyfdMviqO6MmIq8XfXZtLldxsBnUGug2ON3DcKKy5OeCe/wd7Li/pLw1wAKhsw== dependencies: glob "^7.2.0" js-yaml "^4.1.0" diff --git a/test/react/rails/railtie_test.rb b/test/react/rails/railtie_test.rb index 7b1609c0..8352f0e1 100644 --- a/test/react/rails/railtie_test.rb +++ b/test/react/rails/railtie_test.rb @@ -4,7 +4,7 @@ class RailtieTest < ActionDispatch::IntegrationTest test "reloaders are configured after initializers are loaded" do - @test_file = File.expand_path("../../#{DUMMY_LOCATION}/app/pants/yfronts.js", File.dirname(__FILE__)) + @test_file = File.expand_path("../../dummy/app/pants/yfronts.js", File.dirname(__FILE__)) FileUtils.touch @test_file results = Dummy::Application.reloaders.map(&:updated?) diff --git a/test/react/rails/react_rails_ujs_test.rb b/test/react/rails/react_rails_ujs_test.rb index 698f4a5d..568b0c0c 100644 --- a/test/react/rails/react_rails_ujs_test.rb +++ b/test/react/rails/react_rails_ujs_test.rb @@ -10,14 +10,14 @@ class ReactRailsUJSTest < ActionDispatch::IntegrationTest def assert_greeting(page, greeting) assert page.has_content?(greeting), <<~MSG #{page.body} - #{page.driver.browser.manage.logs.get(:browser).inspect} + #{page.driver.browser.logs.get(:browser).inspect} MSG end def refute_greeting(page, greeting) assert page.has_no_content?(greeting), <<~MSG #{page.body} - #{page.driver.browser.manage.logs.get(:browser).inspect} + #{page.driver.browser.logs.get(:browser).inspect} MSG end diff --git a/test/react/server_rendering/exec_js_renderer_test.rb b/test/react/server_rendering/exec_js_renderer_test.rb index 887105cc..ff3b01c5 100644 --- a/test/react/server_rendering/exec_js_renderer_test.rb +++ b/test/react/server_rendering/exec_js_renderer_test.rb @@ -21,7 +21,7 @@ class ExecJSRendererTest < ActiveSupport::TestCase react_ujs_source = File.read(File.expand_path("../../../lib/assets/javascripts/react_ujs.js", __dir__)) todo_component_source = File.read( File.expand_path( - "../../../#{DUMMY_LOCATION}/app/assets/javascripts/components/PlainJSTodo.js", __FILE__ + "../../dummy/app/assets/javascripts/components/PlainJSTodo.js", __dir__ ) ) code = react_server_source + react_ujs_source + todo_component_source diff --git a/test/react_asset_test.rb b/test/react_asset_test.rb index c832b28a..6754b10d 100644 --- a/test/react_asset_test.rb +++ b/test/react_asset_test.rb @@ -13,7 +13,7 @@ class ReactAssetTest < ActionDispatch::IntegrationTest end test "asset pipeline should deliver drop-in react file replacement" do - app_react_file_path = File.expand_path("../#{DUMMY_LOCATION}/vendor/assets/javascripts/react.js", __FILE__) + app_react_file_path = File.expand_path("dummy/vendor/assets/javascripts/react.js", __dir__) react_file_token = "'test_confirmation_token_react_content_non_production';\n" File.write(app_react_file_path, react_file_token) SprocketsHelpers.manually_expire_asset("react.js") diff --git a/test/server_rendered_html_test.rb b/test/server_rendered_html_test.rb index 357be1be..390ae04b 100644 --- a/test/server_rendered_html_test.rb +++ b/test/server_rendered_html_test.rb @@ -20,11 +20,11 @@ def wait_to_ensure_asset_pipeline_detects_changes if ShakapackerHelpers.available? file_with_updates = File.expand_path("helper_files/TodoListWithUpdates.js", __dir__) file_without_updates = File.expand_path("helper_files/TodoListWithoutUpdates.js", __dir__) - app_file = File.expand_path("../#{DUMMY_LOCATION}/app/javascript/components/TodoList.js", __FILE__) + app_file = File.expand_path("dummy/app/javascript/components/TodoList.js", __dir__) else file_with_updates = File.expand_path("helper_files/TodoListWithUpdates.js.jsx", __dir__) file_without_updates = File.expand_path("helper_files/TodoListWithoutUpdates.js.jsx", __dir__) - app_file = File.expand_path("../#{DUMMY_LOCATION}/app/assets/javascripts/components/TodoList.js.jsx", __FILE__) + app_file = File.expand_path("dummy/app/assets/javascripts/components/TodoList.js.jsx", __dir__) end FileUtils.cp app_file, file_without_updates @@ -61,13 +61,13 @@ def wait_to_ensure_asset_pipeline_detects_changes end if ShakapackerHelpers.available? - new_file_path = "../#{DUMMY_LOCATION}/app/javascript/components/NewList.js" + new_file_path = "../dummy/app/javascript/components/NewList.js" new_file_contents = <<~JS var React = require("react") module.exports = function() { return "New List" } JS else - new_file_path = "../#{DUMMY_LOCATION}/app/assets/javascripts/components/ZZ_NewComponent.js.jsx" + new_file_path = "../dummy/app/assets/javascripts/components/ZZ_NewComponent.js.jsx" new_file_contents = <<~JS var NewList = function() { return "New List" } JS diff --git a/test/support/sprockets_helpers.rb b/test/support/sprockets_helpers.rb index 10846c47..25b5bb73 100644 --- a/test/support/sprockets_helpers.rb +++ b/test/support/sprockets_helpers.rb @@ -52,12 +52,12 @@ def precompile_assets Rails.application.assets_manifest = new_manifest end - assets_directory = File.expand_path("../../#{DUMMY_LOCATION}/public/assets", __FILE__) + assets_directory = File.expand_path("../dummy/public/assets", __dir__) raise "Asset precompilation failed" unless Dir.exist?(assets_directory) end def clear_precompiled_assets - assets_directory = File.expand_path("../../#{DUMMY_LOCATION}/public/assets", __FILE__) + assets_directory = File.expand_path("../dummy/public/assets", __dir__) FileUtils.rm_r(assets_directory) ENV.delete("RAILS_GROUPS") end @@ -69,7 +69,7 @@ def invoke_assets_precompile_task # Changing directories is required because: # - assets:precompile runs webpacker:compile when availabled # - webpacker:compile depends on `./bin/webpack`, so `.` must be the app root - Dir.chdir("./test/#{DUMMY_LOCATION}") do + Dir.chdir("./test/dummy") do ENV["RAILS_GROUPS"] = "assets" # required for Rails 3.2 Rake::Task["assets:precompile"].reenable diff --git a/test/support/webpacker_helpers.rb b/test/support/webpacker_helpers.rb index 32ee7694..b59276a9 100644 --- a/test/support/webpacker_helpers.rb +++ b/test/support/webpacker_helpers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module ShakapackerHelpers - PACKS_DIRECTORY = File.expand_path("../../#{DUMMY_LOCATION}/public/packs", __FILE__) + PACKS_DIRECTORY = File.expand_path("../dummy/public/packs", __dir__) module_function @@ -19,7 +19,7 @@ def compile return unless available? clear_shakapacker_packs - Dir.chdir("./test/#{DUMMY_LOCATION}") do + Dir.chdir("./test/dummy") do Rake::Task["shakapacker:compile"].reenable Rake::Task["shakapacker:compile"].invoke end @@ -45,7 +45,7 @@ def with_dev_server ENV["NODE_ENV"] = "development" # Start the server in a forked process: - Dir.chdir("test/#{DUMMY_LOCATION}") do + Dir.chdir("test/dummy") do spawn "RAILS_ENV=development ./bin/shakapacker-dev-server" end diff --git a/test/test_helper.rb b/test/test_helper.rb index f40f2d62..c3793d83 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,8 +5,6 @@ SimpleCov.start end -DUMMY_LOCATION = "dummy" - support_path = File.expand_path("support/*.rb", __dir__) Dir.glob(support_path).sort.each do |f| require(f) @@ -15,13 +13,15 @@ # Configure Rails Environment ENV["RAILS_ENV"] = "test" -require File.expand_path("../#{DUMMY_LOCATION}/config/environment.rb", __FILE__) +require File.expand_path("dummy/config/environment.rb", __dir__) require "rails/test_help" require "rails/generators" require "pathname" require "minitest/mock" require "capybara/rails" require "selenium/webdriver" +require "minitest/retry" +Minitest::Retry.use! Dummy::Application.load_tasks ShakapackerHelpers.clear_shakapacker_packs @@ -30,15 +30,15 @@ Capybara.server = :webrick Capybara.register_driver :headless_chrome do |app| - options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox headless disable-gpu]) + options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox headless=new disable-gpu]) - Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) + Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, timeout: 300) end Capybara.javascript_driver = :headless_chrome Capybara.current_driver = Capybara.javascript_driver -CACHE_PATH = Pathname.new File.expand_path("../#{DUMMY_LOCATION}/tmp/cache", __FILE__) +CACHE_PATH = Pathname.new File.expand_path("dummy/tmp/cache", __dir__) Rails.backtrace_cleaner.remove_silencers! From 9fce794166fba1c67b6db15d4a750a48c7fed84b Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 15 May 2024 12:23:18 -0500 Subject: [PATCH 08/17] replace missing unmountComponents in handleUnmount --- lib/assets/javascripts/react_ujs.js | 2 +- react_ujs/dist/react_ujs.js | 2 +- react_ujs/index.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/assets/javascripts/react_ujs.js b/lib/assets/javascripts/react_ujs.js index 0362f610..8ad34bc0 100644 --- a/lib/assets/javascripts/react_ujs.js +++ b/lib/assets/javascripts/react_ujs.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file diff --git a/react_ujs/dist/react_ujs.js b/react_ujs/dist/react_ujs.js index 0362f610..8ad34bc0 100644 --- a/react_ujs/dist/react_ujs.js +++ b/react_ujs/dist/react_ujs.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file diff --git a/react_ujs/index.js b/react_ujs/index.js index 0e0a209a..ac99ac8d 100644 --- a/react_ujs/index.js +++ b/react_ujs/index.js @@ -193,6 +193,7 @@ ReactRailsUJS.handleUnmount = function(e) { if (e && e.target) { target = e.target; } + ReactRailsUJS.unmountComponents(target); } From 17dad8d88d4cc78b2890dcf1d50181cb3d9a1ad2 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 15 May 2024 12:55:23 -0500 Subject: [PATCH 09/17] add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f31cc730..dabe6741 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Changes since the last non-beta release. _Please add entries here for your pull requests that are not yet released. Include LINKS for PRs and committers._ +#### Fixed +- Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by #1290 in 3.0.0 #1339 + ## [3.2.0] - 2024-01-10 #### Changed From 67d724e3effdf2dbc9c241339c515f034f917d22 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Tue, 14 May 2024 21:27:08 -0500 Subject: [PATCH 10/17] refactor root (un)mount to properly support multiple roots --- CHANGELOG.md | 4 +- Gemfile.lock | 5 ++ gemfiles/shakapacker.gemfile.lock | 5 ++ gemfiles/sprockets_3.gemfile.lock | 5 ++ gemfiles/sprockets_4.gemfile.lock | 5 ++ lib/assets/javascripts/react_ujs.js | 2 +- react-rails.gemspec | 1 + react_ujs/dist/react_ujs.js | 2 +- react_ujs/index.js | 46 ++++++++++++++----- .../app/controllers/application_controller.rb | 2 +- .../app/controllers/counters_controller.rb | 11 +++++ .../app/javascript/components/Counter.js | 23 ++++++++++ .../javascript/controllers/mount_counters.js | 26 +++++++++++ .../dummy/app/javascript/packs/application.js | 21 ++++++--- .../views/counters/create.turbo_stream.erb | 3 ++ test/dummy/app/views/counters/index.html.erb | 10 ++++ test/dummy/config/routes.rb | 1 + test/dummy/package.json | 2 + test/dummy/yarn.lock | 23 ++++++++++ test/react/rails/realtime_update_test.rb | 38 +++++++++++++++ 20 files changed, 212 insertions(+), 23 deletions(-) create mode 100644 test/dummy/app/controllers/counters_controller.rb create mode 100644 test/dummy/app/javascript/components/Counter.js create mode 100644 test/dummy/app/javascript/controllers/mount_counters.js create mode 100644 test/dummy/app/views/counters/create.turbo_stream.erb create mode 100644 test/dummy/app/views/counters/index.html.erb create mode 100644 test/react/rails/realtime_update_test.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index dabe6741..0bd54ba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # react-rails -If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. The ShakaCode.com team is helping to maintain this Ruby gem. You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. +If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. The ShakaCode.com team is helping to maintain this Ruby gem. You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. [#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209) @@ -12,6 +12,8 @@ _Please add entries here for your pull requests that are not yet released. Inclu #### Fixed - Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by #1290 in 3.0.0 #1339 +- Prevent roots from being re-created when using React 18 [PR 1305](https://github.com/reactjs/react-rails/pull/1305) by [diogobeda](https://github.com/diogobeda) + ## [3.2.0] - 2024-01-10 #### Changed diff --git a/Gemfile.lock b/Gemfile.lock index e6383b94..930a203c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -237,6 +237,10 @@ GEM thor (1.2.1) tilt (2.1.0) timeout (0.4.1) + turbo-rails (2.0.5) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) websocket (1.2.9) @@ -270,6 +274,7 @@ DEPENDENCIES react-rails! selenium-webdriver test-unit (~> 2.5) + turbo-rails BUNDLED WITH 2.4.9 diff --git a/gemfiles/shakapacker.gemfile.lock b/gemfiles/shakapacker.gemfile.lock index 695ef2f6..bfada423 100644 --- a/gemfiles/shakapacker.gemfile.lock +++ b/gemfiles/shakapacker.gemfile.lock @@ -246,6 +246,10 @@ GEM thor (1.2.2) tilt (2.2.0) timeout (0.4.1) + turbo-rails (2.0.5) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) websocket (1.2.10) @@ -280,6 +284,7 @@ DEPENDENCIES selenium-webdriver shakapacker (= 7.2.0) test-unit (~> 2.5) + turbo-rails BUNDLED WITH 2.4.9 diff --git a/gemfiles/sprockets_3.gemfile.lock b/gemfiles/sprockets_3.gemfile.lock index a0d24d1c..5199577a 100644 --- a/gemfiles/sprockets_3.gemfile.lock +++ b/gemfiles/sprockets_3.gemfile.lock @@ -245,6 +245,10 @@ GEM thor (1.2.1) tilt (2.0.10) timeout (0.4.1) + turbo-rails (2.0.5) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -284,6 +288,7 @@ DEPENDENCIES sprockets (~> 3.5) sprockets-rails test-unit (~> 2.5) + turbo-rails turbolinks (~> 5) BUNDLED WITH diff --git a/gemfiles/sprockets_4.gemfile.lock b/gemfiles/sprockets_4.gemfile.lock index bbce0d50..de4452e0 100644 --- a/gemfiles/sprockets_4.gemfile.lock +++ b/gemfiles/sprockets_4.gemfile.lock @@ -245,6 +245,10 @@ GEM thor (1.2.1) tilt (2.0.10) timeout (0.4.1) + turbo-rails (2.0.5) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -284,6 +288,7 @@ DEPENDENCIES sprockets (~> 4.0.x) sprockets-rails test-unit (~> 2.5) + turbo-rails turbolinks (~> 5) BUNDLED WITH diff --git a/lib/assets/javascripts/react_ujs.js b/lib/assets/javascripts/react_ujs.js index 8ad34bc0..4b4ee130 100644 --- a/lib/assets/javascripts/react_ujs.js +++ b/lib/assets/javascripts/react_ujs.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),i=n(831),d=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:i,constructorFromRequireContextWithGlobalFallback:d,useContext:function(e){this.getConstructor=d(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>d});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const i=c;function d(){return"function"==typeof i.hydrate||"function"==typeof i.hydrateRoot}function s(e,t){return"function"==typeof i.hydrateRoot?i.hydrateRoot(e,t):i.hydrate(t,e)}function _(e){return u()?i.createRoot(e):function(e){return{render:t=>i.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file diff --git a/react-rails.gemspec b/react-rails.gemspec index 474de2e8..b977bfad 100644 --- a/react-rails.gemspec +++ b/react-rails.gemspec @@ -30,6 +30,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'pry-byebug' s.add_development_dependency 'package_json' s.add_development_dependency 'rails', '~> 7.0.7', '>= 7.0.7.2' + s.add_development_dependency 'turbo-rails' s.add_development_dependency 'minitest-retry' s.add_dependency 'connection_pool' diff --git a/react_ujs/dist/react_ujs.js b/react_ujs/dist/react_ujs.js index 8ad34bc0..4b4ee130 100644 --- a/react_ujs/dist/react_ujs.js +++ b/react_ujs/dist/react_ujs.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),i=n(831),d=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:i,constructorFromRequireContextWithGlobalFallback:d,useContext:function(e){this.getConstructor=d(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},528:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},921:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},724:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},121:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},831:e=>{e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach((function(e){a=a[e]})),a.__esModule&&(a=a.default),a}}},37:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},39:(e,t,n)=>{var o=n(121),r=n(831);e.exports=function(e){var t=e.map((e=>r(e)));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>d});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const i=c;function d(){return"function"==typeof i.hydrate||"function"==typeof i.hydrateRoot}function s(e,t){return"function"==typeof i.hydrateRoot?i.hydrateRoot(e,t):i.hydrate(t,e)}function _(e){return u()?i.createRoot(e):function(e){return{render:t=>i.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(10);return __webpack_exports__})())); \ No newline at end of file diff --git a/react_ujs/index.js b/react_ujs/index.js index ac99ac8d..2d8a70aa 100644 --- a/react_ujs/index.js +++ b/react_ujs/index.js @@ -131,11 +131,8 @@ var ReactRailsUJS = { if (hydrate && supportsHydration()) { component = reactHydrate(node, component); } else { - const root = createReactRootLike(node) + const root = this.findOrCreateRoot(node); component = root.render(component); - if(supportsRootApi) { - this.roots.push({"node": node, "root": root}) - } } } } @@ -164,19 +161,44 @@ var ReactRailsUJS = { detectEvents(this) }, - unmountRoot: function(node) { - var targetRoots = this.roots.filter( + findOrCreateRoot: function(node) { + var root = this.findRoot(node); + if (!root) { + root = createReactRootLike(node); + if(supportsRootApi) { + this.roots.push({"node": node, "root": root}) + } + } + + return root; + }, + + findRoot: function(node) { + if (!supportsRootApi) { + return; + } + var rootElement = this.roots.find( function(rootElement) { return rootElement["node"] && (rootElement["node"] === node) } - ) - targetRoots.forEach( + ); + if (rootElement) { + return rootElement["root"]; + } + }, + + unmountRoot: function(node) { + var targetRoot = this.findRoot(node); + if (!targetRoot) { + return; + } + + targetRoot.unmount(); + this.roots = this.roots.filter( function(rootElement) { - rootElement["root"].unmount(); - rootElement["root"] = null; - rootElement["node"] = null; + return rootElement["node"] !== node } - ) + ); } } diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb index 1ff0944d..e21efdd5 100644 --- a/test/dummy/app/controllers/application_controller.rb +++ b/test/dummy/app/controllers/application_controller.rb @@ -3,5 +3,5 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception + # protect_from_forgery with: :exception end diff --git a/test/dummy/app/controllers/counters_controller.rb b/test/dummy/app/controllers/counters_controller.rb new file mode 100644 index 00000000..2d4296db --- /dev/null +++ b/test/dummy/app/controllers/counters_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CountersController < ApplicationController + def index + @counters = [{ name: "Counter 1" }] + end + + def create + @counter = { name: "Counter 2" } + end +end diff --git a/test/dummy/app/javascript/components/Counter.js b/test/dummy/app/javascript/components/Counter.js new file mode 100644 index 00000000..f1bcd644 --- /dev/null +++ b/test/dummy/app/javascript/components/Counter.js @@ -0,0 +1,23 @@ +var React = require("react"); +var createReactClass = require("create-react-class"); + +module.exports = createReactClass({ + getInitialState: function () { + return { count: 0 }; + }, + handleClick: function () { + this.setState({ count: this.state.count + 1 }); + }, + render: function () { + return ( +
+

+ {this.props.name} - {this.state.count} +

+ +
+ ); + }, +}); diff --git a/test/dummy/app/javascript/controllers/mount_counters.js b/test/dummy/app/javascript/controllers/mount_counters.js new file mode 100644 index 00000000..36368752 --- /dev/null +++ b/test/dummy/app/javascript/controllers/mount_counters.js @@ -0,0 +1,26 @@ +var { Controller } = require("@hotwired/stimulus"); +var ReactRailsUJS = require("react_ujs"); + +module.exports = class extends Controller { + connect() { + this.observeChange(); + } + + disconnect() { + this.observer.disconnect(); + } + + observeChange() { + var element = this.element; + var callback = function (mutationsList, _observer) { + mutationsList.forEach(function (mutation) { + if (mutation.type === "childList") { + ReactRailsUJS.mountComponents(element); + } + }); + }; + + this.observer = new MutationObserver(callback); + this.observer.observe(this.element, { childList: true }); + } +}; diff --git a/test/dummy/app/javascript/packs/application.js b/test/dummy/app/javascript/packs/application.js index bffb39c6..74444a37 100644 --- a/test/dummy/app/javascript/packs/application.js +++ b/test/dummy/app/javascript/packs/application.js @@ -1,8 +1,15 @@ -var ctx = require.context("components", true) -var ReactRailsUJS = require("react_ujs") -ReactRailsUJS.useContext(ctx) -var React = require("react") +require("@hotwired/turbo-rails"); +var { Application } = require("@hotwired/stimulus"); +var MountCountersController = require("../controllers/mount_counters"); -window.GlobalComponent = function(props) { - return React.createElement("h1", null, "Global Component") -} +window.Stimulus = Application.start(); +Stimulus.register("mount-counters", MountCountersController); + +var ctx = require.context("components", true); +var ReactRailsUJS = require("react_ujs"); +ReactRailsUJS.useContext(ctx); +var React = require("react"); + +window.GlobalComponent = function (props) { + return React.createElement("h1", null, "Global Component"); +}; diff --git a/test/dummy/app/views/counters/create.turbo_stream.erb b/test/dummy/app/views/counters/create.turbo_stream.erb new file mode 100644 index 00000000..e0e93eb2 --- /dev/null +++ b/test/dummy/app/views/counters/create.turbo_stream.erb @@ -0,0 +1,3 @@ +<%= turbo_stream.append :counters do %> + <%= react_component("Counter", @counter) %> +<% end %> diff --git a/test/dummy/app/views/counters/index.html.erb b/test/dummy/app/views/counters/index.html.erb new file mode 100644 index 00000000..bbac3df6 --- /dev/null +++ b/test/dummy/app/views/counters/index.html.erb @@ -0,0 +1,10 @@ +

React 18 bug reproduction

+ +<%= turbo_frame_tag :counters, data: { controller: "mount-counters" } do %> + <% @counters.each do |counter| %> + <%= react_component("Counter", counter) %> + <% end %> +<% end %> +<%= form_with(url: counters_path, method: :post, data: { turbo: true, turbo_stream: true }) do |form| %> + <%= form.submit "Add counter" %> +<% end %> diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb index ef57ce2a..0c308456 100644 --- a/test/dummy/config/routes.rb +++ b/test/dummy/config/routes.rb @@ -3,6 +3,7 @@ Dummy::Application.routes.draw do get "no-turbolinks", to: "pages#no_turbolinks" resources :pages, only: [:show] + resources :counters, only: %i[create index] resources :server, only: [:show] do collection do get :console_example diff --git a/test/dummy/package.json b/test/dummy/package.json index f0b00f25..63a49f4c 100644 --- a/test/dummy/package.json +++ b/test/dummy/package.json @@ -9,6 +9,8 @@ "@babel/preset-react": "^7.17.12", "@babel/preset-typescript": "^7.17.12", "@babel/runtime": "^7.18.3", + "@hotwired/stimulus": "^3.2.2", + "@hotwired/turbo-rails": "^7.3.0", "babel-loader": "^8.2.5", "babel-plugin-macros": "^3.1.0", "compression-webpack-plugin": "^9.2.0", diff --git a/test/dummy/yarn.lock b/test/dummy/yarn.lock index 17a62b91..f8833752 100644 --- a/test/dummy/yarn.lock +++ b/test/dummy/yarn.lock @@ -1100,6 +1100,24 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@hotwired/stimulus@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" + integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== + +"@hotwired/turbo-rails@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.3.0.tgz#422c21752509f3edcd6c7b2725bbe9e157815f51" + integrity sha512-fvhO64vp/a2UVQ3jue9WTc2JisMv9XilIC7ViZmXAREVwiQ2S4UC7Go8f9A1j4Xu7DBI6SbFdqILk5ImqVoqyA== + dependencies: + "@hotwired/turbo" "^7.3.0" + "@rails/actioncable" "^7.0" + +"@hotwired/turbo@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.3.0.tgz#2226000fff1aabda9fd9587474565c9929dbf15d" + integrity sha512-Dcu+NaSvHLT7EjrDrkEmH4qET2ZJZ5IcCWmNXxNQTBwlnE5tBZfN6WxZ842n5cHV52DH/AKNirbPBtcEXDLW4g== + "@jest/schemas@^29.6.0": version "29.6.0" resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040" @@ -1195,6 +1213,11 @@ schema-utils "^3.0.0" source-map "^0.7.3" +"@rails/actioncable@^7.0": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.1.3.tgz#4db480347775aeecd4dde2405659eef74a458881" + integrity sha512-ojNvnoZtPN0pYvVFtlO7dyEN9Oml1B6IDM+whGKVak69MMYW99lC2NOWXWeE3bmwEydbP/nn6ERcpfjHVjYQjA== + "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" diff --git a/test/react/rails/realtime_update_test.rb b/test/react/rails/realtime_update_test.rb new file mode 100644 index 00000000..6c7f94e7 --- /dev/null +++ b/test/react/rails/realtime_update_test.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require "test_helper" + +class RealtimeUpdateTest < ActiveSupport::TestCase + ShakapackerHelpers.when_shakapacker_available do + include Capybara::DSL + + def assert_counter_count(page, timer_name, count) + assert page.has_content?("#{timer_name} - #{count}"), <<~MSG + #{page.body} + #{page.driver.browser.logs.get(:browser).inspect} + MSG + end + + setup do + Capybara.current_driver = Capybara.javascript_driver + ShakapackerHelpers.compile + React::ServerRendering.reset_pool + end + + teardown do + ShakapackerHelpers.clear_shakapacker_packs + end + + test "doesn't re-mount the components trees when mountComponents is called" do + visit "/counters" + + assert_counter_count(page, "Counter 1", 0) + page.click_button "Increment Counter 1" + page.click_button "Add counter" + sleep 0.1 + + assert_counter_count(page, "Counter 1", 1) + assert_counter_count(page, "Counter 2", 0) + end + end +end From 35da5b918093dea9f9e87703420d8f4f5beeeff1 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 15 May 2024 22:24:12 -1000 Subject: [PATCH 11/17] Update README.md --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b9de761..967ca626 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,15 @@ You can find [migration to React on Rails steps here](https://github.com/reactjs --- ## ShakaCode Support -[ShakaCode](https://www.shakacode.com) offers support for upgrading this gem, and related gems such as Webpacker and using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com). We're also [hiring](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddb351abe)! +[ShakaCode](https://www.shakacode.com) focuses on helping Ruby on Rails teams use React and Webpack better. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead. -Here's a testimonial of how ShakaCode can help, from [Florian GรถรŸler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023: +For an overview of working with us, see our [Client Engagement Model](https://www.shakacode.com/blog/client-engagement-model/) article and [how we bill for time](https://www.shakacode.com/blog/shortcut-jira-trello-github-toggl-time-and-task-tracking/). + +We also specialize in helping development teams lower infrastructure and CI costs. Check out our project [Control Plane Flow](https://github.com/shakacode/control-plane-flow/), which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings. + +If you think ShakaCode can help your project, [click here](https://meetings.hubspot.com/justingordon/30-minute-consultation) to book a call with [Justin Gordon](mailto:justin@shakacode.com), the creator of React on Rails and Shakapacker. + +Here's a testimonial of how ShakaCode can help from [Florian GรถรŸler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023: > Hey Justin ๐Ÿ‘‹ > > I just wanted to let you know that we today shipped the webpacker to shakapacker upgrades and it all seems to be running smoothly! Thanks again for all your support and your teams work! ๐Ÿ˜ @@ -35,7 +41,7 @@ Here's a testimonial of how ShakaCode can help, from [Florian GรถรŸler](https:// > > Have a great 2023 and maybe we get to work together again later in the year! ๐Ÿ™Œ -Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154). Here's [another review of a Shakapacker migration that led to more work](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2096078). +Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154). ## Resources * [Click to join **React + Rails Slack**](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE). Then join the channel `#react-rails`. @@ -127,3 +133,7 @@ The following companies provide licenses to the ShakaCode team, supporting the d BrowserStack + +--- + +ShakaCode is [hiring](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddddb351abe)! From 1efb8acff94a1bfb3164a4f0d09b852c655bdd01 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 16 May 2024 18:16:09 -1000 Subject: [PATCH 12/17] Update Gemfile.lock --- Gemfile.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 930a203c..a61f2660 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,6 +157,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) + mini_portile2 (2.8.6) minitest (5.17.0) minitest-retry (0.2.2) minitest (>= 5.0) @@ -171,6 +172,9 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) + nokogiri (1.14.3) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) nokogiri (1.14.3-x86_64-linux) @@ -252,6 +256,7 @@ GEM zeitwerk (2.6.6) PLATFORMS + ruby x86_64-darwin-20 x86_64-linux From 2fca3a1b25e00f56e7393c607f774ef08695ce0b Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 16 May 2024 18:17:11 -1000 Subject: [PATCH 13/17] Release 3.2.1 --- Gemfile.lock | 2 +- lib/react/rails/version.rb | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a61f2660..08618670 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - react-rails (3.2.0) + react-rails (3.2.1) babel-transpiler (>= 0.7.0) connection_pool execjs diff --git a/lib/react/rails/version.rb b/lib/react/rails/version.rb index 01c34b9c..8d4f95bd 100644 --- a/lib/react/rails/version.rb +++ b/lib/react/rails/version.rb @@ -4,6 +4,6 @@ module React module Rails # If you change this, make sure to update VERSIONS.md # and republish the UJS by updating package.json and `bundle exec rake ujs:publish` - VERSION = "3.2.0" + VERSION = "3.2.1" end end diff --git a/package.json b/package.json index c82c3305..76754472 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react_ujs", - "version": "3.2.0", + "version": "3.2.1", "description": "Rails UJS for the react-rails gem", "repository": "reactjs/react-rails", "main": "react_ujs/index.js", From d4aea913bcbca31c8445079563716911da28f20d Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 16 May 2024 18:24:53 -1000 Subject: [PATCH 14/17] Update CHANGELOG.md --- CHANGELOG.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd54ba3..4f570692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,24 @@ # react-rails -If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. The ShakaCode.com team is helping to maintain this Ruby gem. You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. +If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead. -[#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209) +For an overview of working with us, see our [Client Engagement Model](https://www.shakacode.com/blog/client-engagement-model/) article and [how we bill for time](https://www.shakacode.com/blog/shortcut-jira-trello-github-toggl-time-and-task-tracking/). + +We also specialize in helping development teams lower infrastructure and CI costs. Check out our project [Control Plane Flow](https://github.com/shakacode/control-plane-flow/), which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings. + +If you think ShakaCode can help your project, [click here](https://meetings.hubspot.com/justingordon/30-minute-consultation) to book a call with [Justin Gordon](mailto:justin@shakacode.com), the creator of React on Rails and Shakapacker. + +You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem. ## Unreleased Changes since the last non-beta release. -_Please add entries here for your pull requests that are not yet released. Include LINKS for PRs and committers._ +_Please add entries here for your pull requests that have not yet been released. Include LINKS for PRs and committers._ + +## [3.2.1] - 2024-05-16 #### Fixed -- Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by #1290 in 3.0.0 #1339 +- Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by [PR 1290](https://github.com/reactjs/react-rails/pull/1305) in 3.0.0 [PR 1339](https://github.com/reactjs/react-rails/pull/1339). - Prevent roots from being re-created when using React 18 [PR 1305](https://github.com/reactjs/react-rails/pull/1305) by [diogobeda](https://github.com/diogobeda) @@ -48,6 +56,8 @@ _Please add entries here for your pull requests that are not yet released. Inclu ## [2.7.0] - 2023-05-06 +[#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209) + #### New Features - Camelizes keys with primitive values, in addition to hashes #946 - Expose alternative implementations for `ReactUJS.getConstructor` #1050 @@ -578,7 +588,8 @@ _Please add entries here for your pull requests that are not yet released. Inclu - Server rendering with `prerender: true` - Transform `.jsx` in the asset pipeline -[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.2.0...main +[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.2.1...main +[3.2.1]: https://github.com/reactjs/react-rails/compare/v3.2.1...v3.2.1 [3.2.0]: https://github.com/reactjs/react-rails/compare/v3.1.1...v3.2.0 [3.1.1]: https://github.com/reactjs/react-rails/compare/v3.1.0...v3.1.1 [3.1.0]: https://github.com/reactjs/react-rails/compare/v3.0.0...v3.1.0 From 3b69603029070066edb0160cce21f58942fb5428 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 16 May 2024 18:36:10 -1000 Subject: [PATCH 15/17] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f570692..3401de74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# react-rails +# Changelog for React-Rails If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead. From ae3508b1fd9a17d308943abb0ba534067c20d674 Mon Sep 17 00:00:00 2001 From: Muhammad Umar Date: Fri, 18 Oct 2024 00:33:56 +0300 Subject: [PATCH 16/17] Add honeybadger logo to supporters --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 967ca626..8b1b7177 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,11 @@ The following companies provide licenses to the ShakaCode team, supporting the d BrowserStack + + + Control Plane + + --- From 46bf3ff286a0b29dd63a389f563f49a7a7aa0966 Mon Sep 17 00:00:00 2001 From: Muhammad Umar Date: Fri, 18 Oct 2024 17:07:11 +0300 Subject: [PATCH 17/17] change alt text: honeyBadger --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b1b7177..235af500 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ The following companies provide licenses to the ShakaCode team, supporting the d - Control Plane + HoneyBadger