react_on_rails 13.3.5 → 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 +77 -61
  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: 4483ea8d99927209e3115c17b967b22a187637111724b7928d3c7a4ff8672981
4
- data.tar.gz: 121595ddc9e1d581ff289e4796bdd660b2107e504a30a1fdc5594daa7f2f411c
3
+ metadata.gz: 545e97728f6633e1adc5091f8e1a72c377ce8d8c809ca8b6378c0b1bffe62c7d
4
+ data.tar.gz: 06a83f533ee9518518afeb63a31191861298f92a2ec36b876914347de0a0f960
5
5
  SHA512:
6
- metadata.gz: 9c584cc7cad86fbac89377fd062dbe69686b51cdd078659cce234b77ae549d1c8071770458ebb5c0be6b5922716c6083ef2cbb731e96241d259de2f21e2d6ed4
7
- data.tar.gz: a2eac20d40c6e06ccb191ea210d5bf1c024486611e05fed2f4b1260f4d04ea8b740b455770a6dfbf24d5497d3b723674e43e8e3ce366e08dc193c7e4d2587dfa
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,67 +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.5] - 2022-05-31
34
+
35
+ ### [13.3.5] - 2023-05-31
21
36
  #### Fixed
22
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).
23
38
 
24
- ### [13.3.4] - 2022-05-23
39
+ ### [13.3.4] - 2023-05-23
25
40
 
26
- ### Added
41
+ #### Added
27
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).
28
43
 
29
- ### Removed
44
+ #### Removed
30
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).
31
46
 
32
- ### [13.3.3] - 2022-03-21
47
+ ### [13.3.3] - 2023-03-21
33
48
 
34
- ### Fixed
49
+ #### Fixed
35
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).
36
51
 
37
- ### [13.3.2] - 2022-02-24
52
+ ### [13.3.2] - 2023-02-24
38
53
 
39
- ### Fixed
54
+ #### Fixed
40
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).
41
56
 
42
- ### [13.3.1] - 2022-01-30
43
- ## Added
57
+ ### [13.3.1] - 2023-01-30
58
+ #### Added
44
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).
45
60
 
46
- ### Fixed
61
+ #### Fixed
47
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).
48
63
 
49
- ### [13.3.0] - 2022-01-29
50
- ### Fixed
64
+ ### [13.3.0] - 2023-01-29
65
+ #### Fixed
51
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).
52
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).
53
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).
54
69
 
55
- ### Added
70
+ #### Added
56
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).
57
72
 
58
73
  ### [13.2.0] - 2022-12-23
59
74
 
60
- ### Fixed
75
+ #### Fixed
61
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).
62
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).
63
78
 
64
- ### Added
79
+ #### Added
65
80
  - Exposed `reactHydrateOrRender` utility via [PR 1481](https://github.com/shakacode/react_on_rails/pull/1481) by [vaukalak](https://github.com/vaukalak).
66
81
 
67
82
  ### [13.1.0] - 2022-08-20
@@ -109,16 +124,16 @@ Changes since last non-beta release.
109
124
 
110
125
  ### [12.6.0] - 2022-01-22
111
126
 
112
- ### Added
127
+ #### Added
113
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).
114
129
 
115
130
  ### [12.5.2] - 2021-12-29
116
- ### Fixed
131
+ #### Fixed
117
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).
118
133
 
119
134
  ### [12.5.1] - 2021-12-27
120
135
 
121
- ### Fixed
136
+ #### Fixed
122
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).
123
138
 
124
139
  ### [12.5.0] - 2021-12-26
@@ -478,7 +493,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
478
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).
479
494
 
480
495
  ## [8.0.5] - 2017-07-04
481
- ### fixed
496
+ #### Fixed
482
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).
483
498
  - Remove contentBase deprecation warning message. [#878](https://github.com/shakacode/react_on_rails/pull/878) by [ened ](https://github.com/ened).
484
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).
@@ -487,11 +502,11 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
487
502
  *Note: 8.0.4 skipped.*
488
503
 
489
504
  ## [8.0.3] - 2017-06-19
490
- ### Fixed
505
+ #### Fixed
491
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)
492
507
 
493
508
  ## [8.0.2] - 2017-06-04
494
- ### Fixed
509
+ #### Fixed
495
510
  - Any failure in webpack to build test files quits tests.
496
511
  - Fixed a Ruby 2.4 potential crash which could cause a crash due to pathname change in Ruby 2.4.
497
512
  - CI Improvements:
@@ -502,7 +517,7 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
502
517
  - [#862](https://github.com/shakacode/react_on_rails/pull/862) by [justin808](https://github.com/justin808)
503
518
 
504
519
  ## [8.0.1] - 2017-05-30
505
- ### Fixed
520
+ #### Fixed
506
521
  - Generator no longer modifies `assets.rb`. [#859](https://github.com/shakacode/react_on_rails/pull/859) by [justin808](https://github.com/justin808)
507
522
 
508
523
  ## [8.0.0] - 2017-05-29
@@ -515,21 +530,21 @@ Moved to [our documentation](https://www.shakacode.com/react-on-rails/docs/guide
515
530
  - For a simple example of the webpacker_lite setup, run the basic generator.
516
531
 
517
532
  ## [8.0.0-beta.3] - 2017-05-27
518
- ### Changed
533
+ #### Changed
519
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)
520
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)
521
536
 
522
537
  ## [8.0.0-beta.2] - 2017-05-08
523
538
 
524
- ### Changed
539
+ #### Changed
525
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).
526
541
 
527
542
  ## [8.0.0-beta.1] - 2017-05-03
528
543
 
529
- ### Added
544
+ #### Added
530
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).
531
546
 
532
- ### Changed
547
+ #### Changed
533
548
  Breaking change is that the default value of symlink_non_digested_assets_regex has changed from this
534
549
  old value to nil. This is a breaking change if you didn't have this value set in your
535
550
  config/initializers/react_on_rails.rb file and you need this because you're using webpack's CSS
@@ -549,65 +564,65 @@ Same as 7.0.1.
549
564
  *Accidental release of beta gem here*
550
565
 
551
566
  ## [7.0.1] - 2017-04-27
552
- ### Fixed
567
+ #### Fixed
553
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)
554
569
 
555
570
  ## [7.0.0] - 2017-04-25
556
- ### Changed
571
+ #### Changed
557
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)
558
573
 
559
- ### Fixed
574
+ #### Fixed
560
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)
561
576
 
562
577
  ## [6.10.1] - 2017-04-23
563
- ### Fixed
578
+ #### Fixed
564
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).
565
580
 
566
581
  ## [6.10.0] - 2017-04-13
567
582
 
568
- ### Added
583
+ #### Added
569
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).
570
585
 
571
- ### Fixed
586
+ #### Fixed
572
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).
573
588
 
574
589
  ## [6.9.3] - 2017-04-03
575
590
 
576
- ### Fixed
591
+ #### Fixed
577
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).
578
593
 
579
594
  ## [6.9.2] - 2017-04-02
580
595
 
581
- ### Changed
596
+ #### Changed
582
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).
583
598
 
584
- ### Fixed
599
+ #### Fixed
585
600
  - Remove pretty formatting of JSON in development. [#789](https://github.com/shakacode/react_on_rails/pull/789) by [justin808](https://github.com/justin808)
586
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)
587
602
 
588
603
  ## [6.9.1] - 2017-03-30
589
604
 
590
- ### Fixed
605
+ #### Fixed
591
606
  - Fixes Crash in Development for String Props. [#784](https://github.com/shakacode/react_on_rails/issues/784) by [justin808](https://github.com/justin808).
592
607
 
593
608
  ## [6.9.0] - 2017-03-29
594
609
 
595
- ### Fixed
610
+ #### Fixed
596
611
  - Fixed error in the release script. [#767](https://github.com/shakacode/react_on_rails/issues/767) by [isolo](https://github.com/isolo).
597
612
 
598
- ### Changed
613
+ #### Changed
599
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).
600
615
 
601
- ### Added
616
+ #### Added
602
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.
603
618
  [#777](https://github.com/shakacode/react_on_rails/pull/777) by [danijel](https://github.com/danijel).
604
619
 
605
620
  ## [6.8.2] - 2017-03-24
606
- ### Fixed
621
+ #### Fixed
607
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).
608
623
 
609
624
  ## [6.8.1] - 2017-03-21
610
- ### Fixed
625
+ #### Fixed
611
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).
612
627
 
613
628
  ## [6.8.0] - 2017-03-06
@@ -615,7 +630,7 @@ Same as 7.0.1.
615
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).
616
631
 
617
632
  ## [6.7.2] - 2017-03-05
618
- ### Improved
633
+ #### Improved
619
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).
620
635
 
621
636
  ## [6.7.1] - 2017-02-28
@@ -623,7 +638,7 @@ No changes other than a test fix.
623
638
 
624
639
  ## [6.7.0] - 2017-02-28
625
640
 
626
- ### IMPORTANT
641
+ #### IMPORTANT
627
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:
628
643
 
629
644
  ```
@@ -636,32 +651,32 @@ Commenting out this line addresses the issue:
636
651
  config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
637
652
  ```
638
653
 
639
- ### Added
654
+ #### Added
640
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).
641
656
 
642
- ### Fixed
657
+ #### Fixed
643
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).
644
659
  - Fix spec failing due to duplicate component. [#734](https://github.com/shakacode/react_on_rails/pull/734) by [hrishimittal](https://github.com/hrishimittal).
645
660
 
646
661
  ## [6.6.0] - 2017-02-18
647
- ### Added
662
+ #### Added
648
663
  - Switched to yarn! [#715](https://github.com/shakacode/react_on_rails/pull/715) by [squadette](https://github.com/squadette).
649
664
 
650
665
  ## [6.5.1] - 2017-02-11
651
- ### Fixed
666
+ #### Fixed
652
667
  - Allow using gem without sprockets. [#671](https://github.com/shakacode/react_on_rails/pull/671) by [fc-arny](https://github.com/fc-arny).
653
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).
654
669
  - Small formatting fix for errors [#703](https://github.com/shakacode/react_on_rails/pull/703) by [justin808](https://github.com/justin808).
655
670
 
656
671
  ## [6.5.0] - 2017-01-31
657
- ### Added
672
+ #### Added
658
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).
659
674
 
660
- ### Fixed
675
+ #### Fixed
661
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).
662
677
 
663
678
  ## [6.4.2] - 2017-01-17
664
- ### Fixed
679
+ #### Fixed
665
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).
666
681
 
667
682
  ## [6.4.1] - 2017-1-17
@@ -669,17 +684,17 @@ No changes.
669
684
 
670
685
  ## [6.4.0] - 2017-1-12
671
686
 
672
- ### Possible Breaking Change
687
+ #### Possible Breaking Change
673
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.
674
689
 
675
- ### Fixed
690
+ #### Fixed
676
691
  - Removed foreman as a dependency. [#678](https://github.com/shakacode/react_on_rails/pull/678) by [x2es](https://github.com/x2es).
677
692
 
678
- ### Added
693
+ #### Added
679
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).
680
695
 
681
696
  ## [6.3.5] - 2017-1-6
682
- ### Fixed
697
+ #### Fixed
683
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).
684
699
 
685
700
  ## [6.3.4] - 2016-12-25
@@ -1087,9 +1102,10 @@ Best done with Object destructing:
1087
1102
  - Turbolinks support.
1088
1103
 
1089
1104
  ##### Fixed
1090
- - Fix several generator related issues.
1105
+ - Fix several generator-related issues.
1091
1106
 
1092
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/13.3.5...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
1093
1109
  [13.3.5]: https://github.com/shakacode/react_on_rails/compare/13.3.4...13.3.5
1094
1110
  [13.3.4]: https://github.com/shakacode/react_on_rails/compare/13.3.3...13.3.4
1095
1111
  [13.3.3]: https://github.com/shakacode/react_on_rails/compare/13.3.2...13.3.3
@@ -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
  ```