react_on_rails 13.3.4 → 13.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -2
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  4. data/.github/workflows/lint-js-and-ruby.yml +2 -2
  5. data/.github/workflows/main.yml +5 -5
  6. data/.github/workflows/rspec-package-specs.yml +1 -1
  7. data/CHANGELOG.md +86 -65
  8. data/Gemfile.development_dependencies +2 -3
  9. data/README.md +5 -0
  10. data/docs/additional-details/recommended-project-structure.md +6 -6
  11. data/docs/additional-details/tips-for-usage-with-sp6.md +15 -0
  12. data/docs/deployment/heroku-deployment.md +15 -11
  13. data/docs/getting-started.md +28 -27
  14. data/docs/guides/configuration.md +17 -17
  15. data/docs/guides/file-system-based-automated-bundle-generation.md +42 -50
  16. data/docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md +10 -10
  17. data/docs/guides/how-react-on-rails-works.md +1 -1
  18. data/docs/guides/installation-into-an-existing-rails-app.md +4 -4
  19. data/docs/guides/rails-webpacker-react-integration-options.md +4 -4
  20. data/docs/guides/react-on-rails-overview.md +6 -7
  21. data/docs/guides/rspec-configuration.md +11 -11
  22. data/docs/guides/tutorial.md +11 -14
  23. data/docs/guides/upgrading-react-on-rails.md +2 -2
  24. data/docs/guides/webpack-configuration.md +14 -14
  25. data/docs/home.md +3 -3
  26. data/docs/javascript/asset-pipeline.md +4 -4
  27. data/docs/javascript/converting-from-custom-webpack-config-to-rails-webpacker-config.md +8 -8
  28. data/docs/javascript/server-rendering-tips.md +1 -1
  29. data/docs/javascript/troubleshooting-when-using-shakapacker.md +77 -0
  30. data/docs/outdated/rails-assets-relative-paths.md +1 -1
  31. data/docs/outdated/rails-assets.md +1 -1
  32. data/docs/react-on-rails-pro/react-on-rails-pro.md +1 -1
  33. data/lib/generators/react_on_rails/adapt_for_older_shakapacker_generator.rb +41 -0
  34. data/lib/generators/react_on_rails/base_generator.rb +3 -47
  35. data/lib/generators/react_on_rails/generator_messages.rb +40 -0
  36. data/lib/generators/react_on_rails/install_generator.rb +21 -0
  37. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev +2 -2
  38. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-static +2 -2
  39. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +2 -2
  40. data/lib/generators/react_on_rails/templates/base/base/config/{webpacker.yml → shakapacker.yml} +3 -3
  41. data/lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js.tt +3 -1
  42. data/lib/react_on_rails/helper.rb +23 -11
  43. data/lib/react_on_rails/packs_generator.rb +2 -0
  44. data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +1 -3
  45. data/lib/react_on_rails/version.rb +1 -1
  46. data/package.json +1 -1
  47. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b5950d1de16d2db5f3944bb18bb65155f038f5587e8856e8c6418bc59cbcca9
4
- data.tar.gz: d40aa0a760a7ef09df3a7b6550e1d1619001183895c28293bd3f993cb08e16c2
3
+ metadata.gz: 545e97728f6633e1adc5091f8e1a72c377ce8d8c809ca8b6378c0b1bffe62c7d
4
+ data.tar.gz: 06a83f533ee9518518afeb63a31191861298f92a2ec36b876914347de0a0f960
5
5
  SHA512:
6
- metadata.gz: 324d1e13a73437cdcd302961ae9d4a91303bdb2872e8355b9d4677d6ff9a92aa77e98df0ff21934782ae39e4bf540e39c37aca38337385d85aaeef72cbab37cd
7
- data.tar.gz: f762b29b6619e39067573317c027b9aa7a390a6d2d86b78f73a039ad3c1c1e26c6985ec8df3c3e00c10d0ed179f4246415cb573efc77d0f2d619737e643e54cb
6
+ metadata.gz: 9bc25f3009cc3775d59d456e2009fe3c7f692a13268bf559a1059547c8c56998d8c0c2856a9b8e43079afa6ffa3705a6c1f613ecf9864ae6b3cc0697c5f46ac7
7
+ data.tar.gz: 860f4fc51d1bef3f7cc4599335062881681b3acd70e6f1104ecbc24e128e175ddb0b3aa44ee6c2b0d36c2596c6d118eb1ded0ec92fcab8781efa2233c2cd3875
data/.circleci/config.yml CHANGED
@@ -54,7 +54,7 @@ aliases:
54
54
  - &install-dummy-app-ruby-gems
