react-rails 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/assets/javascripts/react_ujs.js +5 -1
- data/lib/react/rails/component_mount.rb +1 -0
- data/lib/react/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 871c8935efe49325b78955b744dd749664078a23
|
4
|
+
data.tar.gz: 5c14ae74ab1c66edf2eafb95b7d7427a7c7f1b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4928107a478a44c2afa03db3a71e3eb2fb0888d0835f047b254c93fc63e7236021f6ee1392041a1cd5632d8922bf30f1d10e25ff9d3a68bd9b8c83d4ce3201ff
|
7
|
+
data.tar.gz: 1a49da7b4ccfe06517e37bbf520233a51eb528351bca4ace5abbadead5e918c4ee2e6b18cf4c6d7f82d58f4f64d641bddfdf1e91abd4cce375b9382a6afdf100
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# react-rails
|
2
2
|
|
3
|
+
#### Breaking Changes
|
4
|
+
|
5
|
+
#### New Features
|
6
|
+
|
7
|
+
#### Deprecation
|
8
|
+
|
9
|
+
#### Bug Fixes
|
10
|
+
|
11
|
+
## 2.4.3
|
12
|
+
#### Bug Fixes
|
13
|
+
- Call ReactDOM.render() when react_component :prerender option is falsy, instead of ReactDOM.hydrate() #844, #842
|
14
|
+
|
3
15
|
## 2.4.2
|
4
16
|
#### Bug Fixes
|
5
17
|
- ReactDOM.hydrate() may not be defined for everyone, it will now use hydrate if it is defined or fallback to render #832
|
@@ -240,6 +240,9 @@ var ReactRailsUJS = {
|
|
240
240
|
// example: `data-react-props="{\"item\": { \"id\": 1, \"name\": \"My Item\"} }"`
|
241
241
|
PROPS_ATTR: 'data-react-props',
|
242
242
|
|
243
|
+
// This attribute holds which method to use between: ReactDOM.hydrate, ReactDOM.render
|
244
|
+
RENDER_ATTR: 'data-hydrate',
|
245
|
+
|
243
246
|
// If jQuery is detected, save a reference to it for event handlers
|
244
247
|
jQuery: (typeof window !== 'undefined') && (typeof window.jQuery !== 'undefined') && window.jQuery,
|
245
248
|
|
@@ -307,6 +310,7 @@ var ReactRailsUJS = {
|
|
307
310
|
var constructor = ujs.getConstructor(className);
|
308
311
|
var propsJson = node.getAttribute(ujs.PROPS_ATTR);
|
309
312
|
var props = propsJson && JSON.parse(propsJson);
|
313
|
+
var hydrate = node.getAttribute(ujs.RENDER_ATTR);
|
310
314
|
|
311
315
|
if (!constructor) {
|
312
316
|
var message = "Cannot find component: '" + className + "'"
|
@@ -315,7 +319,7 @@ var ReactRailsUJS = {
|
|
315
319
|
}
|
316
320
|
throw new Error(message + ". Make sure your component is available to render.")
|
317
321
|
} else {
|
318
|
-
if (typeof ReactDOM.hydrate === "function") {
|
322
|
+
if (hydrate && typeof ReactDOM.hydrate === "function") {
|
319
323
|
ReactDOM.hydrate(React.createElement(constructor, props), node);
|
320
324
|
} else {
|
321
325
|
ReactDOM.render(React.createElement(constructor, props), node);
|
data/lib/react/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul O’Shannessy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-11-
|
13
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appraisal
|