react-on-rails
Advanced tools
Comparing version 3.0.0-rc.1 to 3.0.0-rc.2
@@ -6,3 +6,3 @@ # Change Log | ||
## [3.0.0-beta.1] | ||
## [3.0.0-rc.2] - 2016-02-09 | ||
##### Fixed | ||
@@ -13,4 +13,6 @@ - Fix Bootstrap Sass Append to Gemfile, missing new line. [#262](https://github.com/shakacode/react_on_rails/pull/262). | ||
- Added helper `redux_store` and associated JavaScript APIs that allow multiple React components to use the same store. Thus, you initialize the store, with props, separately from the components. | ||
- Added forman to gemspec in case new dev does not have it globally installed. [#248](https://github.com/shakacode/react_on_rails/pull/248) | ||
- Added forman to gemspec in case new dev does not have it globally installed. [#248](https://github.com/shakacode/react_on_rails/pull/248). | ||
- Support for Turbolinks 5! [#270](https://github.com/shakacode/react_on_rails/pull/270). | ||
- Added better error messages for `ReactOnRails.register()`. [#273](https://github.com/shakacode/react_on_rails/pull/273). | ||
##### Breaking Change | ||
@@ -28,2 +30,3 @@ - Calls to `react_component` should use a named argument of props. For example, change this: | ||
- Renamed `ReactOnRails.configure_rspec_to_compile_assets` to `ReactOnRails::TestHelper.configure_rspec_to_compile_assets`. The code has also been optimized to check for whether or not the compiled webpack bundles are up to date or not and will not run if not necessary. If you are using non-standard directories for your generated webpack assets (`app/assets/javascripts/generated` and `app/assets/stylesheets/generated`) or have additional directories you wish the helper to check, you need to update your ReactOnRails configuration accordingly. See [documentation](https://github.com/shakacode/react_on_rails/blob/master/docs/additional_reading/rspec_configuration.md) for how to do this. [#253](https://github.com/shakacode/react_on_rails/pull/253). | ||
- You have to call `ReactOnRails.register` to register react components. This was deprecated in v2. [#273](https://github.com/shakacode/react_on_rails/pull/273). | ||
@@ -168,3 +171,3 @@ ##### Migration Steps v2 to v3 | ||
[3.0.0-beta.1]: https://github.com/shakacode/react_on_rails/compare/2.3.0...3.0.0-beta.1 | ||
[3.0.0-rc.1]: https://github.com/shakacode/react_on_rails/compare/2.3.0...3.0.0-rc.1 | ||
[2.3.0]: https://github.com/shakacode/react_on_rails/compare/2.2.0...2.3.0 | ||
@@ -171,0 +174,0 @@ [2.2.0]: https://github.com/shakacode/react_on_rails/compare/2.1.1...2.2.0 |
@@ -68,2 +68,6 @@ 'use strict'; | ||
function turbolinksVersion5() { | ||
return typeof Turbolinks.controller !== 'undefined'; | ||
} | ||
function initializeStore(el) { | ||
@@ -162,7 +166,13 @@ var name = el.getAttribute('data-store-name'); | ||
} else { | ||
debugTurbolinks('USING TURBOLINKS: document page:before-unload and page:change handlers' + ' installed.'); | ||
document.addEventListener('page:before-unload', reactOnRailsPageUnloaded); | ||
document.addEventListener('page:change', reactOnRailsPageLoaded); | ||
if (turbolinksVersion5()) { | ||
debugTurbolinks('USING TURBOLINKS 5: document turbolinks:before-cache and turbolinks:load handlers' + ' installed.'); | ||
document.addEventListener('turbolinks:before-cache', reactOnRailsPageUnloaded); | ||
document.addEventListener('turbolinks:load', reactOnRailsPageLoaded); | ||
} else { | ||
debugTurbolinks('USING TURBOLINKS: document page:before-unload and page:change handlers' + ' installed.'); | ||
document.addEventListener('page:before-unload', reactOnRailsPageUnloaded); | ||
document.addEventListener('page:change', reactOnRailsPageLoaded); | ||
} | ||
} | ||
}); | ||
} |
@@ -36,3 +36,3 @@ 'use strict'; | ||
/** | ||
* @param components { name: component } | ||
* @param components { component1: component1, component2: component2, etc. } | ||
*/ | ||
@@ -47,2 +47,6 @@ | ||
var component = components[name]; | ||
if (!component) { | ||
throw new Error('Called register with null component named ' + name); | ||
} | ||
var isGeneratorFunction = (0, _generatorFunction2.default)(component); | ||
@@ -63,15 +67,8 @@ | ||
get: function get(name) { | ||
var ctx = (0, _context2.default)(); | ||
if (_components.has(name)) { | ||
return _components.get(name); | ||
} | ||
// Backwards compatability. Remove for v3.0. | ||
if (!ctx[name]) { | ||
} else { | ||
var keys = (0, _from2.default)(_components.keys()).join(', '); | ||
throw new Error('Could not find component registered with name ' + name + '. Registered component names include [ ' + keys + ' ]. Maybe you forgot to register the component?'); | ||
} | ||
console.warn('WARNING: Global components are deprecated support will be removed from a future version. ' + 'Use ReactOnRails.register'); | ||
return { name: name, component: ctx[name] }; | ||
}, | ||
@@ -78,0 +75,0 @@ |
{ | ||
"name": "react-on-rails", | ||
"version": "3.0.0-rc.1", | ||
"version": "3.0.0-rc.2", | ||
"description": "react-on-rails JavaScript for react_on_rails Ruby gem", | ||
@@ -5,0 +5,0 @@ "main": "node_package/lib/ReactOnRails.js", |
@@ -5,7 +5,11 @@ [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/shakacode/react_on_rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=master&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=master) [![Dependency Status](https://gemnasium.com/shakacode/react_on_rails.svg)](https://gemnasium.com/shakacode/react_on_rails) [![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) | ||
* 3.0.0.beta.1 has shipped on Monday, 2/8/2016. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v1-to-v2). [Migration steps from 2.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v2-to-v3). | ||
* 3.0.0.rc.2 shipped on Sunday, 2/14/2016. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v1-to-v2). [Migration steps from 2.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v2-to-v3). | ||
* [RubyGems](https://rubygems.org/gems/react_on_rails/versions/3.0.0.rc.2), `gem "react_on_rails", "~> 3.0.0-rc.2"` | ||
* [NPM](https://www.npmjs.com/package/react-on-rails), `npm i --save react-on-rails@3.0.0-rc.2` | ||
* 3.0.0.rc.1 shipped on Monday, 2/8/2016. | ||
* 3.0.0 Highlights: | ||
1. Support for ensuring JavaScript is current when running tests. | ||
2. Support for multiple React components with one Redux store. So you can have a header React component and different body React components talking to the same Redux store! | ||
* There was a fatal error when using the lastest version of Redux for server rendering. See [Redux #1335](https://github.com/rackt/redux/issues/1335). See [diff 3.1.6...3.1.4](https://github.com/rackt/redux/commit/e2e14d26f09ca729ae0555442f50fcfc45bfb423#diff-1fdf421c05c1140f6d71444ea2b27638). Workaround for server rendering: Use Redux 3.1.7 or upgrade to React On Rails v2.3.0. [this commit](https://github.com/shakacode/react_on_rails/commit/59f1e68d3d233775e6abc63bff180ea59ac2d79e) on [PR #244](https://github.com/shakacode/react_on_rails/pull/244/). | ||
3. Support for Turbolinks 5! | ||
* There was a fatal error when using the lastest version of Redux for server rendering. See [Redux #1335](https://github.com/reactjs/redux/issues/1335). See [diff 3.1.6...3.1.4](https://github.com/reactjs/redux/commit/e2e14d26f09ca729ae0555442f50fcfc45bfb423#diff-1fdf421c05c1140f6d71444ea2b27638). Workaround for server rendering: Use Redux 3.1.7 or upgrade to React On Rails v2.3.0. [this commit](https://github.com/shakacode/react_on_rails/commit/59f1e68d3d233775e6abc63bff180ea59ac2d79e) on [PR #244](https://github.com/shakacode/react_on_rails/pull/244/). | ||
* 2.x Highlights: | ||
@@ -20,5 +24,5 @@ 1. Fixed a **critical** problem with TurboLinks. Be sure to see [turbolinks docs](docs/additional_reading/turbolinks.md) for more information on how to debug TurboLinks issues. | ||
**Project Objective**: To provide an opinionated and optimal framework for integrating **Ruby on Rails** with modern JavaScript tooling and libraries, including [**Webpack**](http://webpack.github.io/), [**Babel**](https://babeljs.io/), [**React**](https://github.com/rackt/react-router), [**Redux**](https://github.com/rackt/redux), [**React-Router**](https://github.com/rackt/react-router). This differs significantly from typical Rails. When considering what goes into **react_on_rails**, we ask ourselves, is the functionality related to the intersection of using Rails and with modern JavaScript? If so, then the functionality belongs right here. In other cases, we're releasing separate npm packages or Ruby gems. If you are interested in implementing React using traditional Rails architecture, see [react-rails](https://github.com/reactjs/react-rails). | ||
**Project Objective**: To provide an opinionated and optimal framework for integrating **Ruby on Rails** with modern JavaScript tooling and libraries, including [**Webpack**](http://webpack.github.io/), [**Babel**](https://babeljs.io/), [**React**](https://github.com/reactjs/react-router), [**Redux**](https://github.com/reactjs/redux), [**React-Router**](https://github.com/reactjs/react-router). This differs significantly from typical Rails. When considering what goes into **react_on_rails**, we ask ourselves, is the functionality related to the intersection of using Rails and with modern JavaScript? If so, then the functionality belongs right here. In other cases, we're releasing separate npm packages or Ruby gems. If you are interested in implementing React using traditional Rails architecture, see [react-rails](https://github.com/reactjs/react-rails). | ||
React on Rails integrates Facebook's [React](https://github.com/facebook/react) front-end framework with Rails. React v0.14.x is supported, with server rendering. [Redux](https://github.com/rackt/redux) and [React-Router](https://github.com/rackt/react-redux) are supported as well. See the Rails on Maui [blog post](http://www.railsonmaui.com/blog/2014/10/03/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/) that started it all! | ||
React on Rails integrates Facebook's [React](https://github.com/facebook/react) front-end framework with Rails. React v0.14.x is supported, with server rendering. [Redux](https://github.com/reactjs/redux) and [React-Router](https://github.com/reactjs/react-redux) are supported as well. See the Rails on Maui [blog post](http://www.railsonmaui.com/blog/2014/10/03/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/) that started it all! | ||
@@ -106,6 +110,6 @@ Be sure to see: | ||
+ [Redux](https://github.com/rackt/redux) | ||
+ [Redux](https://github.com/reactjs/redux) | ||
+ [Webpack dev server](https://webpack.github.io/docs/webpack-dev-server.html) with [hot module replacement](https://webpack.github.io/docs/hot-module-replacement-with-webpack.html) | ||
+ [Webpack optimization functionality](https://github.com/webpack/docs/wiki/optimization) | ||
+ [React Router](https://github.com/rackt/react-router) | ||
+ [React Router](https://github.com/reactjs/react-router) | ||
@@ -173,3 +177,3 @@ See the [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) for an example of a live implementation and code. | ||
Inside your Rails views, you can now use the `react_component` helper method provided by React on Rails. You can pass props directly to the react component helper. You can also initialize a Redux store with view helper `redux_store` so that the store can be shared amongst multiple React components. Your best best is to scan the code inside of the [/spec/dummy](spec/dummy) sample app. | ||
Inside your Rails views, you can now use the `react_component` helper method provided by React on Rails. You can pass props directly to the react component helper. You can also initialize a Redux store with view helper `redux_store` so that the store can be shared amongst multiple React components. Your best bet is to scan the code inside of the [/spec/dummy](spec/dummy) sample app. | ||
@@ -334,4 +338,4 @@ ### Client-Side Rendering vs. Server-Side Rendering | ||
... | ||
<% redux_store("appStore", @react_props) %>; | ||
<%= render_component("NavbarApp") %> | ||
<%= redux_store("appStore", @react_props) %>; | ||
<%= react_component("NavbarApp") %> | ||
yield | ||
@@ -345,3 +349,3 @@ ... | ||
```erb | ||
<%= render_component("CommentsApp") %> | ||
<%= react_component("CommentsApp") %> | ||
``` | ||
@@ -351,3 +355,3 @@ | ||
```erb | ||
<%= render_component("BlogsApp") %> | ||
<%= react_component("BlogsApp") %> | ||
``` | ||
@@ -372,3 +376,3 @@ | ||
#### Bootstrap via Webpack Dev Server | ||
#### Bootstrap via Webpack HMR Dev Server | ||
When using the webpack dev server, which does not go through Rails, bootstrap is loaded via the [bootstrap-sass-loader](https://github.com/shakacode/bootstrap-sass-loader) which uses the `client/bootstrap-sass-config.js` file. | ||
@@ -451,3 +455,3 @@ | ||
## Additional Reading | ||
+ [The React on Rails Doctrine](http://www.shakacode.com/2016/01/26/the-react-on-rails-doctrine.html) | ||
+ [The React on Rails Doctrine](http://www.shakacode.com/2016/01/27/the-react-on-rails-doctrine.html) | ||
+ [Babel](docs/additional_reading/babel.md) | ||
@@ -454,0 +458,0 @@ + [Generated Client Code](docs/additional_reading/generated_client_code.md) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76897
670
496