Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-on-rails

Package Overview
Dependencies
Maintainers
0
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-on-rails - npm Package Versions

1
1921

2.1.0

Diff

Changelog

Source

[2.1.0] - 2016-01-26

Added
  • Added EnsureAssetsCompiled feature so that you do not accidentally run tests without properly compiling the JavaScript bundles. Add a line to your rails_helper.rb file to check that the latest Webpack bundles have been generated prior to running tests that may depend on your client-side code. See docs for more detailed instructions. #222
  • Added migration guide for migrating from React-Rails. #219
  • Added React on Rails Doctrine to docs. Discusses the project's motivations, conventions, and principles. #220
  • Added ability to skip display:none style in the generated content tag for a component. Some developers may want to disable inline styles for security reasons. See generated config initializer file for example on setting skip_display_none. #218
Changed
  • Changed message when running the dev (a.k.a. "express" server). #227
Fixed
  • Fixed handling of Turbolinks. Code was checking that Turbolinks was installed when it was not yet because some setups load Turbolinks after the bundles. The changes to the code will check if Turbolinks is installed after the page loaded event fires. Code was also added to allow easy debugging of Turbolinks, which should be useful when v5 of Turbolinks is released shortly. Details of how to configure Turbolinks with troubleshooting were added to docs directory. #221
  • Fixed issue with already initialized constant warning appearing when starting a Rails server #226
  • Fixed to make backwards compatible with Ruby v2.0 and updated all Ruby and Node dependencies.

justin808
published 2.0.2 •

Changelog

Source

[2.0.2]

  • Added better messages after generator runs. #210
justin808
published 2.0.1 •

Changelog

Source

[2.0.1]

  • Fixed bug with version matching between gem and npm package.
justin808
published 2.0.0 •

Changelog

Source

[2.0.0]

  • Move JavaScript part of react_on_rails to npm package 'react-on-rails'.
  • Converted JavaScript code to ES6! with tests!
  • No global namespace pollution. ReactOnRails is the only global added.
  • New API. Instead of placing React components on the global namespace, you instead call ReactOnRails.register, passing an object where keys are the names of your components:
import ReactOnRails from 'react-on-rails';
ReactOnRails.register({name: component});

Best done with Object destructing:

  import ReactOnRails from 'react-on-rails';
  ReactOnRails.register(
    {
      Component1,
      Component2
    }
  );

Previously, you used

window.Component1 = Component1;
window.Component2 = Component2;

This would pollute the global namespace. See details in the README.md for more information.

  • Your jade template for the WebpackDevServer setup should use the new API:
  ReactOnRails.render(componentName, props, domNodeId);

such as:

  ReactOnRails.render("HelloWorldApp", {name: "Stranger"}, 'app');
  • All npm dependency libraries updated. Most notable is going to Babel 6.
  • Dropped support for react 0.13.
  • JS Linter uses ShakaCode JavaScript style: https://github.com/shakacode/style-guide-javascript
  • Generators account these differences.
Migration Steps v1 to v2

Example of upgrading

  1. Update the react_on_rails gem.
  2. Remove //= require react_on_rails from any files such as app/assets/javascripts/application.js. This file comes from npm now.
  3. Search you app for 'generator_function' and remove lines in layouts and rb files that contain it. Determination of a generator function is handled automatically.
  4. Find your files where you registered client and server globals, and use the new ReactOnRails.register syntax. Optionally rename the files clientRegistration.jsx and serverRegistration.jsx rather than Globals.
  5. Update your index.jade to use the new API ReactOnRails.render("MyApp", !{props}, 'app');
  6. Update your webpack files per the example commit. Remove globally exposing React and ReactDom, as well as their inclusion in the entry section. These are automatically included now.
  7. Run cd client && npm i --save react-on-rails to get react-on-rails into your client/package.json.
  8. You should also update any other dependencies if possible to match up with the react-webpack-rails-tutorial. This includes updating to Babel 6.
  9. If you want to stick with Babel 5 for a bit, see Issue #238.

justin808
published 2.0.0-rc.4 •

justin808
published 2.0.0-rc.3 •

justin808
published 2.0.0-rc.1 •

justin808
published 2.0.0-beta.3 •

justin808
published 2.0.0-beta.2 •

justin808
published 2.0.0-beta.1 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc