⬆️ For upgrade instructions, see [docs/basics/upgrading-react-on-rails.md](./docs/basics/upgrading-react-on-rails.md).
👍 1. React Hooks Support for top level components
- Typescript bindings 🚅 3. rails/webpacker "just works" with React on Rails by default. 👍 4. i18n support for generating a JSON file rather than a JS file.
💥 BREAKING CHANGE
renderFunctionon the function for which you want to return to be invoked to return the React component. In that case, you won't need to pass any unused params. PR 1268 by justin808
⬆️ See [docs/basics/upgrading-react-on-rails](./docs/basics/upgrading-react-on-rails.md#upgrading-to-v12) for details.
⚡️ Other Updates
rails/webpacker. The example test app in
spec/dummywas recently converted over to use rails/webpacker v4+. It's a good example of how to leverage rails/webpacker's webpack configuration for server-side rendering.
- 🔄 Changed the precompile task to use the rails/webpacker one by default
- ⚡️ Updated generators to use React hooks
- 🚅 Requires the use of rails/webpacker view helpers
- 0️⃣ If the webpacker webpack config files exist, then React on Rails will not override the default
assets:precompile setup by rails/webpacker. If you are not using the rails/webpacker setup for webpack,
then be sure to remove the JS files inside of config/webpack, like
- 🚅 Removal of support for old Rubies and Rails.
- Removal of config.symlink_non_digested_assets_regex as it's no longer needed with rails/webpacker. If any business needs this, we can move the code to a separate gem.
- Added configuration option
- Production applications would typically have a server bundle that differs from the client bundle
- This change only affects trying to use HMR with react_on_rails with rails/webpacker.
The previous behavior was to always go to the webpack-dev-server for the server bundle if the webpack-dev-server was running and the server bundle was found in the
If you are using the same bundle for client and server rendering, then set this configuration option to
true. By justin808.
- Added support to export locales in JSON format. New option added
i18n_output_formatwhich allows to specify locales format either
JSONformat is now the default.
Use this config setting to get the old behavior: config.i18n_output_format = 'js'
- Added Typescript definitions to the Node package. By justin808 and judahmeek in PR 1287.
- Removed restriction to keep the server bundle in the same directory with the client bundles. Rails/webpacker 4 has an advanced cleanup that will remove any files in the directory of other webpack files. Removing this restriction allows the server bundle to be created in a sibling directory. By justin808.
v12.0.0-beta.1June 14, 2020
v12.0.0-beta.0June 13, 2020
- rails_context can more easily be called from controller methods. The mandatory param of server_side has been made optional.
v11.2.1December 06, 2018
🚀 Do not use. Unpublished. Caused by an issue with the release script.