55
55
  name: Install Ruby Gems for dummy app
56
56
  command: |
57
- gem install bundler:2.4.9
57
+ gem install bundler:2.4.17
58
58
  echo "Bundler version: "; bundle --version
59
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
60
60
 
@@ -62,7 +62,7 @@ aliases:
62
62
  - &install-package-ruby-gems
63
63
  name: Install Ruby Gems for package
64
64
  command: |
65
- gem install bundler:2.4.9
65
+ gem install bundler:2.4.17
66
66
  echo "Bundler version: "; bundle --version
67
67
  bundle lock --add-platform 'x86_64-linux'
68
68
  bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
@@ -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
@@ -15,7 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
- bundler: 2.4.9
18
+ bundler: 2.4.17
19
19
  - name: Setup Node
20
20
  uses: actions/setup-node@v2-beta
21
21
  with:
@@ -45,7 +45,7 @@ jobs:
45
45
  yarn run eslint -v
46
46
  sudo yarn global add yalc
47
47
  - name: Install Ruby Gems for package
48
- run: bundle check --path=vendor/bundle || bundle _2.4.9_ 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
49
49
  - name: Linting of Ruby
50
50
  run: bundle exec rubocop
51
51
  - name: Linting of JS
@@ -1,6 +1,6 @@
1
1
  name: Main test
2
2
 
3
- on: [push]
3
+ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  build-dummy-app-webpack-test-bundles:
@@ -15,7 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
- bundler: 2.4.9
18
+ bundler: 2.4.17
19
19
  # libyaml-dev is needed for psych v5
20
20
  # this gem depends on sdoc which depends on rdoc which depends on psych
21
21
  - name: Fix dependency for libyaml-dev
@@ -60,7 +60,7 @@ jobs:
60
60
  path: spec/dummy/vendor/bundle
61
61
  key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
62
62
  - name: Install Ruby Gems for dummy app
63
- run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.9_ 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
64
64
  - name: generate file system-based packs
65
65
  run: cd spec/dummy && RAILS_ENV=test bundle exec rake react_on_rails:generate_packs
66
66
  - name: Build test bundles for dummy app
@@ -87,7 +87,7 @@ jobs:
87
87
  uses: ruby/setup-ruby@v1
88
88
  with:
89
89
  ruby-version: ${{ matrix.ruby }}
90
- bundler: 2.4.9
90
+ bundler: 2.4.17
91
91
  - name: Setup Node
92
92
  uses: actions/setup-node@v2-beta
93
93
  with:
@@ -140,7 +140,7 @@ jobs:
140
140
  - name: Install Ruby Gems for package
141
141
  run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
142
142
  - name: Install Ruby Gems for dummy app
143
- run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.9_ 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
144
144
  - name: Ensure minimum required Chrome version
145
145
  run: |
146
146
  echo -e "Already installed $(google-chrome --version)\n"
@@ -15,7 +15,7 @@ jobs:
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
- bundler: 2.4.9
18
+ bundler: 2.4.17
19
19
  - name: Print system information
20
20
  run: |
21
21
  echo "Linux release: "; cat /etc/issue
data/CHANGELOG.md CHANGED
@@ -1,63 +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).
28
+
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).
19
33
 
20
- ### [13.3.4] - 2022-05-23
21
34
 
22
- ### Added
23
- - 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)
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).
38
+
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).
24
43
 
25
- ### Removed
44
+ #### Removed
26
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).
27
46
 
28
- ### [13.3.3] - 2022-03-21
47
+ ### [13.3.3] - 2023-03-21
29
48
 
30
- ### Fixed
31
- - Fixed bug regarding loading FS-based packs. [PR 1527](https://github.com/shakacode/react_on_rails/pull/1527) by [judahmeek](https://github.com/judahmeek)
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).
32
51
 
33
- ### [13.3.2] - 2022-02-24
52
+ ### [13.3.2] - 2023-02-24
34
53
 
35
- ### Fixed
54
+ #### Fixed
36
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).
37
56
 
38
- ### [13.3.1] - 2022-01-30
39
- ## Added
57
+ ### [13.3.1] - 2023-01-30
58
+ #### Added
40
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).
41
60
 
42
- ### Fixed
43
- - Fixed bug regarding FS-based packs generation. [PR 1515](https://github.com/shakacode/react_on_rails/pull/1515) by [pulkitkkr](https://github.com/pulkitkkr)
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).
44
63
 
45
- ### [13.3.0] - 2022-01-29
46
- ### Fixed
64
+ ### [13.3.0] - 2023-01-29
65
+ #### Fixed
47
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).
48
- - 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)
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).
49
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).
50
69
 
51
- ### Added
52
- - 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)
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).
53
72
 
54
73
  ### [13.2.0] - 2022-12-23
55
74
 
56
- ### Fixed
75
+ #### Fixed
57
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).
58
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).
59
78
 
60
- ### Added
79
+ #### Added
61
80
  - Exposed `reactHydrateOrRender` utility via [PR 1481](https://github.com/shakacode/react_on_rails/pull/1481) by [vaukalak](https://github.com/vaukalak).
62
81
 
63
82
  ### [13.1.0] - 2022-08-20
@@ -105,16 +124,16 @@ Changes since last non-beta release.
105
124
 
106
125
  ### [12.6.0] - 2022-01-22
107
126
 
108
- ### Added
127
+ #### Added
109
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).
110
129
 
111
130
  ### [12.5.2] - 2021-12-29
112
- ### Fixed
131
+ #### Fixed
113
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).
114
133
 
115
134
  ### [12.5.1] - 2021-12-27
116
135
 
117
- ### Fixed
136
+ #### Fixed
118
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).
119
138
 
120
139
  ### [12.5.0] - 2021-12-26
@@ -474,7 +493,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
474
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).
475
494
 
476
495
  ## [8.0.5] - 2017-07-04
477
- ### fixed
496
+ #### Fixed
478
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).
479
498
  - Remove contentBase deprecation warning message. [#878](https://github.com/shakacode/react_on_rails/pull/878) by [ened ](https://github.com/ened).
480
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).
@@ -483,11 +502,11 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
483
502
  *Note: 8.0.4 skipped.*
484
503
 
485
504
  ## [8.0.3] - 2017-06-19
486
- ### Fixed
505
+ #### Fixed
487
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)
488
507
 
489
508
  ## [8.0.2] - 2017-06-04
490
- ### Fixed
509
+ #### Fixed
491
510
  - Any failure in webpack to build test files quits tests.
492
511
  - Fixed a Ruby 2.4 potential crash which could cause a crash due to pathname change in Ruby 2.4.
493
512
  - CI Improvements:
@@ -498,7 +517,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
498
517
  - [#862](https://github.com/shakacode/react_on_rails/pull/862) by [justin808](https://github.com/justin808)
499
518
 
500
519
  ## [8.0.1] - 2017-05-30
501
- ### Fixed
520
+ #### Fixed
502
521
  - Generator no longer modifies `assets.rb`. [#859](https://github.com/shakacode/react_on_rails/pull/859) by [justin808](https://github.com/justin808)
503
522
 
504
523
  ## [8.0.0] - 2017-05-29
@@ -511,21 +530,21 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
511
530
  - For a simple example of the webpacker_lite setup, run the basic generator.
512
531
 
513
532
  ## [8.0.0-beta.3] - 2017-05-27
514
- ### Changed
533
+ #### Changed
515
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)
516
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)
517
536
 
518
537
  ## [8.0.0-beta.2] - 2017-05-08
519
538
 
520
- ### Changed
539
+ #### Changed
521
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).
522
541
 
523
542
  ## [8.0.0-beta.1] - 2017-05-03
524
543
 
525
- ### Added
544
+ #### Added
526
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).
527
546
 
528
- ### Changed
547
+ #### Changed
529
548
  Breaking change is that the default value of symlink_non_digested_assets_regex has changed from this
530
549
  old value to nil. This is a breaking change if you didn't have this value set in your
531
550
  config/initializers/react_on_rails.rb file and you need this because you're using webpack's CSS
@@ -545,65 +564,65 @@ Same as 7.0.1.
545
564
  *Accidental release of beta gem here*
546
565
 
547
566
  ## [7.0.1] - 2017-04-27
548
- ### Fixed
567
+ #### Fixed
549
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)
550
569
 
551
570
  ## [7.0.0] - 2017-04-25
552
- ### Changed
571
+ #### Changed
553
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)
554
573
 
555
- ### Fixed
574
+ #### Fixed
556
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)
557
576
 
558
577
  ## [6.10.1] - 2017-04-23
559
- ### Fixed
578
+ #### Fixed
560
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).
561
580
 
562
581
  ## [6.10.0] - 2017-04-13
563
582
 
564
- ### Added
583
+ #### Added
565
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).
566
585
 
567
- ### Fixed
586
+ #### Fixed
568
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).
569
588
 
570
589
  ## [6.9.3] - 2017-04-03
571
590
 
572
- ### Fixed
591
+ #### Fixed
573
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).
574
593
 
575
594
  ## [6.9.2] - 2017-04-02
576
595
 
577
- ### Changed
596
+ #### Changed
578
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).
579
598
 
580
- ### Fixed
599
+ #### Fixed
581
600
  - Remove pretty formatting of JSON in development. [#789](https://github.com/shakacode/react_on_rails/pull/789) by [justin808](https://github.com/justin808)
582
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)
583
602
 
584
603
  ## [6.9.1] - 2017-03-30
585
604
 
586
- ### Fixed
605
+ #### Fixed
587
606
  - Fixes Crash in Development for String Props. [#784](https://github.com/shakacode/react_on_rails/issues/784) by [justin808](https://github.com/justin808).
588
607
 
589
608
  ## [6.9.0] - 2017-03-29
590
609
 
591
- ### Fixed
610
+ #### Fixed
592
611
  - Fixed error in the release script. [#767](https://github.com/shakacode/react_on_rails/issues/767) by [isolo](https://github.com/isolo).
593
612
 
594
- ### Changed
613
+ #### Changed
595
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).
596
615
 
597
- ### Added
616
+ #### Added
598
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.
599
618
  [#777](https://github.com/shakacode/react_on_rails/pull/777) by [danijel](https://github.com/danijel).
600
619
 
601
620
  ## [6.8.2] - 2017-03-24
602
- ### Fixed
621
+ #### Fixed
603
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).
604
623
 
605
624
  ## [6.8.1] - 2017-03-21
606
- ### Fixed
625
+ #### Fixed
607
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).
608
627
 
609
628
  ## [6.8.0] - 2017-03-06
@@ -611,7 +630,7 @@ Same as 7.0.1.
611
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).
612
631
 
613
632
  ## [6.7.2] - 2017-03-05
614
- ### Improved
633
+ #### Improved
615
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).
616
635
 
617
636
  ## [6.7.1] - 2017-02-28
@@ -619,7 +638,7 @@ No changes other than a test fix.
619
638
 
620
639
  ## [6.7.0] - 2017-02-28
621
640
 
622
- ### IMPORTANT
641
+ #### IMPORTANT
623
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:
624
643
 
625
644
  ```
@@ -632,32 +651,32 @@ Commenting out this line addresses the issue:
632
651
  config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
633
652
  ```
634
653
 
635
- ### Added
654
+ #### Added
636
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).
637
656
 
638
- ### Fixed
657
+ #### Fixed
639
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).
640
659
  - Fix spec failing due to duplicate component. [#734](https://github.com/shakacode/react_on_rails/pull/734) by [hrishimittal](https://github.com/hrishimittal).
641
660
 
642
661
  ## [6.6.0] - 2017-02-18
643
- ### Added
662
+ #### Added
644
663
  - Switched to yarn! [#715](https://github.com/shakacode/react_on_rails/pull/715) by [squadette](https://github.com/squadette).
645
664
 
646
665
  ## [6.5.1] - 2017-02-11
647
- ### Fixed
666
+ #### Fixed
648
667
  - Allow using gem without sprockets. [#671](https://github.com/shakacode/react_on_rails/pull/671) by [fc-arny](https://github.com/fc-arny).
649
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).
650
669
  - Small formatting fix for errors [#703](https://github.com/shakacode/react_on_rails/pull/703) by [justin808](https://github.com/justin808).
651
670
 
652
671
  ## [6.5.0] - 2017-01-31
653
- ### Added
672
+ #### Added
654
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).
655
674
 
656
- ### Fixed
675
+ #### Fixed
657
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).
658
677
 
659
678
  ## [6.4.2] - 2017-01-17
660
- ### Fixed
679
+ #### Fixed
661
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).
662
681
 
663
682
  ## [6.4.1] - 2017-1-17
@@ -665,17 +684,17 @@ No changes.
665
684
 
666
685
  ## [6.4.0] - 2017-1-12
667
686
 
668
- ### Possible Breaking Change
687
+ #### Possible Breaking Change
669
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.
670
689
 
671
- ### Fixed
690
+ #### Fixed
672
691
  - Removed foreman as a dependency. [#678](https://github.com/shakacode/react_on_rails/pull/678) by [x2es](https://github.com/x2es).
673
692
 
674
- ### Added
693
+ #### Added
675
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).
676
695
 
677
696
  ## [6.3.5] - 2017-1-6
678
- ### Fixed
697
+ #### Fixed
679
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).
680
699
 
681
700
  ## [6.3.4] - 2016-12-25
@@ -1083,9 +1102,11 @@ Best done with Object destructing:
1083
1102
  - Turbolinks support.
1084
1103
 
1085
1104
  ##### Fixed
1086
- - Fix several generator related issues.
1105
+ - Fix several generator-related issues.
1087
1106
 
1088
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/13.3.4...master
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
1089
1110
  [13.3.4]: https://github.com/shakacode/react_on_rails/compare/13.3.3...13.3.4
1090
1111
  [13.3.3]: https://github.com/shakacode/react_on_rails/compare/13.3.2...13.3.3
1091
1112
  [13.3.2]: https://github.com/shakacode/react_on_rails/compare/13.3.1...13.3.2
@@ -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,7 +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.9"
11
+ gem "bundler", "2.4.17"
12
12
 
13
13
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
14
14
  gem "turbolinks" if ENV["DISABLE_TURBOLINKS"].nil? || ENV["DISABLE_TURBOLINKS"].strip.empty?
@@ -47,5 +47,4 @@ group :test do
47
47
  gem "rspec-rails"
48
48
  gem "rspec-retry"
49
49
  gem "selenium-webdriver"
50
- gem "webdrivers"
51
50
  end
data/README.md CHANGED
@@ -113,6 +113,11 @@ The following companies support our open source projects, and ShakaCode uses the
113
113
  <img alt="ScoutAPM" src="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png" height="120px">
114
114
  </picture>
115
115
  </a>
116
+ <a href="https://controlplane.com">
117
+ <picture>
118
+ <img alt="Control Plane" src="https://github.com/shakacode/.github/assets/20628911/90babd87-62c4-4de3-baa4-3d78ef4bec25" height="120px">
119
+ </picture>
120
+ </a>
116
121
  <br />
117
122
  <a href="https://www.browserstack.com">
118
123
  <picture>
@@ -1,6 +1,6 @@
1
1
  # Recommended Project structure
2
2
 
3
- The React on Rails generator uses the standard `rails/webpacker` convention of this structure:
3
+ The React on Rails generator uses the standard Shakapacker convention of this structure:
4
4
 
5
5
  ```yml
6
6
  app/javascript:
@@ -13,7 +13,7 @@ app/javascript:
13
13
  ```
14
14
 
