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
- Replace bin/dev-static with unified bin/dev script supporting multiple modes
- Add targeted cleaning to remove only non-generated files from pack directories
- Refactor cleaning methods to reduce complexity per RuboCop suggestions
- Update all documentation to reference 'bin/dev static' instead of 'bin/dev-static'
- Remove obsolete dev-static generator file and associated tests
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,7 +442,6 @@ 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
-
446
445
1. Production applications would typically have a server bundle that differs from the client bundle
447
446
2. This change only affects trying to use HMR with react_on_rails with rails/webpacker.
448
447
@@ -1160,13 +1159,11 @@ No changes.
1160
1159
- 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.
1161
1160
[#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).
1162
1161
-**Migration to v6**
1163
-
1164
1162
- Do not run the generator again if you've already run it.
1165
1163
1166
1164
- 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.
1167
1165
1168
1166
- To configure the asset compilation you can either
1169
-
1170
1167
1. Specify a `config/react_on_rails` setting for `build_production_command` to be nil to turn this feature off.
1171
1168
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: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,16 @@
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
-
7
6
1. Replace `react-rails` in `Gemfile` with the latest version of `react_on_rails` and run `bundle install`.
8
7
2. Remove `react_ujs` from `package.json` and run `yarn install`.
9
8
3. Commit changes!
10
9
11
10
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`.
12
11
13
12
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
-
15
13
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.
16
14
17
15
2. In `app/javascript` directory you may notice some changes.
18
-
19
16
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.
20
17
21
18
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
-
242
241
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.
- Update for the renaming in the `WebpackConfigLoader` in your Webpack configuration.
255
253
You will need to rename the following object properties:
256
-
257
254
- webpackOutputPath ==> output.path
258
255
- webpackPublicOutputDir ==> output.publicPath
259
256
- hotReloadingUrl ==> output.publicPathWithHost
@@ -265,7 +262,6 @@ gem "webpacker"
265
262
- devBuild ==> Use `const devBuild = process.env.NODE_ENV !== 'production';`
266
263
267
264
- Edit your Webpack.config files:
268
-
269
265
- Change your Webpack output to be like this. **Be sure to have the hash or chunkhash in the filename,** unless the bundle is server side.:
270
266
271
267
```
@@ -295,7 +291,6 @@ gem "webpacker"
295
291
```
296
292
297
293
- Find your `webpacker_lite.yml` and rename it to `webpacker.yml`
298
-
299
294
- Consider copying a default webpacker.yml setup such as https://github.com/shakacode/react-on-rails-v9-rc-generator/blob/master/config/webpacker.yml
300
295
- If you are not using the webpacker Webpack setup, be sure to put in `compile: false` in the `default` section.
301
296
- Alternately, if you are updating from webpacker_lite, you can manually change these:
- 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
-
61
60
- 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.
62
61
- 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.
63
62
- 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.
0 commit comments