react_on_rails 13.3.0 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +5 -4
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  4. data/.github/PULL_REQUEST_TEMPLATE.md +19 -0
  5. data/.github/workflows/lint-js-and-ruby.yml +2 -1
  6. data/.github/workflows/main.yml +17 -18
  7. data/.github/workflows/rspec-package-specs.yml +1 -0
  8. data/.prettierignore +3 -1
  9. data/CHANGELOG.md +106 -56
  10. data/Gemfile.development_dependencies +2 -2
  11. data/README.md +9 -1
  12. data/docs/additional-details/recommended-project-structure.md +6 -6
  13. data/docs/additional-details/tips-for-usage-with-sp6.md +15 -0
  14. data/docs/deployment/heroku-deployment.md +15 -11
  15. data/docs/getting-started.md +28 -27
  16. data/docs/guides/configuration.md +29 -19
  17. data/docs/guides/deployment.md +3 -2
  18. data/docs/guides/file-system-based-automated-bundle-generation.md +57 -51
  19. data/docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md +10 -10
  20. data/docs/guides/how-react-on-rails-works.md +6 -6
  21. data/docs/guides/how-to-conditionally-server-render-based-on-device-type.md +2 -1
  22. data/docs/guides/installation-into-an-existing-rails-app.md +10 -8
  23. data/docs/guides/rails-webpacker-react-integration-options.md +34 -4
  24. data/docs/guides/react-on-rails-overview.md +6 -7
  25. data/docs/guides/rspec-configuration.md +11 -11
  26. data/docs/guides/tutorial.md +89 -83
  27. data/docs/guides/upgrading-react-on-rails.md +2 -2
  28. data/docs/guides/webpack-configuration.md +14 -14
  29. data/docs/home.md +3 -3
  30. data/docs/javascript/asset-pipeline.md +4 -4
  31. data/docs/javascript/converting-from-custom-webpack-config-to-rails-webpacker-config.md +8 -8
  32. data/docs/javascript/server-rendering-tips.md +1 -1
  33. data/docs/javascript/troubleshooting-when-using-shakapacker.md +77 -0
  34. data/docs/outdated/rails-assets-relative-paths.md +1 -1
  35. data/docs/outdated/rails-assets.md +1 -1
  36. data/docs/react-on-rails-pro/react-on-rails-pro.md +1 -1
  37. data/lib/generators/react_on_rails/adapt_for_older_shakapacker_generator.rb +41 -0
  38. data/lib/generators/react_on_rails/base_generator.rb +3 -47
  39. data/lib/generators/react_on_rails/bin/dev +2 -5
  40. data/lib/generators/react_on_rails/bin/dev-static +2 -5
  41. data/lib/generators/react_on_rails/generator_messages.rb +40 -0
  42. data/lib/generators/react_on_rails/install_generator.rb +30 -0
  43. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev +2 -2
  44. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-static +2 -2
  45. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +2 -2
  46. data/lib/generators/react_on_rails/templates/base/base/config/{webpacker.yml → shakapacker.yml} +3 -3
  47. data/lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js.tt +3 -1
  48. data/lib/react_on_rails/configuration.rb +16 -16
  49. data/lib/react_on_rails/helper.rb +26 -27
  50. data/lib/react_on_rails/packs_generator.rb +12 -5
  51. data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +1 -3
  52. data/lib/react_on_rails/test_helper/ensure_assets_compiled.rb +1 -1
  53. data/lib/react_on_rails/test_helper.rb +10 -1
  54. data/lib/react_on_rails/utils.rb +0 -4
  55. data/lib/react_on_rails/version.rb +1 -1
  56. data/lib/react_on_rails/webpacker_utils.rb +8 -3
  57. data/package.json +1 -1
  58. data/rakelib/dummy_apps.rake +6 -1
  59. data/rakelib/run_rspec.rake +1 -15
  60. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e61be8a6315e32bd3127d5ed676e1235c9e44cb43ff011dde722947c4f18b518
4
- data.tar.gz: 61be21f2eda6b8a58688af7a69f88b70c2b0dbfe23a9addf68f2894829e96787
3
+ metadata.gz: 545e97728f6633e1adc5091f8e1a72c377ce8d8c809ca8b6378c0b1bffe62c7d
4
+ data.tar.gz: 06a83f533ee9518518afeb63a31191861298f92a2ec36b876914347de0a0f960
5
5
  SHA512:
6
- metadata.gz: '069f91f435f7609c582a197e100e0140c9d4045b472fa163a06819847d860a339d0fba56ab408d32aa7307cb2b1205dfd5387b6e503810897a4898d6acf56dee'
7
- data.tar.gz: ed764a94f2cf6b4ff1a50d605c73cab97371e0a0bc68bb344bc1978988c54b213b44cbc2bce6f6045158d662e7e8201e829f801df2a07392394dfcfcade3e3d4
6
+ metadata.gz: 9bc25f3009cc3775d59d456e2009fe3c7f692a13268bf559a1059547c8c56998d8c0c2856a9b8e43079afa6ffa3705a6c1f613ecf9864ae6b3cc0697c5f46ac7
7
+ data.tar.gz: 860f4fc51d1bef3f7cc4599335062881681b3acd70e6f1104ecbc24e128e175ddb0b3aa44ee6c2b0d36c2596c6d118eb1ded0ec92fcab8781efa2233c2cd3875
data/.circleci/config.yml CHANGED
@@ -1,3 +1,4 @@
1
+ # CircleCI is not longer in use by this repository & this file is now for reference only.
1
2
  version: 2
2
3
 
3
4
  aliases:
@@ -53,7 +54,7 @@ aliases:
53
54
  - &install-dummy-app-ruby-gems
54
55
  name: Install Ruby Gems for dummy app
55
56
  command: |
56
- gem install bundler
57
+ gem install bundler:2.4.17
57
58
  echo "Bundler version: "; bundle --version
58
59
  cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
59
60
 
@@ -61,7 +62,7 @@ aliases:
61
62
  - &install-package-ruby-gems
62
63
  name: Install Ruby Gems for package
63
64
  command: |
64
- gem install bundler
65
+ gem install bundler:2.4.17
65
66
  echo "Bundler version: "; bundle --version
66
67
  bundle lock --add-platform 'x86_64-linux'
67
68
  bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
@@ -272,12 +273,12 @@ jobs:
272
273
  name: Prep for CI
273
274
  # TODO -- need to leverage Circle CI containers
274
275
  command: |
275
- bundle exec rails prepare_for_ci
276
+ bundle exec rake prepare_for_ci
276
277
  - run:
277
278
  name: Main CI
278
279
  # TODO -- need to leverage Circle CI containers
279
280
  command: |
280
- bundle exec rails run_rspec:all_dummy
281
+ bundle exec rake run_rspec:all_dummy
281
282
  # The following step will run only if the main job is finished successfully.
282
283
  # Build hook is triggered by curl command described here https://docs.netlify.com/configure-builds/build-hooks/
283
284
  # NETLIFY_HOOK is an environment variable on CircleCI to keep sensitive data outside the repo
@@ -13,7 +13,7 @@ A bug is a crash or incorrect behavior. If you have a debugging or troubleshooti
13
13
 
14
14
  1. Ruby version:
15
15
  2. Rails version:
16
- 3. Webpacker version:
16
+ 3. Shakapacker/Webpacker version:
17
17
  4. React on Rails version:
18
18
 
19
19
  ## Expected behavior
@@ -0,0 +1,19 @@
1
+ ### Summary
2
+
3
+ _Remove this paragraph and provide a general description of the code changes in your pull
4
+ request... were there any bugs you had fixed? If so, mention them. If
5
+ these bugs have open GitHub issues, be sure to tag them here as well,
6
+ to keep the conversation linked together._
7
+
8
+ ### Pull Request checklist
9
+ _Remove this line after checking all the items here. If the item is not applicable to the PR, both check it out and wrap it by `~`._
10
+
11
+ - [ ] Add/update test to cover these changes
12
+ - [ ] Update documentation
13
+ - [ ] Update CHANGELOG file
14
+ _Add the CHANGELOG entry at the top of the file._
15
+
16
+ ### Other Information
17
+
18
+ _Remove this paragraph and mention any other important and relevant information such as benchmarks._
19
+
@@ -15,6 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
+ bundler: 2.4.17
18
19
  - name: Setup Node
19
20
  uses: actions/setup-node@v2-beta
20
21
  with:
@@ -44,7 +45,7 @@ jobs:
44
45
  yarn run eslint -v
45
46
  sudo yarn global add yalc
46
47
  - name: Install Ruby Gems for package
47
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
48
+ run: bundle check --path=vendor/bundle || bundle _2.4.17_ install --path=vendor/bundle --jobs=4 --retry=3
48
49
  - name: Linting of Ruby
49
50
  run: bundle exec rubocop
50
51
  - name: Linting of JS
@@ -15,6 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
+ bundler: 2.4.17
18
19
  # libyaml-dev is needed for psych v5
19
20
  # this gem depends on sdoc which depends on rdoc which depends on psych
20
21
  - name: Fix dependency for libyaml-dev
@@ -33,7 +34,7 @@ jobs:
33
34
  echo "Yarn version: "; yarn --version
34
35
  echo "Bundler version: "; bundle --version
35
36
  - name: Save root node_modules to cache
36
- uses: actions/cache@v2
37
+ uses: actions/cache@v3
37
38
  with:
38
39
  path: node_modules
39
40
  key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
@@ -45,7 +46,7 @@ jobs:
45
46
  - name: yalc publish for react-on-rails
46
47
  run: yalc publish
47
48
  - name: Save spec/dummy/node_modules to cache
48
- uses: actions/cache@v2
49
+ uses: actions/cache@v3
49
50
  with:
50
51
  path: spec/dummy/node_modules
51
52
  key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
@@ -54,12 +55,12 @@ jobs:
54
55
  - name: Install Node modules with Yarn for dummy app
55
56
  run: cd spec/dummy && yarn install --no-progress --no-emoji
56
57
  - name: Save dummy app ruby gems to cache
57
- uses: actions/cache@v2
58
+ uses: actions/cache@v3
58
59
  with:
59
60
  path: spec/dummy/vendor/bundle
60
61
  key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
61
62
  - name: Install Ruby Gems for dummy app
62
- run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
63
+ run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.17_ install --path=vendor/bundle --jobs=4 --retry=3
63
64
  - name: generate file system-based packs
64
65
  run: cd spec/dummy && RAILS_ENV=test bundle exec rake react_on_rails:generate_packs
65
66
  - name: Build test bundles for dummy app
@@ -67,7 +68,7 @@ jobs:
67
68
  - id: get-sha
68
69
  run: echo "::set-output name=sha::$(git rev-parse HEAD)"
69
70
  - name: Save test webpack bundles to cache (for build number checksum used by rspec job)
70
- uses: actions/cache@v2
71
+ uses: actions/cache/save@v3
71
72
  with:
72
73
  path: spec/dummy/public/webpack
73
74
  key: v5-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
@@ -78,7 +79,7 @@ jobs:
78
79
  matrix:
79
80
  ruby: [2.7]
80
81
  node: [14]
81
- rake_task: ['run_rspec:all_dummy', 'run_rspec:all_but_examples', 'run_rspec:examples']
82
+ rake_task: ['run_rspec:all_but_examples', 'run_rspec:examples']
82
83
  runs-on: ubuntu-22.04
83
84
  steps:
84
85
  - uses: actions/checkout@v2
@@ -86,6 +87,7 @@ jobs:
86
87
  uses: ruby/setup-ruby@v1
87
88
  with:
88
89
  ruby-version: ${{ matrix.ruby }}
90
+ bundler: 2.4.17
89
91
  - name: Setup Node
90
92
  uses: actions/setup-node@v2-beta
91
93
  with:
@@ -100,33 +102,32 @@ jobs:
100
102
  echo "Yarn version: "; yarn --version
101
103
  echo "Bundler version: "; bundle --version
102
104
  - name: Save root node_modules to cache
103
- uses: actions/cache@v2
105
+ uses: actions/cache@v3
104
106
  with:
105
107
  path: node_modules
106
108
  key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
107
109
  - name: Save root ruby gems to cache
108
- uses: actions/cache@v2
110
+ uses: actions/cache@v3
109
111
  with:
110
112
  path: vendor/bundle
111
113
  key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
112
114
  - name: Save dummy app ruby gems to cache
113
- uses: actions/cache@v2
115
+ uses: actions/cache@v3
114
116
  with:
115
117
  path: spec/dummy/vendor/bundle
116
118
  key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
117
119
  - name: Save spec/dummy/node_modules to cache
118
- uses: actions/cache@v2
120
+ uses: actions/cache@v3
119
121
  with:
120
122
  path: spec/dummy/node_modules
121
123
  key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
122
124
  - id: get-sha
123
125
  run: echo "::set-output name=sha::$(git rev-parse HEAD)"
124
126
  - name: Save test webpack bundles to cache (for build number checksum used by rspec job)
125
- uses: actions/cache@v2
127
+ uses: actions/cache@v3
126
128
  with:
127
129
  path: spec/dummy/public/webpack
128
130
  key: v5-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
129
-
130
131
  - name: Install Node modules with Yarn for renderer package
131
132
  run: |
132
133
  yarn install --no-progress --no-emoji
@@ -139,7 +140,7 @@ jobs:
139
140
  - name: Install Ruby Gems for package
140
141
  run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
141
142
  - name: Install Ruby Gems for dummy app
142
- run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
143
+ run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.17_ install --path=vendor/bundle --jobs=4 --retry=3
143
144
  - name: Ensure minimum required Chrome version
144
145
  run: |
145
146
  echo -e "Already installed $(google-chrome --version)\n"
@@ -152,16 +153,14 @@ jobs:
152
153
  sudo apt-get install google-chrome-stable
153
154
  echo -e "\nInstalled $(google-chrome --version)"
154
155
  fi
155
- - name: Touch webpack bundles
156
- run: touch spec/dummy/public/webpack/test/*
157
156
  - name: Install yalc globally
158
157
  run: sudo yarn global add yalc
159
158
  - name: Increase the amount of inotify watchers
160
159
  run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
161
- - name: Prep for CI
162
- run: bundle exec rails prepare_for_ci
160
+ - name: generate file system-based packs
161
+ run: cd spec/dummy && RAILS_ENV=test bundle exec rake react_on_rails:generate_packs
163
162
  - name: Main CI
164
- run: bundle exec rails ${{ matrix.rake_task }}
163
+ run: bundle exec rake ${{ matrix.rake_task }}
165
164
  - name: Store test results
166
165
  uses: actions/upload-artifact@v2
167
166
  with:
@@ -15,6 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
+ bundler: 2.4.17
18
19
  - name: Print system information
19
20
  run: |
20
21
  echo "Linux release: "; cat /etc/issue
data/.prettierignore CHANGED
@@ -3,10 +3,12 @@ package.json
3
3
  tmp/
4
4
  coverage/
5
5
  **/app/assets/webpack/
6
- spec/dummy/public
7
6
  gen-examples/examples/*
8
7
  node_package/lib/*
9
8
  spec/react_on_rails/dummy-for-generators/app/javascript/bundles/HelloWorld/*
10
9
  bundle/
11
10
  spec/dummy/lib/bs/**
11
+ spec/dummy/public
12
+ **/.yalc/**
13
+ **/generated/**
12
14
  *.bs.js
data/CHANGELOG.md CHANGED
@@ -1,38 +1,82 @@
1
1
  # Change Log
2
- All notable changes to this project's source code will be documented in this file. Items under `Unreleased` is upcoming features that will be out in next version. NOTE: major versions of the npm module and the gem must be kept in sync.
2
+ All notable changes to this project's source code will be documented in this file. Items under `Unreleased` is upcoming features that will be out in the next version.
3
3
 
4
4
  Migration instructions for the major updates can be found [here](https://www.shakacode.com/react-on-rails/docs/guides/upgrading-react-on-rails#upgrading-to-version-9.md). Some smaller migration information can be found here.
5
5
 
6
- ## Need Help Migrating?
6
+ ## Want to Save Time Updating?
7
7
  If you would like help in migrating between React on Rails versions or help with implementing server rendering, please contact [justin@shakacode.com](mailto:justin@shakacode.com) for information about our [React on Rails Pro Support Options](https://www.shakacode.com/react-on-rails-pro).
8
8
 
9
- We specialize in helping companies to quickly and efficiently move from versions before 9 to current. The older versions use the Rails asset pipeline to package client assets. The current and recommended way is to use Webpack 4 for asset preparation. You may also need help migrating from the `rails/webpacker`'s Webpack configuration to a better setup ready for Server Side Rendering.
9
+ We specialize in helping companies quickly and efficiently update client-side dependencies, allowing developers to focus on features and bug fixes rather than addressing tech-debt from old dependencies. ShakaCode also maintains Shakapacker, the successor to Webpacker.
10
10
 
11
11
  ## Contributors
12
12
  Please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
13
13
 
14
14
  ## Versions
15
15
  ### [Unreleased]
16
- Changes since last non-beta release.
16
+ Changes since the last non-beta release.
17
17
 
18
18
  *Please add entries here for your pull requests that are not yet released.*
19
+ ### [13.4.0] - 2023-07-30
20
+ #### Fixed
21
+ - Fixed Pack Generation logic during `assets:precompile` if `auto_load_bundle` is `false` & `components_subdirectory` is not set. [PR 1567](https://github.com/shakacode/react_on_rails/pull/1545) by [blackjack26](https://github.com/blackjack26) & [judahmeek](https://github.com/judahmeek).
22
+
23
+ #### Improved
24
+ - Improved performance by removing an unnecessary JS eval from Ruby. [PR 1544](https://github.com/shakacode/react_on_rails/pull/1544) by [wyattades](https://github.com/wyattades).
25
+
26
+ #### Added
27
+ - Added support for Shakapacker 7 in install generator [PR 1548](https://github.com/shakacode/react_on_rails/pull/1548) by [ahangarha](https://github.com/ahangarha).
19
28
 
20
- ### [13.3.0] - 2022-01-29
21
- ### Fixed
22
- - Fixed pack not found warning while using `react_component` and `react_component_hash` helpers, even when corresponding chunks are present. [PR 1511](https://github.com/shakacode/react_on_rails/pull/1511) by [pulkitkkr](https://github.com/pulkitkkr)
23
- - Fixed FS-based packs generation functionality to trigger pack generation on the creation of a new react component inside `components_subdirectory`. [PR 1506](https://github.com/shakacode/react_on_rails/pull/1506) by [pulkitkkr](https://github.com/pulkitkkr)
24
- - Upgrade several JS dependencies to fix security issues. [PR 1514](https://github.com/shakacode/react_on_rails/pull/1514) by [ahangarha](https://github.com/ahangarha)
29
+ #### Changed
30
+ - Throw error when attempting to redefine ReactOnRails. [PR 1562](https://github.com/shakacode/react_on_rails/pull/1562) by [rubenochiavone](https://github.com/rubenochiavone).
31
+ - Prevent generating FS-based packs when `component_subdirectory` configuration is not present. [PR 1567](https://github.com/shakacode/react_on_rails/pull/1567) by [blackjack26](https://github.com/blackjack26).
32
+ - Removed a requirement for autoloaded pack files to be generated as part of CI or deployment separate from initial Shakapacker bundling. [PR 1545](https://github.com/shakacode/react_on_rails/pull/1545) by [judahmeek](https://github.com/judahmeek).
33
+
34
+
35
+ ### [13.3.5] - 2023-05-31
36
+ #### Fixed
37
+ - Fixed race condition where a react component could attempt to initialize before it had been registered. [PR 1540](https://github.com/shakacode/react_on_rails/pull/1540) by [judahmeek](https://github.com/judahmeek).
25
38
 
26
- ### Added
27
- - Added `./bin/dev` and `./bin/dev-static` executables to ease and standardize running the dev server. [PR 1491](https://github.com/shakacode/react_on_rails/pull/1491) by [ahangarha](https://github.com/ahangarha)
39
+ ### [13.3.4] - 2023-05-23
40
+
41
+ #### Added
42
+ - Improved functionality of Filesystem-based pack generation & auto-bundling. Added `make_generated_server_bundle_the_entrypoint` configuration key. [PR 1531](https://github.com/shakacode/react_on_rails/pull/1531) by [judahmeek](https://github.com/judahmeek).
43
+
44
+ #### Removed
45
+ - Removed unneeded `HMR=true` from `Procfile.dev` in install template [PR 1537](https://github.com/shakacode/react_on_rails/pull/1537) by [ahangarha](https://github.com/ahangarha).
46
+
47
+ ### [13.3.3] - 2023-03-21
48
+
49
+ #### Fixed
50
+ - Fixed bug regarding loading FS-based packs. [PR 1527](https://github.com/shakacode/react_on_rails/pull/1527) by [judahmeek](https://github.com/judahmeek).
51
+
52
+ ### [13.3.2] - 2023-02-24
53
+
54
+ #### Fixed
55
+ - Fixed the bug in `bin/dev` and `bin/dev-static` scripts by using `system` instead of `exec` and remove option to pass arguments [PR 1519](https://github.com/shakacode/react_on_rails/pull/1519) by [ahangarha](https://github.com/ahangarha).
56
+
57
+ ### [13.3.1] - 2023-01-30
58
+ #### Added
59
+ - Optimized `ReactOnRails::TestHelper`'s RSpec integration using `when_first_matching_example_defined`. [PR 1496](https://github.com/shakacode/react_on_rails/pull/1496) by [mcls](https://github.com/mcls).
60
+
61
+ #### Fixed
62
+ - Fixed bug regarding FS-based packs generation. [PR 1515](https://github.com/shakacode/react_on_rails/pull/1515) by [pulkitkkr](https://github.com/pulkitkkr).
63
+
64
+ ### [13.3.0] - 2023-01-29
65
+ #### Fixed
66
+ - Fixed pack not found warning while using `react_component` and `react_component_hash` helpers, even when corresponding chunks are present. [PR 1511](https://github.com/shakacode/react_on_rails/pull/1511) by [pulkitkkr](https://github.com/pulkitkkr).
67
+ - Fixed FS-based packs generation functionality to trigger pack generation on the creation of a new react component inside `components_subdirectory`. [PR 1506](https://github.com/shakacode/react_on_rails/pull/1506) by [pulkitkkr](https://github.com/pulkitkkr).
68
+ - Upgrade several JS dependencies to fix security issues. [PR 1514](https://github.com/shakacode/react_on_rails/pull/1514) by [ahangarha](https://github.com/ahangarha).
69
+
70
+ #### Added
71
+ - Added `./bin/dev` and `./bin/dev-static` executables to ease and standardize running the dev server. [PR 1491](https://github.com/shakacode/react_on_rails/pull/1491) by [ahangarha](https://github.com/ahangarha).
28
72
 
29
73
  ### [13.2.0] - 2022-12-23
30
74
 
31
- ### Fixed
75
+ #### Fixed
32
76
  - Fix reactOnRailsPageUnloaded when there is no component on the page. Important for apps using both hotwire and react_on_rails. [PR 1498](https://github.com/shakacode/react_on_rails/pull/1498) by [NhanHo](https://github.com/NhanHo).
33
77
  - Fixing wrong type. The throwIfMissing param of getStore should be optional as it defaults to true. [PR 1480](https://github.com/shakacode/react_on_rails/pull/1480) by [wouldntsavezion](https://github.com/wouldntsavezion).
34
78
 
35
- ### Added
79
+ #### Added
36
80
  - Exposed `reactHydrateOrRender` utility via [PR 1481](https://github.com/shakacode/react_on_rails/pull/1481) by [vaukalak](https://github.com/vaukalak).
37
81
 
38
82
  ### [13.1.0] - 2022-08-20
@@ -53,7 +97,7 @@ Changes since last non-beta release.
53
97
 
54
98
  - Fixed the `You are importing hydrateRoot from "react-dom" [...] You should instead import it from "react-dom/client"` warning under React 18 ([#1441](https://github.com/shakacode/react_on_rails/issues/1441)). [PR 1460](https://github.com/shakacode/react_on_rails/pull/1460) by [alexeyr](https://github.com/alexeyr).
55
99
 
56
- In exchange, you may see a warning like this when building a Webpack bundle under React 16:
100
+ In exchange, you may see a warning like this when building using any version of React below 18:
57
101
  ```
58
102
  WARNING in ./node_modules/react-on-rails/node_package/lib/reactHydrateOrRender.js19:25-52
59
103
  Module not found: Error: Can't resolve 'react-dom/client' in '/home/runner/work/react_on_rails/react_on_rails/spec/dummy/node_modules/react-on-rails/node_package/lib'
@@ -80,16 +124,16 @@ Changes since last non-beta release.
80
124
 
81
125
  ### [12.6.0] - 2022-01-22
82
126
 
83
- ### Added
127
+ #### Added
84
128
  - A `rendering_props_extension` configuration which takes a module with an `adjust_props_for_client_side_hydration` method, which is used to process props differently for server/client if `prerender` is set to `true`. [PR 1413](https://github.com/shakacode/react_on_rails/pull/1413) by [gscarv13](https://github.com/gscarv13) & [judahmeek](https://github.com/judahmeek).
85
129
 
86
130
  ### [12.5.2] - 2021-12-29
87
- ### Fixed
131
+ #### Fixed
88
132
  - Usage of config.build_production_command for custom command for production builds fixed. [PR 1415](https://github.com/shakacode/react_on_rails/pull/1415) by [judahmeek](https://github.com/judahmeek).
89
133
 
90
134
  ### [12.5.1] - 2021-12-27
91
135
 
92
- ### Fixed
136
+ #### Fixed
93
137
  - A fatal server rendering error if running an ReactOnRails >=12.4.0 with ReactOnRails Pro <2.4.0. [PR 1412](https://github.com/shakacode/react_on_rails/pull/1412) by [judahmeek](https://github.com/judahmeek).
94
138
 
95
139
  ### [12.5.0] - 2021-12-26
@@ -449,7 +493,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
449
493
  - Fixes GitUtils.uncommitted_changes? throwing an error when called in an environment without Git, and allows install generator to be run successfully with `--ignore-warnings` [#878](https://github.com/shakacode/react_on_rails/pull/878) by [jasonblalock](https://github.com/jasonblalock).
450
494
 
451
495
  ## [8.0.5] - 2017-07-04
452
- ### fixed
496
+ #### Fixed
453
497
  - Corrects `devBuild` value for webpack production build from webpackConfigLoader. [#877](https://github.com/shakacode/react_on_rails/pull/877) by [chenqingspring](https://github.com/chenqingspring).
454
498
  - Remove contentBase deprecation warning message. [#878](https://github.com/shakacode/react_on_rails/pull/878) by [ened ](https://github.com/ened).
455
499
  - Removes invalid reference to _railsContext in the generated files. [#886](https://github.com/shakacode/react_on_rails/pull/886) by [justin808](https://github.com/justin808).
@@ -458,11 +502,11 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
458
502
  *Note: 8.0.4 skipped.*
459
503
 
460
504
  ## [8.0.3] - 2017-06-19
461
- ### Fixed
505
+ #### Fixed
462
506
  - Ruby 2.1 issue due to `<<~` as reported in [issue #870](https://github.com/shakacode/react_on_rails/issues/870). [#867](https://github.com/shakacode/react_on_rails/pull/867) by [justin808](https://github.com/justin808)
463
507
 
464
508
  ## [8.0.2] - 2017-06-04
465
- ### Fixed
509
+ #### Fixed
466
510
  - Any failure in webpack to build test files quits tests.
467
511
  - Fixed a Ruby 2.4 potential crash which could cause a crash due to pathname change in Ruby 2.4.
468
512
  - CI Improvements:
@@ -473,7 +517,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
473
517
  - [#862](https://github.com/shakacode/react_on_rails/pull/862) by [justin808](https://github.com/justin808)
474
518
 
475
519
  ## [8.0.1] - 2017-05-30
476
- ### Fixed
520
+ #### Fixed
477
521
  - Generator no longer modifies `assets.rb`. [#859](https://github.com/shakacode/react_on_rails/pull/859) by [justin808](https://github.com/justin808)
478
522
 
479
523
  ## [8.0.0] - 2017-05-29
@@ -486,21 +530,21 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
486
530
  - For a simple example of the webpacker_lite setup, run the basic generator.
487
531
 
488
532
  ## [8.0.0-beta.3] - 2017-05-27
489
- ### Changed
533
+ #### Changed
490
534
  - Major updates for WebpackerLite 2.0.2. [#844](https://github.com/shakacode/react_on_rails/pull/845) by [justin808](https://github.com/justin808) with help from ](https://github.com/robwise)
491
535
  - Logging no longer occurs when trace is turned to false. [#845](https://github.com/shakacode/react_on_rails/pull/845) by [conturbo](https://github.com/Conturbo)
492
536
 
493
537
  ## [8.0.0-beta.2] - 2017-05-08
494
538
 
495
- ### Changed
539
+ #### Changed
496
540
  Removed unnecessary values in default paths.yml files for generators. [#834](https://github.com/shakacode/react_on_rails/pull/834) by [justin808](https://github.com/justin808).
497
541
 
498
542
  ## [8.0.0-beta.1] - 2017-05-03
499
543
 
500
- ### Added
544
+ #### Added
501
545
  Support for WebpackerLite in the generators. [#822](https://github.com/shakacode/react_on_rails/pull/822) by [kaizencodes](https://github.com/kaizencodes) and [justin808](https://github.com/justin808).
502
546
 
503
- ### Changed
547
+ #### Changed
504
548
  Breaking change is that the default value of symlink_non_digested_assets_regex has changed from this
505
549
  old value to nil. This is a breaking change if you didn't have this value set in your
506
550
  config/initializers/react_on_rails.rb file and you need this because you're using webpack's CSS
@@ -520,65 +564,65 @@ Same as 7.0.1.
520
564
  *Accidental release of beta gem here*
521
565
 
522
566
  ## [7.0.1] - 2017-04-27
523
- ### Fixed
567
+ #### Fixed
524
568
  - Fix to handle nil values in json_safe_and_pretty [#823](https://github.com/shakacode/react_on_rails/pull/823) by [dzirtusss](https://github.com/dzirtusss)
525
569
 
526
570
  ## [7.0.0] - 2017-04-25
527
- ### Changed
571
+ #### Changed
528
572
  - Any version differences in gem and node package for React on Rails throw an error [#821](https://github.com/shakacode/react_on_rails/pull/821) by [justin808](https://github.com/justin808)
529
573
 
530
- ### Fixed
574
+ #### Fixed
531
575
  - Fixes serious performance regression when using String props for rendering. [#821](https://github.com/shakacode/react_on_rails/pull/821) by [justin808](https://github.com/justin808)
532
576
 
533
577
  ## [6.10.1] - 2017-04-23
534
- ### Fixed
578
+ #### Fixed
535
579
  - Improve json conversion with tests and support for older Rails 3.x. [#787](https://github.com/shakacode/react_on_rails/pull/787) by [cheremukhin23](https://github.com/cheremukhin23) and [Ynote](https://github.com/Ynote).
536
580
 
537
581
  ## [6.10.0] - 2017-04-13
538
582
 
539
- ### Added
583
+ #### Added
540
584
  - Add an ability to return multiple HTML strings in a `Hash` as a result of `react_component` method call. Allows to build `<head>` contents with [React Helmet](https://github.com/nfl/react-helmet). [#800](https://github.com/shakacode/react_on_rails/pull/800) by [udovenko](https://github.com/udovenko).
541
585
 
542
- ### Fixed
586
+ #### Fixed
543
587
  - Fix PropTypes, createClass deprecation warnings for React 15.5.x. [#804](https://github.com/shakacode/react_on_rails/pull/804) by [udovenko ](https://github.com/udovenko).
544
588
 
545
589
  ## [6.9.3] - 2017-04-03
546
590
 
547
- ### Fixed
591
+ #### Fixed
548
592
  - Removed call of to_json on strings when formatting props. [#791](https://github.com/shakacode/react_on_rails/pull/791) by [justin808](https://github.com/justin808).
549
593
 
550
594
  ## [6.9.2] - 2017-04-02
551
595
 
552
- ### Changed
596
+ #### Changed
553
597
  - Update version_checker.rb to `logger.error` rather than `logger.warn` for gem/npm version mismatch. [#788](https://github.com/shakacode/react_on_rails/issues/788) by [justin808](https://github.com/justin808).
554
598
 
555
- ### Fixed
599
+ #### Fixed
556
600
  - Remove pretty formatting of JSON in development. [#789](https://github.com/shakacode/react_on_rails/pull/789) by [justin808](https://github.com/justin808)
557
601
  - Clear hydrated stores with each server rendered block. [#785](https://github.com/shakacode/react_on_rails/pull/785) by [udovenko](https://github.com/udovenko)
558
602
 
559
603
  ## [6.9.1] - 2017-03-30
560
604
 
561
- ### Fixed
605
+ #### Fixed
562
606
  - Fixes Crash in Development for String Props. [#784](https://github.com/shakacode/react_on_rails/issues/784) by [justin808](https://github.com/justin808).
563
607
 
564
608
  ## [6.9.0] - 2017-03-29
565
609
 
566
- ### Fixed
610
+ #### Fixed
567
611
  - Fixed error in the release script. [#767](https://github.com/shakacode/react_on_rails/issues/767) by [isolo](https://github.com/isolo).
568
612
 
569
- ### Changed
613
+ #### Changed
570
614
  - Use <script type="application/json"> for props and store instead of hidden div. [#775] (https://github.com/shakacode/react_on_rails/pull/775) by [cheremukhin23](https://github.com/cheremukhin23).
571
615
 
572
- ### Added
616
+ #### Added
573
617
  - Add option to specify i18n_yml_dir in order to include only subset of locale files when generating translations.js & default.js for react-intl.
574
618
  [#777](https://github.com/shakacode/react_on_rails/pull/777) by [danijel](https://github.com/danijel).
575
619
 
576
620
  ## [6.8.2] - 2017-03-24
577
- ### Fixed
621
+ #### Fixed
578
622
  - Change webpack output path to absolute and update webpack to version ^2.3.1. [#771](https://github.com/shakacode/react_on_rails/pull/771) by [cheremukhin23](https://github.com/cheremukhin23).
579
623
 
580
624
  ## [6.8.1] - 2017-03-21
581
- ### Fixed
625
+ #### Fixed
582
626
  - Fixed error "The node you're attempting to unmount was rendered by another copy of React." [#706](https://github.com/shakacode/react_on_rails/issues/706) when navigating to cached page using Turbolinks [#763](https://github.com/shakacode/react_on_rails/pull/763) by [szyablitsky](https://github.com/szyablitsky).
583
627
 
584
628
  ## [6.8.0] - 2017-03-06
@@ -586,7 +630,7 @@ Same as 7.0.1.
586
630
  - Converted to Webpack v2 for generators, tests, and all example code. [#742](https://github.com/shakacode/react_on_rails/pull/742) by [justin808](https://github.com/justin808).
587
631
 
588
632
  ## [6.7.2] - 2017-03-05
589
- ### Improved
633
+ #### Improved
590
634
  - Improve i18n Integration with a better error message if the value of the i18n directory is invalid. [#748](https://github.com/shakacode/react_on_rails/pull/748) by [justin808](https://github.com/justin808).
591
635
 
592
636
  ## [6.7.1] - 2017-02-28
@@ -594,7 +638,7 @@ No changes other than a test fix.
594
638
 
595
639
  ## [6.7.0] - 2017-02-28
596
640
 
597
- ### IMPORTANT
641
+ #### IMPORTANT
598
642
  - If you installed 6.6.0, you will need to comment out the line matching i18n_dir unless you are using this feature. 6.7.1 will give you an error like:
599
643
 
600
644
  ```
@@ -607,32 +651,32 @@ Commenting out this line addresses the issue:
607
651
  config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
608
652
  ```
609
653
 
610
- ### Added
654
+ #### Added
611
655
  - Allow using rake task to generate javascript locale files. The test helper automatically creates the localization files when needed. [#717](https://github.com/shakacode/react_on_rails/pull/717) by [JasonYCHuang](https://github.com/JasonYCHuang).
612
656
 
613
- ### Fixed
657
+ #### Fixed
614
658
  - Upgrade Rails to 4.2.8 to fix security vulnerabilities in 4.2.5. [#735](https://github.com/shakacode/react_on_rails/pull/735) by [hrishimittal](https://github.com/hrishimittal).
615
659
  - Fix spec failing due to duplicate component. [#734](https://github.com/shakacode/react_on_rails/pull/734) by [hrishimittal](https://github.com/hrishimittal).
616
660
 
617
661
  ## [6.6.0] - 2017-02-18
618
- ### Added
662
+ #### Added
619
663
  - Switched to yarn! [#715](https://github.com/shakacode/react_on_rails/pull/715) by [squadette](https://github.com/squadette).
620
664
 
621
665
  ## [6.5.1] - 2017-02-11
622
- ### Fixed
666
+ #### Fixed
623
667
  - Allow using gem without sprockets. [#671](https://github.com/shakacode/react_on_rails/pull/671) by [fc-arny](https://github.com/fc-arny).
624
668
  - Fixed issue [#706](https://github.com/shakacode/react_on_rails/issues/706) with "flickering" components when they are unmounted too early [#709](https://github.com/shakacode/react_on_rails/pull/709) by [szyablitsky](https://github.com/szyablitsky).
625
669
  - Small formatting fix for errors [#703](https://github.com/shakacode/react_on_rails/pull/703) by [justin808](https://github.com/justin808).
626
670
 
627
671
  ## [6.5.0] - 2017-01-31
628
- ### Added
672
+ #### Added
629
673
  - Allow generator function to return Object with property `renderedHtml` (already could return Object with props `redirectLocation, error`) rather than a React component or a function that returns a React component. One reason to use a generator function is that sometimes in server rendering, specifically with React Router v4, you need to return the result of calling ReactDOMServer.renderToString(element). [#689](https://github.com/shakacode/react_on_rails/issues/689) by [justin808](https://github.com/justin808).
630
674
 
631
- ### Fixed
675
+ #### Fixed
632
676
  - Fix incorrect "this" references of Node.js SSR [#690](https://github.com/shakacode/react_on_rails/issues/689) by [nostophilia](https://github.com/nostophilia).
633
677
 
634
678
  ## [6.4.2] - 2017-01-17
635
- ### Fixed
679
+ #### Fixed
636
680
  - Added OS detection for install generator, system call for Windows and unit-tests for it. [#666](https://github.com/shakacode/react_on_rails/pull/666) by [GeorgeGorbanev](https://github.com/GeorgeGorbanev).
637
681
 
638
682
  ## [6.4.1] - 2017-1-17
@@ -640,17 +684,17 @@ No changes.
640
684
 
641
685
  ## [6.4.0] - 2017-1-12
642
686
 
643
- ### Possible Breaking Change
687
+ #### Possible Breaking Change
644
688
  - Since foreman is no longer a dependency of the React on Rails gem, please run `gem install foreman`. If you are using rvm, you may wish to run `rvm @global do gem install foreman` to install foreman for all your gemsets.
645
689
 
646
- ### Fixed
690
+ #### Fixed
647
691
  - Removed foreman as a dependency. [#678](https://github.com/shakacode/react_on_rails/pull/678) by [x2es](https://github.com/x2es).
648
692
 
649
- ### Added
693
+ #### Added
650
694
  - Automatically generate __i18n__ javascript files for `react-intl` when the serve starts up. [#642](https://github.com/shakacode/react_on_rails/pull/642) by [JasonYCHuang](https://github.com/JasonYCHuang).
651
695
 
652
696
  ## [6.3.5] - 2017-1-6
653
- ### Fixed
697
+ #### Fixed
654
698
  - The redux generator now creates a HelloWorld component that uses redux rather than local state. [#669](https://github.com/shakacode/react_on_rails/issues/669) by [justin808](https://github.com/justin808).
655
699
 
656
700
  ## [6.3.4] - 2016-12-25
@@ -1058,9 +1102,15 @@ Best done with Object destructing:
1058
1102
  - Turbolinks support.
1059
1103
 
1060
1104
  ##### Fixed
1061
- - Fix several generator related issues.
1062
-
1063
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/13.3.0...master
1105
+ - Fix several generator-related issues.
1106
+
1107
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/13.4.0...master
1108
+ [13.4.0]: https://github.com/shakacode/react_on_rails/compare/13.3.5...13.4.0
1109
+ [13.3.5]: https://github.com/shakacode/react_on_rails/compare/13.3.4...13.3.5
1110
+ [13.3.4]: https://github.com/shakacode/react_on_rails/compare/13.3.3...13.3.4
1111
+ [13.3.3]: https://github.com/shakacode/react_on_rails/compare/13.3.2...13.3.3
1112
+ [13.3.2]: https://github.com/shakacode/react_on_rails/compare/13.3.1...13.3.2
1113
+ [13.3.1]: https://github.com/shakacode/react_on_rails/compare/13.3.0...13.3.1
1064
1114
  [13.3.0]: https://github.com/shakacode/react_on_rails/compare/13.2.0...13.3.0
1065
1115
  [13.2.0]: https://github.com/shakacode/react_on_rails/compare/13.1.0...13.2.0
1066
1116
  [13.1.0]: https://github.com/shakacode/react_on_rails/compare/13.0.2...13.1.0
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- gem "shakapacker", "6.5.1"
3
+ gem "shakapacker", "7.0.1"
4
4
  gem "bootsnap", require: false
5
5
  gem "rails", "~> 7.0"
6
6
  gem "sqlite3"
@@ -8,6 +8,7 @@ gem "sass-rails", "~> 6.0"
8
8
  gem "uglifier"
9
9
  gem "jquery-rails"
10
10
  gem "puma", "~> 5.0"
11
+ gem "bundler", "2.4.17"
11
12
 
12
13
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
13
14
  gem "turbolinks" if ENV["DISABLE_TURBOLINKS"].nil? || ENV["DISABLE_TURBOLINKS"].strip.empty?
@@ -46,5 +47,4 @@ group :test do
46
47
  gem "rspec-rails"
47
48
  gem "rspec-retry"
48
49
  gem "selenium-webdriver"
49
- gem "webdrivers", "3.9.4"
50
50
  end