15
15
  Per the example repo [shakacode/react_on_rails_demo_ssr_hmr](https://github.com/shakacode/react_on_rails_demo_ssr_hmr),
16
- you should consider keeping your codebase mostly consistent with the defaults for [rails/webpacker](https://github.com/rails/webpacker).
16
+ you should consider keeping your codebase mostly consistent with the defaults for [Shakapacker](https://github.com/shakacode/shakapacker).
17
17
 
18
18
  ## Steps to convert from the generator defaults to use a `/client` directory for source code
19
19
 
@@ -23,7 +23,7 @@ you should consider keeping your codebase mostly consistent with the defaults fo
23
23
  mv app/javascript client
24
24
  ```
25
25
 
26
- 2. Edit your `/config/webpacker.yml` file. Change the `default/source_path`:
26
+ 2. Edit your `/config/shakapacker.yml` file. Change the `default/source_path`:
27
27
 
28
28
  ```yml
29
29
  source_path: client
@@ -31,7 +31,7 @@ mv app/javascript client
31
31
 
32
32
  ## Moving node_modules from `/` to `/client` with a custom webpack setup.
33
33
 
34
- `rails/webpacker` probably doesn't support having your main node_modules directory under `/client`, so only follow these steps if you want to use your own webpack configuration.
34
+ Shakapacker probably doesn't support having your main node_modules directory under `/client`, so only follow these steps if you want to use your own webpack configuration.
35
35
 
36
36
  1. Move the `/package.json` to `/client/package.json`
37
37
  2. Create a `/package.json` that delegates to `/client/package.json`.
@@ -40,8 +40,8 @@ mv app/javascript client
40
40
  "heroku-postbuild": "cd ./client && yarn"
41
41
  },
42
42
  ```
43
- 3. If your node_modules directory is not at the top level of the Rails project, then you will need to set the
44
- ENV value of WEBPACKER_CONFIG to the location of the `config/webpacker.yml` file per [rails/webpacker PR 2561](https://github.com/rails/webpacker/pull/2561).
43
+ 3. If your `node_modules` directory is not at the top level of the Rails project, then you will need to set the
44
+ ENV value of `SHAKAPACKER_CONFIG` to the location of the `config/shakapacker.yml` file per [rails/webpacker PR 2561](https://github.com/rails/webpacker/pull/2561). (Notice the change of spelling from Webpacker to Shakapacker)
45
45
 
46
46
  ## CSS, Sass, Fonts, and Images
47
47
  Should you move your styling assets to Webpack? Or stick with the plain Rails asset pipeline. It depends!
@@ -0,0 +1,15 @@
1
+ # Tips for usage with Shakapacker 6
2
+
3
+ As mentioned earlier in the documentation, we assume you install ReactOnRails in a project with Shakapacker 7+ installed and configured. If you still use Shakapacker 6, we encourage you to check the upgrade to the version 7 guide. Otherwise, you need to consider the following:
4
+
5
+ 1. The install generator tries to take the necessary steps to adapt the installed files to match the file structure and configurations for Shakapacker 6. So you don't need to be worried about the ReactOnRails installation process.
6
+
7
+ 2. Check the following table to map the references in the documentation to the relevant ones in Shakapacker 6:
8
+
9
+ |Usage in Shakapacker 7 |Equivalant in Shakapacker 6|
10
+ |----------------------------|---------------------------|
11
+ |`config/shakapacker.yml` |`config/webpacker.yml` |
12
+ |`bin/shakapacker` |`bin/webpacker` |
13
+ |`bin/shakapacker-dev-server`|`bin/webpacker-dev-server` |
14
+
15
+ 3. Any environment variables starting with `SHAKAPACKER_*` should be changed to `WEBPACKER_*`.
@@ -5,7 +5,7 @@ React on Rails requires both a ruby environment (for Rails) and a Node environme
5
5
 
6
6
  Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use both buildpacks via the command-line:
7
7
 
8
- ```
8
+ ```bash
9
9
  heroku buildpacks:set heroku/ruby
10
10
  heroku buildpacks:add --index 1 heroku/nodejs
11
11
  ```
@@ -14,22 +14,26 @@ For more information, see [Using Multiple Buildpacks for an App](https://devcent
14
14
 
15
15
  ## assets:precompile
16
16
 
17
- ### rails/webpacker webpack configuration
18
- If you're using the standard rails/webpacker configuration of webpack, then rails/webpacker
19
- will automatically modify or create an assets:precompile task to build your assets.
17
+ ### Shakapacker webpack configuration
18
+
19
+ Shakapacker hooks up a new `shakapacker:compile` task to `assets:precompile`, which gets run whenever you run `assets:precompile`.
20
+ If you are not using Sprockets, `shakapacker:compile` is automatically aliased to `assets:precompile`.
21
+
22
+ If you're using the standard `shakacode/shakapacker` configuration of webpack, then `shakacode/shakapacker`
23
+ will automatically modify or create an `assets:precompile` task to build your assets.
20
24
 
21
25
  Alternatively, you can specify `config.build_production_command` to have
22
- react_on_rails invoke a command for you during assets:precompile.
26
+ `react_on_rails` invoke a command for you during `assets:precompile`.
23
27
 
24
- ```
25
- config.build_production_command = "RAILS_ENV=production NODE_ENV=production bin/webpacker"
28
+ ```bash
29
+ config.build_production_command = "RAILS_ENV=production NODE_ENV=production bin/shakapacker"
26
30
  ```
27
31
 
28
- ### Consider Removing Webpacker's clean task
32
+ ### Consider Removing Shakapacker's clean task
29
33
 
30
- If you are deploying on Heroku, then you don't need Webpacker's clean task which
34
+ If you are deploying on Heroku, then you don't need Shakapacker's clean task which
31
35
  might delete files that you need.
32
36
 
33
- ```
34
- Rake::Task['webpacker:clean'].clear
37
+ ```bash
38
+ Rake::Task['shakapacker:clean'].clear
35
39
  ```