CHANGELOG.md in react_on_rails-9.0.0.rc.0 vs CHANGELOG.md in react_on_rails-9.0.0
- old
+ new
@@ -12,10 +12,12 @@
## 9.0 from 8.x. Upgrade Instructions
All 9.0.0 beta versions can be viewed in [PR 908](https://github.com/shakacode/react_on_rails/pull/908)
+For an example of upgrading, see [react-webpack-rails-tutorial/pull/416](https://github.com/shakacode/react-webpack-rails-tutorial/pull/416).
+
- Breaking Configuration Changes
1. Added `config.node_modules_location` which defaults to `""` if Webpacker is installed. You may want to set this to 'client'` to `config/initializers/react_on_rails.rb` to keep your node_modules inside of `/client`
2. Renamed
* config.npm_build_test_command ==> config.build_test_command
* config.build_production_command ==> config.build_production_command
@@ -33,19 +35,20 @@
- hotReloadingUrl ==> output.publicPathWithHost
- hotReloadingHostname ==> settings.dev_server.host
- hotReloadingPort ==> settings.dev_server.port
- hmr ==> settings.dev_server.hmr
- manifest ==> Remove this one. We use the default for Webpack of manifest.json
- - env ==> Use `const { env } = require('process');
- - devBuild ==> Use `const devBuild = process.env.NODE_ENV !== 'production';
+ - env ==> Use `const { env } = require('process');`
+ - devBuild ==> Use `const devBuild = process.env.NODE_ENV !== 'production';`
- Edit your Webpack.config files:
- Change your Webpack output to be like:
```
const webpackConfigLoader = require('react-on-rails/webpackConfigLoader');
const configPath = resolve('..', 'config');
const { output, settings } = webpackConfigLoader(configPath);
+ const hmr = settings.dev_server.hmr;
const devBuild = process.env.NODE_ENV !== 'production';
output: {
filename: isHMR ? '[name]-[hash].js' : '[name]-[chunkhash].js',
chunkFilename: '[name]-[chunkhash].chunk.js',
@@ -62,9 +65,12 @@
}),
```
- Find your `webpacker_lite.yml` and rename it to `webpacker.yml`
+ - Consider copying a default webpacker.yml setup such as https://github.com/shakacode/react-on-rails-v9-rc-generator/blob/master/config/webpacker.yml
+ - If you are not using the webpacker webpacker setup, be sure to put in `compile: false` in the `default` section.
+ - Alternately, if you are updating from webpacker_lite, you can manually change these:
- Add a default setting
```
cache_manifest: false
```
- For production, set: