react_on_rails 12.0.3.beta.0 → 12.0.3

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f71a30ded8cae1a38bfc7f419bbd39eed35d83e365eab74c148102f23e6d083
4
- data.tar.gz: 70f4b3c869c3810804c7d01996699a1c7a6c145fca3cc35b7add4e0984c5bbce
3
+ metadata.gz: 7ca3650879f76d12748c0bb421da2d776fec62e7599e23552de09b21d19e8bff
4
+ data.tar.gz: b1e30785a72bc83dd0671ddcb26f768bacfc2cb2ccc9293e93be36286848d281
5
5
  SHA512:
6
- metadata.gz: 3849a1ebf62f6d81625c3c23e48dc1928990eecd4acc3d44c005e2d09859d39e86dd4c9a3c35b3db4da70ee8588e406c98d6396f8157a3874c0a83d6629ae901
7
- data.tar.gz: 707c8b7a6fe991315b6d433324d4c4fef5a170f1b0b09241d9faee034bd8d82cb2551634a6a157d35af89640017030fccf4a283175118ec1e06f1b4299877389
6
+ metadata.gz: 1ee2dcd8f08ac5cb3a7980639673b06a38a6bd29aa9b0e3e7956a8e45a262b3ffd036fbea5d387be8f025a96cb2f8af2592bbb08b4a34edb6114df4554a7d74d
7
+ data.tar.gz: 1a21c1642097dc08f081b75e1dd9542128227a3464c76b4188e1e7e1471466a0273ef72151ca662272b08be7bec254085e7d6eb8287059baa60c6303b138f1cb
@@ -17,7 +17,7 @@ Changes since last non-beta release.
17
17
 
18
18
  *Please add entries here for your pull requests that are not yet released.*
19
19
 
20
- ### [12.0.3] - 2020-09-02
20
+ ### [12.0.3] - 2020-09-20
21
21
  #### Fixed
22
22
  - Async script loading optimizes page load speed. With this fix, a bundle
23
23
  can be loaded "async" and a handler function can determine when to hydrate.
@@ -34,8 +34,28 @@ Registered Objects are of the following type:
34
34
  1. **Function that takes only zero or one params and you return a React Element**, often JSX. If the function takes zero or one params, there is **no migration needed** for that function.
35
35
  ```js
36
36
  export default (props) => <Component {...props} />;
37
- ```
38
- 2. Function that takes **2 params** and returns **a React function or class component**. _Migration is needed as the older syntax returned a React Element._
37
+ ```
38
+
39
+ 2. **Function that takes only zero or one params and you return an Object (_not a React Element_)**. If the function takes zero or one params, **you need to add one or two unused params so you have exactly 2 params** and then that function will be treated as a render function and it can return an Object rather than a React element. If you don't do this, you'll see this obscure error message:
40
+
41
+ ```
42
+ [SERVER] message: Objects are not valid as a React child (found: object with keys {renderedHtml}). If you meant to render a collection of children, use an array instead.
43
+ in YourComponentRenderFunction
44
+ ```
45
+
46
+ So look in YourComponentRenderFunction and do this change
47
+
48
+ ```js
49
+ export default (props) => { renderedHTML: getRenderedHTML };
50
+ ```
51
+
52
+ To have exactly 2 arguments:
53
+
54
+ ```js
55
+ export default (props, _railsContext) => { renderedHTML: getRenderedHTML };
56
+ ```
57
+
58
+ 3. Function that takes **2 params** and returns **a React function or class component**. _Migration is needed as the older syntax returned a React Element._
39
59
  A function component is a function that takes zero or one params and returns a React Element, like JSX. The correct syntax
40
60
  looks like:
41
61
  ```js
@@ -43,8 +63,8 @@ Registered Objects are of the following type:
43
63
  ```
44
64
  Note, you cannot return a React Element (JSX). See below for the migration steps. If your function that took **two params returned
45
65
  an Object**, then no migration is required.
46
- 3. Function that takes **3 params** and uses the 3rd param, `domNodeId`, to call `ReactDOM.hydrate`. If the function takes 3 params, there is **no migration needed** for that function.
47
- 4. ES6 or ES5 class. There is **no migration needed**.
66
+ 4. Function that takes **3 params** and uses the 3rd param, `domNodeId`, to call `ReactDOM.hydrate`. If the function takes 3 params, there is **no migration needed** for that function.
67
+ 5. ES6 or ES5 class. There is **no migration needed**.
48
68
 
49
69
  Previously, with case number 2, you could return a React Element.
50
70
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "12.0.3.beta.0"
4
+ VERSION = "12.0.3"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "12.0.3-beta.0",
3
+ "version": "12.0.3",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.3.beta.0
4
+ version: 12.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-03 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -508,9 +508,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
508
508
  version: 2.5.0
509
509
  required_rubygems_version: !ruby/object:Gem::Requirement
510
510
  requirements:
511
- - - ">"
511
+ - - ">="
512
512
  - !ruby/object:Gem::Version
513
- version: 1.3.1
513
+ version: '0'
514
514
  requirements: []
515
515
  rubygems_version: 3.0.8
516
516
  signing_key: