You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix prettier formatting issues from PR #1769 (#1774)
- Fix formatting in CHANGELOG.md
- Fix formatting in CODING_AGENTS.md
- Fix formatting in docs files
- Fix formatting in CSS module test fixtures
These formatting issues were introduced in the merged PR #1769
and are causing CI failures.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,6 +442,7 @@ for details.
442
442
- Removal of config.symlink_non_digested_assets_regex as it's no longer needed with rails/webpacker.
443
443
If any business needs this, we can move the code to a separate gem.
444
444
- Added configuration option `same_bundle_for_client_and_server` with default `false` because
445
+
445
446
1. Production applications would typically have a server bundle that differs from the client bundle
446
447
2. This change only affects trying to use HMR with react_on_rails with rails/webpacker.
447
448
@@ -1159,11 +1160,13 @@ No changes.
1159
1160
- Added automatic compilation of assets at precompile is now done by ReactOnRails. Thus, you don't need to provide your own `assets.rake` file that does the precompilation.
1160
1161
[#398](https://github.com/shakacode/react_on_rails/pull/398) by [robwise](https://github.com/robwise), [jbhatab](https://github.com/jbhatab), and [justin808](https://github.com/justin808).
1161
1162
-**Migration to v6**
1163
+
1162
1164
- Do not run the generator again if you've already run it.
1163
1165
1164
1166
- See [shakacode/react-webpack-rails-tutorial/pull/287](https://github.com/shakacode/react-webpack-rails-tutorial/pull/287) for an example of upgrading from v5.
1165
1167
1166
1168
- To configure the asset compilation you can either
1169
+
1167
1170
1. Specify a `config/react_on_rails` setting for `build_production_command` to be nil to turn this feature off.
1168
1171
2. Specify the script command you want to run to build your production assets, and remove your `assets.rake` file.
Copy file name to clipboardExpand all lines: docs/additional-details/migrating-from-react-rails.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,19 @@
3
3
In this guide, it is assumed that you have upgraded the `react-rails` project to use `shakapacker` version 7. To this end, check out [Shakapacker v7 upgrade guide](https://github.com/shakacode/shakapacker/tree/master/docs/v7_upgrade.md). Upgrading `react-rails` to version 3 can make the migration smoother but it is not required.
4
4
5
5
1. Update Deps
6
+
6
7
1. Replace `react-rails` in `Gemfile` with the latest version of `react_on_rails` and run `bundle install`.
7
8
2. Remove `react_ujs` from `package.json` and run `yarn install`.
8
9
3. Commit changes!
9
10
10
11
2. Run `rails g react_on_rails:install` but do not commit the change. `react_on_rails` installs node dependencies and also creates sample React component, Rails view/controller, and updates `config/routes.rb`.
11
12
12
13
3. Adapt the project: Check the changes and carefully accept, reject, or modify them as per your project's needs. Besides changes in `config/shakapacker` or `babel.config` which are project-specific, here are the most noticeable changes to address:
14
+
13
15
1. Check Webpack config files at `config/webpack/*`. If coming from `react-rails` v3, the changes are minor since you have already made separate configurations for client and server bundles. The most important change here is to notice the different names for the server bundle entry file. You may choose to stick with `server_rendering.js` or use `server-bundle.js` which is the default name in `react_on_rails`. The decision made here affects the other steps.
14
16
15
17
2. In `app/javascript` directory you may notice some changes.
18
+
16
19
1.`react_on_rails` by default uses `bundles` directory for the React components. You may choose to rename `components` into `bundles` to follow the convention.
17
20
18
21
2.`react_on_rails` uses `client-bundle.js` and `server-bundle.js` instead of `application.js` and `server_rendering.js`. There is nothing special about these names. It can be set to use any other name (as mentioned above). If you too choose to follow the new names, consider updating the relevant `javascript_pack_tag` in your Rails views.
For an example of upgrading, see [react-webpack-rails-tutorial/pull/416](https://github.com/shakacode/react-webpack-rails-tutorial/pull/416).
239
239
240
240
- Breaking Configuration Changes
241
+
241
242
1. Added `config.node_modules_location` which defaults to `""` if Webpacker is installed. You may want to set this to `'client'` in `config/initializers/react_on_rails.rb` to keep your `node_modules` inside the `/client` directory.
- The `generated_component_packs_loading_strategy` defaults to `:async` for Shakapacker ≥ 8.2.0 and `:sync` for Shakapacker < 8.2.0.
58
58
- The `force_load` configuration now defaults to `true`.
59
59
- The new default values of `generated_component_packs_loading_strategy: :async` and `force_load: true` work together to optimize component hydration. Components now hydrate as soon as their code and server-rendered HTML are available, without waiting for the full page to load. This parallel processing significantly improves time-to-interactive by eliminating the traditional waterfall of waiting for page load before beginning hydration (It's critical for streamed HTML).
60
+
60
61
- The previous need for deferring scripts to prevent race conditions has been eliminated due to improved hydration handling. Making scripts not defer is critical to execute the hydration scripts early before the page is fully loaded.
61
62
- The `force_load` configuration makes `react-on-rails` hydrate components immediately as soon as their server-rendered HTML reaches the client, without waiting for the full page load.
62
63
- If you want to keep the previous behavior, you can set `generated_component_packs_loading_strategy: :defer` or `force_load: false` in your `config/initializers/react_on_rails.rb` file.
Copy file name to clipboardExpand all lines: spec/dummy/spec/fixtures/automated_packs_generation/components/ComponentWithCSSModule/ror_components/ComponentWithCSSModule.jsx
Copy file name to clipboardExpand all lines: spec/dummy/spec/fixtures/automated_packs_generation/components/ComponentWithCSSModule/ror_components/ComponentWithCSSModule.module.css
0 commit comments