Comparing version 2.6.0 to 2.6.1
@@ -11,2 +11,22 @@ # react-rails | ||
## 2.6.1 | ||
#### Breaking Changes | ||
#### New Features | ||
- React 16.9.0 | ||
- Sprockets users get React_UJS 2.6.1 | ||
#### Deprecation | ||
- Removed tests for Rails 3, 4, 5.0 | ||
- Removed tests for Sprockets 2 | ||
- Removed tests for Webpacker 1.1, 2 | ||
#### Bug Fixes | ||
- React_UJS 2.6.1 still complies with ES5 #1027 #1026 #1016 | ||
- Support RubyGems pattern for Alpha releases when detecting sprockets version #1047 | ||
## 2.6.0 | ||
@@ -13,0 +33,0 @@ |
{ | ||
"name": "react_ujs", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "Rails UJS for the react-rails gem", | ||
@@ -5,0 +5,0 @@ "main": "react_ujs/index.js", |
@@ -324,3 +324,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
} else { | ||
let component = this.components[cacheId]; | ||
var component = this.components[cacheId]; | ||
if(component === undefined) { | ||
@@ -444,3 +444,3 @@ component = React.createElement(constructor, props); | ||
ujs.handleEvent('turbolinks:load', ujs.handleMount); | ||
ujs.handleEvent('turbolinks:before-render', ujs.handleMount); | ||
ujs.handleEvent('turbolinks:before-render', ujs.handleUnmount); | ||
}, | ||
@@ -450,3 +450,3 @@ | ||
ujs.removeEvent('turbolinks:load', ujs.handleMount); | ||
ujs.removeEvent('turbolinks:before-render', ujs.handleMount); | ||
ujs.removeEvent('turbolinks:before-render', ujs.handleUnmount); | ||
}, | ||
@@ -453,0 +453,0 @@ } |
@@ -106,3 +106,3 @@ var React = require("react") | ||
} else { | ||
let component = this.components[cacheId]; | ||
var component = this.components[cacheId]; | ||
if(component === undefined) { | ||
@@ -109,0 +109,0 @@ component = React.createElement(constructor, props); |
@@ -5,3 +5,3 @@ module.exports = { | ||
ujs.handleEvent('turbolinks:load', ujs.handleMount); | ||
ujs.handleEvent('turbolinks:before-render', ujs.handleMount); | ||
ujs.handleEvent('turbolinks:before-render', ujs.handleUnmount); | ||
}, | ||
@@ -11,4 +11,4 @@ | ||
ujs.removeEvent('turbolinks:load', ujs.handleMount); | ||
ujs.removeEvent('turbolinks:before-render', ujs.handleMount); | ||
ujs.removeEvent('turbolinks:before-render', ujs.handleUnmount); | ||
}, | ||
} |
@@ -77,4 +77,15 @@ # React-Rails | ||
##### 3) Now run the installers: | ||
###### Rails 6.x: | ||
``` | ||
$ bundle install | ||
$ rails webpacker:install | ||
$ rails webpacker:install:react | ||
$ rails generate react:install | ||
``` | ||
Note: For Rails 6, You don't need to add `javascript_pack_tag` as in Step 4. Since its already added by default. | ||
###### Rails 5.x: | ||
``` | ||
$ bundle install | ||
$ rails webpacker:install # OR (on rails version < 5.0) rake webpacker:install | ||
@@ -662,3 +673,3 @@ $ rails webpacker:install:react # OR (on rails version < 5.0) rake webpacker:install:react | ||
ExecJS::ProgramError (identifier 'Set' undefined): | ||
(execjs):1 | ||
@@ -675,6 +686,8 @@ ``` | ||
### HMR | ||
HMR is possible with this gem as it does just pass through to Webpacker. Please open an issue to let us know tips and tricks for it to add to the wiki. | ||
Hot Module Replacement is [possible with this gem](https://stackoverflow.com/a/54846330/193785) as it does just pass through to Webpacker. Please open an issue to let us know tips and tricks for it to add to the wiki. | ||
One example: [Stack Overflow answer with Babel and Webpacker config](https://stackoverflow.com/a/54846330/193785) | ||
Sample repo that shows HMR working with `react-rails`: [https://github.com/edelgado/react-rails-hmr](https://github.com/edelgado/react-rails-hmr) | ||
One caveat is that currently you [cannot Server-Side Render along with HMR](https://github.com/reactjs/react-rails/issues/925#issuecomment-415469572). | ||
## Related Projects | ||
@@ -681,0 +694,0 @@ |
81771
710