react-on-rails v6.0.0 Release Notes

Release Date: 2016-05-25 // almost 8 years ago
  • ๐Ÿ’ฅ Breaking Changes
    • โž• 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. #398 by robwise, jbhatab, and justin808.
    • Migration to v6

      • Do not run the generator again if you've already run it.
      • See shakacode/react-webpack-rails-tutorial/pull/287 for an example of upgrading from v5.
      • To configure the asset compliation you can either
      • Specify a config/react_on_rails setting for build_production_command to be nil to turn this feature off.
      • Specify the script command you want to run to build your production assets, and remove your assets.rake file.
      • If you are using the ReactOnRails test helper, then you will need to add the 'config.npm_build_test_command' to your config to tell react_on_rails what command to run when you run rspec.
    • โฌ†๏ธ See shakacode/react-webpack-rails-tutorial #287 for an upgrade example. The PR has a few comments on the upgrade.

    Here is the addition to the generated config file:

      # This configures the script to run to build the production assets by webpack. Set this to nil
      # if you don't want react_on_rails building this file for you.
      config.build_production_command = "npm run build:production"
    
      # If you are using the ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
      # with rspec then this controls what npm command is run
      # to automatically refresh your webpack assets on every test run.
      config.npm_build_test_command = "npm run build:test"
    
    ๐Ÿ›  Fixed
    • Fixed errors when server rendered props contain \u2028 or \u2029 characters #375 by mariusandra
    • Fixed "too early unmount" which caused problems with Turbolinks 5 not updating the screen #425 by szyablitsky
    โž• Added
    • Experimental ability to use node.js process for server rendering. See #380 by alleycat-at-git.
    • Non-digested version of assets in public folder #413 by alleycat-at-git.
    • Cache client/node_modules directory to prevent Heroku from reinstalling all modules from scratch #324 by modosc.
    • ReactOnRails.reactOnRailsPageLoaded() is exposed in case one needs to call this manually and information on async script loading added. See #315 by SqueezedLight.
    ๐Ÿ”„ Changed
    • #398 by robwise, jbhatab, and justin808 contains:
      • Only one webpack config is generated for server and client config. Package.json files were changed to reflect this.
      • Added npm_build_test_command to allow developers to change what npm command is automatically run from rspec.
    • Replace URI with Addressable gem. See #405 by lucke84
    โœ‚ Removed
    • #398 by robwise, jbhatab, and justin808 contains:
      • Server rendering is no longer an option in the generator and is always accessible.
      • Removed lodash, jquery, and loggerMiddleware from the generated code.
      • Removed webpack watch check for test helper automatic compilation.