react_on_rails 12.0.0 → 12.0.1

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: 2c578e181f0adc62b6f89f1e258bf21dd515bf2f86b57034467f6026ba2bf63c
4
- data.tar.gz: e3a8a7076f7c73871178114a077ec29850e6639340e8ff331d046fb491ac10e8
3
+ metadata.gz: 83e519532dfba4ffcb23379c8d757d4d299aaa11247c718e310e257e3bca3291
4
+ data.tar.gz: d328b53abce54b4deb4481addaaef242b6b531c493aa3154784fa8f87f55e7c0
5
5
  SHA512:
6
- metadata.gz: 19cebcb75b776a5f08936cc39aef164089a6ccc3ea36d792cc6fb7f0e53805e535eeb71f295826e371f74b75312d326172d26e1dc97cc640651914c5b222cfa1
7
- data.tar.gz: 67dec37920284002de78660438c0f38f463a5317bbd7c7a17d2896fa4d4d7ff0044e11705ad247a7f1d3f2eb2abf90f8fd3115dc0ac496926701beb74236043c
6
+ metadata.gz: e183bc2eaed29538422fbe0984177f9e64dcb7501d96f971e1a1887aae596e9fe2519d78d44c6517af07abe2db44632ba38879e070966641b1faac5e6e984e08
7
+ data.tar.gz: 6ab4afd6786b2539428dffcbad518dd0e3cd1111a61d0b81891a715d665e5c7e6d4053d3e344d770808422abb720c07259bd537f6bfe1b5a59f0e0127e96b2ac
@@ -10,6 +10,7 @@ AllCops:
10
10
  - '**/config.ru'
11
11
  - 'Gemfile'
12
12
  - '**/*.rb'
13
+ - '**/*.rake'
13
14
 
14
15
  Exclude:
15
16
  - 'vendor/**/*'
@@ -35,15 +35,17 @@ before_install:
35
35
 
36
36
  install:
37
37
  - travis_retry gem install bundler -v '>2'
38
- - travis_retry nvm install 13.9.0
38
+ - travis_retry nvm install 14
39
39
  - node -v
40
40
  - travis_retry npm i -g yarn
41
- - travis_retry bundle install
42
41
  - travis_retry yarn global add yalc
42
+ - travis_retry yarn
43
+ - travis_retry bundle install
44
+ - travis_retry yarn run build
43
45
  - travis_retry yalc publish
44
- - travis_retry cd spec/dummy && yalc add react-on-rails
46
+ - cd spec/dummy/client
47
+ - travis_retry yalc add react-on-rails
45
48
  - travis_retry yarn
46
- - travis_retry cd ../.. && yarn run build
47
49
  - bundle exec rake prepare_for_ci
48
50
 
49
51
  before_script:
@@ -11,22 +11,23 @@ We specialize in helping companies to quickly and efficiently move from versions
11
11
  ## Contributors
12
12
  Please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
13
13
 
14
- ## [Unreleased]
14
+ ## Versions
15
+ ### [Unreleased]
15
16
  Changes since last non-beta release.
16
17
 
17
18
  *Please add entries here for your pull requests that are not yet released.*
19
+ ### [12.0.1] - 2020-07-09
20
+ #### Fixed
21
+ - Changed invocation of webpacker:clean to use a very large number of versions so it does not acidentally delete the server-bundle.js. [PR 1306](https://github.com/shakacode/react_on_rails/pull/1306) by By [justin808](https://github.com/justin808).
18
22
 
19
- ## UPCOMING 12.0 RELEASE
20
- See [docs/basics/upgrading-react-on-rails.md](./docs/basics/upgrading-react-on-rails.md).
21
-
22
- ### [12.0.0.pre.beta.2]
23
- * Changed the precompile task to use the rails/webpacker one by default
24
-
25
- ### [12.0.0.pre.beta.1]
26
- * Updated generators to use React hooks
23
+ ### [12.0.0] - 2020-07-08
24
+ For upgrade instructions, see [docs/basics/upgrading-react-on-rails.md](./docs/basics/upgrading-react-on-rails.md).
27
25
 
28
- ### [12.0.0.pre.beta.0]
29
- Gem version: 12.0.0.pre.beta.0 and npm version 12.0.0-beta.0 released! Please try this out!
26
+ #### Major Improvements
27
+ 1. **React Hooks Support** for top level components
28
+ 2. **Typescript bindings**
29
+ 3. **rails/webpacker** "just works" with React on Rails by default.
30
+ 4. i18n support for generating a JSON file rather than a JS file.
30
31
 
31
32
  #### BREAKING CHANGE
32
33
  In order to solve the issues regarding React Hooks compatibility, the number of parameters
@@ -39,10 +40,14 @@ invoked to return the React component. In that case, you won't need to pass any
39
40
  See [docs/basics/upgrading-react-on-rails](./docs/basics/upgrading-react-on-rails.md#upgrading-to-v12)
40
41
  for details.
41
42
 
42
- * Requires the use of rails/webpacker helpers
43
+ #### Other Updates
44
+ * `react_on_rails` fully supports `rails/webpacker`. The example test app in `spec/dummy` was recently converted over to use rails/webpacker v4+. It's a good example of how to leverage rails/webpacker's webpack configuration for server-side rendering.
45
+ * Changed the precompile task to use the rails/webpacker one by default
46
+ * Updated generators to use React hooks
47
+ * Requires the use of rails/webpacker view helpers
43
48
  * If the webpacker webpack config files exist, then React on Rails will not override the default
44
- assets:precompile setup by rails/webpacker. The fix is to remove the JS files inside of config/webpack,
45
- like config/webpack/production.js.
49
+ assets:precompile setup by rails/webpacker. If you are not using the rails/webpacker setup for webpack,
50
+ then be sure to remove the JS files inside of config/webpack, like `config/webpack/production.js.`
46
51
  * Removed **env_javascript_include_tag** and **env_stylesheet_link_tag** as these are replaced by view helpers
47
52
  from rails/webpacker
48
53
  * Removal of support for old Rubies and Rails.
@@ -62,13 +67,12 @@ for details.
62
67
  * Added support to export locales in JSON format. New option added `i18n_output_format` which allows to
63
68
  specify locales format either `JSON` or `JS`. **`JSON` format is now the default.**
64
69
 
65
- Use this config setting to get the old behavior: config.i18n_output_format = 'js'
70
+ **Use this config setting to get the old behavior: config.i18n_output_format = 'js'**
66
71
 
67
72
  [PR 1271](https://github.com/shakacode/react_on_rails/pull/1271) by [ashgaliyev](https://github.com/ashgaliyev).
68
73
 
69
- #### Improved
70
74
  - Added Typescript definitions to the Node package. By [justin808](https://github.com/justin808) and [judahmeek](https://github.com/judahmeek) in [PR 1287](https://github.com/shakacode/react_on_rails/pull/1287).
71
- - Removed unnecessary restriction to keep the server bundle in the same directory with the client bundles. Rails/webpacker 4 has an advanced cleanup that will remove any files in the directory of other webpack files. Removing this restriction allows the server bundle to be created in a sibling directory. By [justin808](https://github.com/shakacode/react_on_rails/pull/1240).
75
+ - Removed restriction to keep the server bundle in the same directory with the client bundles. Rails/webpacker 4 has an advanced cleanup that will remove any files in the directory of other webpack files. Removing this restriction allows the server bundle to be created in a sibling directory. By [justin808](https://github.com/shakacode/react_on_rails/pull/1240).
72
76
 
73
77
  ### [11.3.0] - 2019-05-24
74
78
  #### Added
@@ -926,11 +930,9 @@ Best done with Object destructing:
926
930
  ##### Fixed
927
931
  - Fix several generator related issues.
928
932
 
929
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.0-beta.3...master
930
- [12.0.0.pre.beta.3]: https://github.com/shakacode/react_on_rails/compare/12.0.0-beta.2...12.0.0-beta.3
931
- [12.0.0.pre.beta.2]: https://github.com/shakacode/react_on_rails/compare/12.0.0-beta.1...12.0.0-beta.2
932
- [12.0.0.pre.beta.1]: https://github.com/shakacode/react_on_rails/compare/12.0.0-beta.0...12.0.0-beta.1
933
- [12.0.0.pre.beta.0]: https://github.com/shakacode/react_on_rails/compare/11.3.0...12.0.0-beta.0
933
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.1...master
934
+ [12.0.1]: https://github.com/shakacode/react_on_rails/compare/12.0.0...12.0.1
935
+ [12.0.0]: https://github.com/shakacode/react_on_rails/compare/11.3.0...12.0.0
934
936
  [11.3.0]: https://github.com/shakacode/react_on_rails/compare/11.2.2...11.3.0
935
937
  [11.2.2]: https://github.com/shakacode/react_on_rails/compare/11.2.1...11.2.2
936
938
  [11.2.1]: https://github.com/shakacode/react_on_rails/compare/11.1.8...11.2.1
data/README.md CHANGED
@@ -11,35 +11,37 @@
11
11
 
12
12
  [![License](https://img.shields.io/badge/license-mit-green.svg)](./LICENSE.md) [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/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) [![Code Climate](https://codeclimate.com/github/shakacode/react_on_rails/badges/gpa.svg)](https://codeclimate.com/github/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) [![](https://ruby-gem-downloads-badge.herokuapp.com/react_on_rails?type=total)](https://rubygems.org/gems/react_on_rails)
13
13
 
14
- *These are the docs for React on Rails 12, coming soon. To see the version 11 docs, [click here](https://github.com/shakacode/react_on_rails/tree/11.3.0).*
14
+ *These are the docs for React on Rails 12. To see the version 11 docs, [click here](https://github.com/shakacode/react_on_rails/tree/11.3.0).*
15
15
 
16
16
  #### News
17
- **June 24, 2020**:
18
- 1. Gem version: 12.0.0.pre.beta.3 and npm version 12.0.0-beta.3 released! Please try this out!
19
- Major enhancements:
20
- 1. Proper support for React Hooks
21
- 2. Typescript bindings
22
- 3. i18n support for generating a JSON file rather than a JS file.
23
- 4. Tighter rails/webpacker integration
17
+ **July 8, 2020**: Release v12 of React on Rails.
18
+
19
+ **Major Improvements**
20
+
21
+ 1. **React Hooks Support** for top level components
22
+ 2. **Typescript bindings**
23
+ 3. **rails/webpacker** "just works" with React on Rails by default.
24
+ 4. i18n support for generating a JSON file rather than a JS file.
24
25
 
25
- Be sure to see the [CHANGELOG.md](./CHANGELOG.md) and read the upgrade instructions:
26
- [docs/basics/upgrading-react-on-rails](./docs/basics/upgrading-react-on-rails.md#upgrading-to-v12).
26
+ Be sure to see the [CHANGELOG.md](./CHANGELOG.md) and read the upgrade instructions:
27
+ [docs/basics/upgrading-react-on-rails](./docs/basics/upgrading-react-on-rails.md#upgrading-to-v12).
27
28
 
28
- 2. See Justin's RailsConf talk: [Webpacker, It-Just-Works, But How?](http://railsconf.com/2020/video/justin-gordon-webpacker-it-just-works-but-how).
29
-
30
- **April 2, 2020**:
29
+ * See Justin's RailsConf talk: [Webpacker, It-Just-Works, But How?](http://railsconf.com/2020/video/justin-gordon-webpacker-it-just-works-but-how).
31
30
  * Are you interested in support for React on Rails? If so check out [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro).
32
31
  * HMR is working with [Loadable Components](https://loadable-components.com) for a both amazing hot-reloading developer experience and great runtime performance. Please [email me](mailto:justin@shakacode.com) if you'd like to use [Loadable Components Code Splitting](https://loadable-components.com/docs/code-splitting/) to speed up your app by reducing your bundle sizes and lazily loading the code that's needed.
33
- * `react_on_rails` fully supports `rails/webpacker`. The example test app in `spec/dummy` was recently converted over to use rails/webpacker v4. It's a good example of how to leverage rails/webpacker's webpack configuration.
32
+ * `react_on_rails` fully supports `rails/webpacker`. The example test app in `spec/dummy` was recently converted over to use rails/webpacker v4+. It's a good example of how to leverage rails/webpacker's webpack configuration.
34
33
 
35
34
  ---
36
35
 
37
36
  #### About
38
37
  React on Rails integrates Rails with (server rendering of) Facebook's [React](https://github.com/facebook/react) front-end framework.
39
38
 
40
- This project is sponsored by the software consulting firm [ShakaCode](https://www.shakacode.com). We focus on React front-ends, often with Ruby on Rails or Gatsby. The best way to see what we do is to see the details of [our recent work](https://www.shakacode.com/recent-work).
39
+ This project is sponsored by the software consulting firm [ShakaCode](https://www.shakacode.com). We focus on React front-ends, often with Ruby on Rails or Gatsby, using TypeScript or ReasonML. The best way to see what we do is to see the details of [our recent work](https://www.shakacode.com/recent-work).
41
40
 
42
- Interested in optimizing your webpack setup for React on Rails including code splitting with react-router v4, webpack v4, and react-loadable with server side rendering? We just did this for Popmenu, [lowering Heroku costs 20-25% while getting a 73% decrease in average response times](https://www.shakacode.com/recent-work/popmenu/).
41
+ Interested in optimizing your webpack setup for React on Rails including code
42
+ splitting with [react-router](https://github.com/ReactTraining/react-router#readme),
43
+ and [loadable-components](https://loadable-components.com/) with server-side rendering?
44
+ We just did this for Popmenu, [lowering Heroku costs 20-25% while getting a 73% decrease in average response times](https://www.shakacode.com/recent-work/popmenu/).
43
45
 
44
46
  Feel free to contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com), maintainer of React on Rails, for more information.
45
47
 
@@ -49,16 +51,16 @@ Feel free to contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakaco
49
51
 
50
52
  ## Project Objective
51
53
 
52
- To provide a high performance framework for integrating Ruby on Rails with React via the [**Webpacker**](https://github.com/rails/webpacker) gem especially in regards to React Server Rendering.
54
+ To provide a high performance framework for integrating Ruby on Rails with React via the [**Webpacker**](https://github.com/rails/webpacker) gem especially in regards to React Server-Side Rendering for better SEO and improved performance.
53
55
 
54
56
  ## Features and Why React on Rails?
55
57
 
56
- Given that rails/webpacker gem already provides basic React integration, why would you use "React on Rails"?
58
+ Given that `rails/webpacker` gem already provides basic React integration, why would you use "React on Rails"?
57
59
 
58
- 1. The easy passing of props directly from your Rails view to your React components rather than having your Rails view load and then make a separate request to your API.
60
+ 1. Easy passing of props directly from your Rails view to your React components rather than having your Rails view load and then make a separate request to your API.
59
61
  1. Tight integration with [rails/webpacker](https://github.com/rails/webpacker).
60
- 1. Server rendering, often used for SEO crawler indexing and UX performance, is not offered by rails/webpacker.
61
- 1. [Redux](https://github.com/reactjs/redux) and [React Router](https://github.com/reactjs/react-router) integration with server-side-rendering.
62
+ 1. Server-Side Rendering (SSR), often used for SEO crawler indexing and UX performance, is not offered by `rails/webpacker`.
63
+ 1. [Redux](https://github.com/reactjs/redux) and [React Router](https://github.com/ReactTraining/react-router#readme) integration with server-side-rendering.
62
64
  1. [Internationalization (I18n) and (localization)](https://github.com/shakacode/react_on_rails/blob/master/docs/basics/i18n.md)
63
65
  1. A supportive community. This [web search shows how live public sites are using React on Rails](https://publicwww.com/websites/%22react-on-rails%22++-undeveloped.com/).
64
66
  1. [Reason ML Support](https://github.com/shakacode/reason-react-on-rails-example).
@@ -141,7 +143,7 @@ issue.
141
143
  * Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See file [docs/basics/configuration.md](docs/basics/configuration.md) for documentation of all configuration options.
142
144
  * Configure `config/webpacker.yml`. If you used the generator and the default webpacker setup, you don't need to touch this file. If you are customizing your setup, then consult the [spec/dummy/config/webpacker.yml](./spec/dummy/config/webpacker.yml) example or the official default [webpacker.yml](https://github.com/rails/webpacker/blob/master/lib/install/config/webpacker.yml).
143
145
  * Tip: set `compile: false` for development if you know that you'll always be compiling with a watch process. Otherwise, every request will check if compilation is needed.
144
- * Your `public_output_path` must match your Webpack configuration for `output` of your bundles.
146
+ * Your `public_output_path` must match your custom Webpack configuration for `output` of your bundles.
145
147
  * Only set `cache_manifest` to `true` in your production env.
146
148
 
147
149
  ## Including your React Component on your Rails Views
@@ -166,7 +168,7 @@ issue.
166
168
  ReactOnRails.register({ HelloWorld });
167
169
  ```
168
170
 
169
- Exposing your component in this way is how React on Rails is able to reference your component from a Rails view. You can expose as many components as you like, as long as their names do not collide. See below for the details of how you expose your components via the react_on_rails webpack configuration.
171
+ Exposing your component in this way is how React on Rails is able to reference your component from a Rails view. You can expose as many components as you like, as long as their names do not collide. See below for the details of how you expose your components via the react_on_rails webpack configuration. You may call `ReactOnRails.register` many times.
170
172
 
171
173
  - `@some_props` can be either a hash or JSON string. This is an optional argument assuming you do not need to pass any options (if you want to pass options, such as `prerender: true`, but you do not want to pass any properties, simply pass an empty hash `{}`). This will make the data available in your component:
172
174
 
@@ -175,7 +177,7 @@ issue.
175
177
  <%= react_component("HelloWorld", props: { name: "Stranger" }) %>
176
178
  ```
177
179
 
178
- - This is what your HelloWorld.js file might contain. The railsContext is always available for any parameters that you _always_ want available for your React components. It has _nothing_ to do with the concept of the [React Context](https://reactjs.org/docs/context.html). See [render functions and the RailsContext](docs/basics/render-functions-and-railscontext.md) for more details on this topic.
180
+ - This is what your HelloWorld.js file might contain. The railsContext is always available for any parameters that you _always_ want available for your React components. It has _nothing_ to do with the concept of the [React Context](https://reactjs.org/docs/context.html). See [Render-Functions and the RailsContext](docs/basics/render-functions-and-railscontext.md) for more details on this topic.
179
181
 
180
182
  ```js
181
183
  import React from 'react';
@@ -193,32 +195,6 @@ issue.
193
195
 
194
196
  See the [View Helpers API](./docs/api/view-helpers-api.md) for more details on `react_component` and its sibling function `react_component_hash`.
195
197
 
196
- ## Fragment Caching
197
-
198
- Fragment caching is a [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro) feature. Fragment caching is a **HUGE** performance booster for your apps. Use the `cached_react_component` and `cached_react_component_hash`. The API is the same as `react_component` and `react_component_hash`, but for 2 differences:
199
-
200
- 1. The `cache_key` takes the same parameters as any Rails `cache` view helper.
201
- 1. The **props** are passed via a block so that evaluation of the props is not done unless the cache is broken. Suppose you put your props calculation into some method called `some_slow_method_that_returns_props`:
202
-
203
- ```ruby
204
- <%= cached_react_component("App", cache_key: [@user, @post], prerender: true) do
205
- some_slow_method_that_returns_props
206
- end %>
207
- ```
208
-
209
- Such fragment caching saves a ton of CPU work for your web server and greatly reduces the request time. It completely skips the evaluation costs of:
210
-
211
- 1. Database calls to compute the props.
212
- 2. Serialization the props values hash into a JSON string for evaluating JavaScript to server render.
213
- 3. Costs associated with evaluating JavaScript from your Ruby code.
214
- 4. Creating the HTML string containing the props and the server-rendered JavaScript code.
215
-
216
- Note, even without server rendering (without step 3 above), fragment caching is still effective.
217
-
218
- ## Integration with Node.js for Server Rendering
219
-
220
- Default server rendering is done by ExecJS. If you want to use a Node.js server for better performing server rendering, [email justin@shakacode.com](mailto:justin@shakacode.com). ShakaCode has built a premium Node rendering server that is part of [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro).
221
-
222
198
  ## Globally Exposing Your React Components
223
199
 
224
200
  For the React on Rails view helper `react_component` to use your React components, you will have to **register** them in your JavaScript code.
@@ -246,15 +222,15 @@ For details on techniques to use different code for client and server rendering,
246
222
 
247
223
  You have two ways to specify your React components. You can either register the React component (either function or class component) directly, or you can create a function that returns a React component, which we using the name of a "render-function". Creating a render-function allows:
248
224
 
249
- 1. You have access to the `railsContext`. See documentation for the railsContext in terms of why you might need it. You **need** a render function to access the `railsContext`.
225
+ 1. You to have access to the `railsContext`. See [documentation for the railsContext](./docs/basics/render-functions-and-railscontext.md) in terms of why you might need it. You **need** a Render-Function to access the `railsContext`.
250
226
  2. You can use the passed-in props to initialize a redux store or set up react-router.
251
227
  3. You can return different components depending on what's in the props.
252
228
 
253
- Note, the return value of a **render function** should be either a React Function or Class Component, or an object representing server rendering results.
229
+ Note, the return value of a **Render-Function** should be either a React Function or Class Component, or an object representing server rendering results.
254
230
 
255
231
  Do not return a React Element (JSX).
256
232
 
257
- ReactOnRails will automatically detect a registered render function by the fact that the function takes
233
+ ReactOnRails will automatically detect a registered Render-Function by the fact that the function takes
258
234
  more than 1 parameter. In other words, if you want the ability to provide a function that returns the
259
235
  React component, then you need to specify at least a second parameter. This is the `railsContext`.
260
236
  If you're not using this parameter, declare your function with the unused param:
@@ -268,13 +244,13 @@ const MyComponentGenerator = (props, _railsContext) => {
268
244
  }
269
245
  ```
270
246
 
271
- Thus, there is no difference between registering a React function or class Component versus a "render function."
247
+ Thus, there is no difference between registering a React Function Component or class Component versus a "Render-Function." Just call `ReactOnRails.register`.
272
248
 
273
- ## react_component_hash for render functions
249
+ ## react_component_hash for Render-Functions
274
250
 
275
- Another reason to use a render function is that sometimes in server rendering, specifically with React Router, you need to return the result of calling ReactDOMServer.renderToString(element). You can do this by returning an object with the following shape: { renderedHtml, redirectLocation, error }. Make sure you use this function with `react_component_hash`.
251
+ Another reason to use a Render-Function is that sometimes in server rendering, specifically with React Router, you need to return the result of calling ReactDOMServer.renderToString(element). You can do this by returning an object with the following shape: { renderedHtml, redirectLocation, error }. Make sure you use this function with `react_component_hash`.
276
252
 
277
- For server rendering, if you wish to return multiple HTML strings from a render function, you may return an Object from your render function with a single top-level property of `renderedHtml`. Inside this Object, place a key called `componentHtml`, along with any other needed keys. An example scenario of this is when you are using side effects libraries like [React Helmet](https://github.com/nfl/react-helmet). Your Ruby code will get this Object as a Hash containing keys componentHtml and any other custom keys that you added:
253
+ For server rendering, if you wish to return multiple HTML strings from a Render-Function, you may return an Object from your Render-Function with a single top-level property of `renderedHtml`. Inside this Object, place a key called `componentHtml`, along with any other needed keys. An example scenario of this is when you are using side effects libraries like [React Helmet](https://github.com/nfl/react-helmet). Your Ruby code will get this Object as a Hash containing keys componentHtml and any other custom keys that you added:
278
254
 
279
255
  ```js
280
256
  { renderedHtml: { componentHtml, customKey1, customKey2} }
@@ -336,16 +312,42 @@ React on Rails Pro provides Node server rendering, fragment caching, code-splitt
336
312
 
337
313
  The [React on Rails Pro Support Plan](https://www.shakacode.com/react-on-rails-pro) can help!
338
314
 
339
- * Optimizing your webpack setup to Webpack v4 for React on Rails including code splitting with react-router v4, webpack v4, and react-loadable.
340
- * Upgrading your app to use the current Webpack setup that skips the Sprockets asset pipeline.
315
+ * Optimizing your webpack setup to the latest Webpack for React on Rails including code splitting with loadable-components.
316
+ * Upgrading your app to use the current `rails/webpacker` setup that skips the Sprockets asset pipeline.
341
317
  * Better performance client and server side.
342
- * Best practices based on over four years of React on Rails experience.
318
+ * Best practices based on over 6 years of React on Rails experience on many production projects.
343
319
  * Using [Reason](https://reasonml.github.io/) with (or without) React on Rails.
344
320
 
345
- ShakaCode can also help you with your custom software development needs. We specialize in marketplace and e-commerce applications that utilize both Rails and React. Because we own [HawaiiChee.com](https://www.hawaiichee.com), we can leverage that code for your app!
321
+ ShakaCode can also help you with your custom software development needs. We specialize in marketplace and e-commerce applications that utilize both Rails and React. Because we own [HiChee.com](https://hichee.com), we can leverage that code for your app!
346
322
 
347
323
  Please email Justin Gordon [justin@shakacode.com](mailto:justin@shakacode.com), the maintainer of React on Rails, for more information.
348
324
 
325
+ ### Fragment Caching
326
+
327
+ Fragment caching is a [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro) feature. Fragment caching is a **HUGE** performance booster for your apps. Use the `cached_react_component` and `cached_react_component_hash`. The API is the same as `react_component` and `react_component_hash`, but for 2 differences:
328
+
329
+ 1. The `cache_key` takes the same parameters as any Rails `cache` view helper.
330
+ 1. The **props** are passed via a block so that evaluation of the props is not done unless the cache is broken. Suppose you put your props calculation into some method called `some_slow_method_that_returns_props`:
331
+
332
+ ```ruby
333
+ <%= cached_react_component("App", cache_key: [@user, @post], prerender: true) do
334
+ some_slow_method_that_returns_props
335
+ end %>
336
+ ```
337
+
338
+ Such fragment caching saves CPU work for your web server and greatly reduces the request time. It completely skips the evaluation costs of:
339
+
340
+ 1. Database calls to compute the props.
341
+ 2. Serialization the props values hash into a JSON string for evaluating JavaScript to server render.
342
+ 3. Costs associated with evaluating JavaScript from your Ruby code.
343
+ 4. Creating the HTML string containing the props and the server-rendered JavaScript code.
344
+
345
+ Note, even without server rendering (without step 3 above), fragment caching is still effective.
346
+
347
+ ## Integration with Node.js for Server Rendering
348
+
349
+ Default server rendering is done by ExecJS. If you want to use a Node.js server for better performing server rendering, [email justin@shakacode.com](mailto:justin@shakacode.com). ShakaCode has built a premium Node rendering server that is part of [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro).
350
+
349
351
  ## Testimonials for ShakaCode
350
352
  [HVMN Testimonial, by Paul Benigeri, October 12, 2018](./docs/testimonials/hvmn.md)
351
353
  > The price we paid for the consultation + the React on Rails pro license has already been made back a couple of times from hosting fees alone. The entire process was super hands off, and our core team was able to focus on shipping new feature during that sprint.
@@ -0,0 +1,10 @@
1
+ # Converting from Custom Webpack Config to Rails Webpacker Config
2
+
3
+ 1. Compare your package.json and the dependencies in https://github.com/rails/webpacker/blob/master/package.json#L14-L48
4
+ and avoid any duplicates. We don't want different versions of the same packages.
5
+ We want the versions from rails/webpacker unless we specifically want to override them.
6
+ 2. Search the rails/webpacker repo for anything you're not sure about in terms of package names.
7
+ 3. run `bin/webpack` and make sure there are zero errors
8
+ 4. update webpack plugins and loaders to current or close to current
9
+ 5. Make sure that your bin/webpack and bin/webpacker match the latest on
10
+ https://github.com/rails/webpacker/tree/master/lib/install/bin
@@ -39,7 +39,7 @@ For a fleshed out integration of react_on_rails with react-router, check out [Re
39
39
 
40
40
  # Server Rendering Using React Router V4
41
41
 
42
- Your render function may not return an object with the property `renderedHtml`. Thus, you call
42
+ Your Render-Function may not return an object with the property `renderedHtml`. Thus, you call
43
43
  renderToString() and return an object with this property.
44
44
 
45
45
  This example **only applies to server rendering** and should be only used in the server side bundle.
@@ -13,7 +13,7 @@ Be sure to use mini_racer. See [issues/428](https://github.com/shakacode/react_o
13
13
  - You can conditionally avoid running code that references document by either checking if `window`
14
14
  is defined or using the "railsContext"
15
15
  your top level react component. Since the passed in props Hash from the view helper applies to
16
- client and server side code, the best way to do this is to use a render function.
16
+ client and server side code, the best way to do this is to use a Render-Function.
17
17
  - If you're serious about server rendering, it's worth the effort to have different entry points for client and server rendering. It's worth the extra complexity. The point is that you have separate files for top level client or server side, and you pass some extra option indicating that rendering is happening server side.
18
18
  - You can enable Node.js server rendering via [React on Rails Pro](https://github.com/shakacode/react_on_rails/wiki).
19
19
 
@@ -22,6 +22,9 @@ Be sure to use mini_racer. See [issues/428](https://github.com/shakacode/react_o
22
22
  1. First be sure your code works with server rendering disabled (`prerender: false`)
23
23
  2. Be sure that `config.trace` is true. You will get the server invocation code that renders your component. If you're not using Webpacker, you will also get the whole file used to setup the JavaScript context.
24
24
 
25
+ ## CSS
26
+ Server bundles must always have CSS Extracted
27
+
25
28
  ## setTimeout, setInterval, and clearTimeout
26
29
 
27
30
  These methods are polyfilled for server rendering to be no-ops. We log calls to these when in `trace` mode. In the past, some libraries, namely babel-polyfill, did call setTimout.
@@ -25,10 +25,10 @@ The best source of docs is the main [ReactOnRails.js](https://github.com/shakaco
25
25
  /**
26
26
  * Main entry point to using the react-on-rails npm package. This is how Rails will be able to
27
27
  * find you components for rendering. Components get called with props, or you may use a
28
- * "render function" to return a React component or an object with the following shape:
28
+ * "Render-Function" to return a React component or an object with the following shape:
29
29
  * { renderedHtml, redirectLocation, error }.
30
- * For server rendering, if you wish to return multiple HTML strings from a render function,
31
- * you may return an Object from your render function with a single top level property of
30
+ * For server rendering, if you wish to return multiple HTML strings from a Render-Function,
31
+ * you may return an Object from your Render-Function with a single top level property of
32
32
  * renderedHtml. Inside this Object, place a key called componentHtml, along with any other
33
33
  * needed keys. This is useful when you using side effects libraries like react helmet.
34
34
  * Your Ruby code with get this Object as a Hash containing keys componentHtml and any other
@@ -1,10 +1,10 @@
1
1
  # Redux Store
2
2
 
3
- _This redux API is no longer recommended as it prevents dynamic code splitting for performance. Instead, you should use the standard react_component view helper passing in a "render function."_
3
+ _This redux API is no longer recommended as it prevents dynamic code splitting for performance. Instead, you should use the standard react_component view helper passing in a "Render-Function."_
4
4
 
5
5
  You don't need to use the `redux_store` api to use redux. This api was setup to support multiple calls to `react_component` on one page that all talk to the same redux store.
6
6
 
7
- If you are only rendering one react component on a page, as is typical to do a "Single Page App" in React, then you should _probably_ pass the props to your React component in a "render function."
7
+ If you are only rendering one react component on a page, as is typical to do a "Single Page App" in React, then you should _probably_ pass the props to your React component in a "Render-Function."
8
8
 
9
9
  Consider using the `redux_store` helper for the two following use cases:
10
10
 
@@ -22,7 +22,7 @@ Uncommonly used options:
22
22
  id: nil,
23
23
  ```
24
24
 
25
- - **component_name:** Can be a React component, created using an ES6 class or a render function that returns a React component (or, only on the server side, an object with shape { redirectLocation, error, renderedHtml }), or a "renderer function" that manually renders a React component to the dom (client side only).
25
+ - **component_name:** Can be a React component, created using a React Function Component, an ES6 class or a Render-Function that returns a React component (or, only on the server side, an object with shape { redirectLocation, error, renderedHtml }), or a "renderer function" that manually renders a React component to the dom (client side only). Note, a "renderer function" is a special type of "Render-Function." A "renderer function" takes a 3rd param of a DOM ID.
26
26
  All options except `props, id, html_options` will inherit from your `react_on_rails.rb` initializer, as described [here](../basics/configuration.md).
27
27
  - **general options:**
28
28
  - **props:** Ruby Hash which contains the properties to pass to the react object, or a JSON string. If you pass a string, we'll escape it for you.
@@ -45,7 +45,7 @@ adding meta-tags to a page. It is exactly like react_component except for the fo
45
45
 
46
46
  1. `prerender: true` is automatically added to options, as this method doesn't make sense for
47
47
  client only rendering.
48
- 2. Your JavaScript render function for server rendering must return an Object rather than a React Component.
48
+ 2. Your JavaScript Render-Function for server rendering must return an Object rather than a React Component.
49
49
  3. Your view code must expect an object and not a string.
50
50
 
51
51
  Here is an example of ERB view code:
@@ -98,11 +98,11 @@ You can call `rails_context` or `rails_context(server_side: true|false)` from yo
98
98
 
99
99
  ### Renderer Functions (function that will call ReactDOM.render or ReactDOM.hydrate)
100
100
 
101
- A "renderer function" is a render function that accepts three arguments (rather than 2): `(props, railsContext, domNodeId) => { ... }`. Instead of returning a React component, a renderer is responsible for installing a callback that will call `ReactDOM.render` (in React 16+, `ReactDOM.hydrate`) to render a React component into the DOM. The "renderer function" is called at the same time the document ready event would instantate the React components into the DOM.
101
+ A "renderer function" is a Render-Function that accepts three arguments (rather than 2): `(props, railsContext, domNodeId) => { ... }`. Instead of returning a React component, a renderer is responsible for installing a callback that will call `ReactDOM.render` (in React 16+, `ReactDOM.hydrate`) to render a React component into the DOM. The "renderer function" is called at the same time the document ready event would instantate the React components into the DOM.
102
102
 
103
103
  Why would you want to call `ReactDOM.hydrate` yourself? One possible use case is [code splitting](docs/outdated/code-splitting.md). In a nutshell, you don't want to load the React component on the DOM node yet. So you want to install some handler that will call `ReactDOM.hydrate` at a later time. In the case of code splitting with server rendering, the server rendered code has any async code loaded and used to server render. Thus, the client code must also fully load any asynch code before server rendering. Otherwise, the client code would first render partially, not matching the server rendering, and then a second later, the full code would render, resulting in an unpleasant flashing on the screen.
104
104
 
105
- Renderer functions are not meant to be used on the server since there's no DOM on the server. Instead, use a render function. Attempting to server render with a renderer function will throw an error.
105
+ Renderer functions are not meant to be used on the server since there's no DOM on the server. Instead, use a Render-Function. Attempting to server render with a renderer function will throw an error.
106
106
 
107
107
  ------------
108
108
 
@@ -215,7 +215,7 @@ Example of a RenderingExtension for custom values in the `rails_context`:
215
215
  module RenderingExtension
216
216
 
217
217
  # Return a Hash that contains custom values from the view context that will get merged with
218
- # the standard rails_context values and passed to all calls to render functions used by the
218
+ # the standard rails_context values and passed to all calls to Render-Functions used by the
219
219
  # react_component and redux_store view helpers
220
220
  def self.custom_context(view_context)
221
221
  {
@@ -15,7 +15,7 @@ side rendering, except for the key `serverSide` based on whether or not you are
15
15
 
16
16
  While you could manually configure your Rails code to pass the "`railsContext` information" with
17
17
  the rest of your "props", the `railsContext` is a convenience because it's passed consistently to
18
- all invocations of render functions.
18
+ all invocations of Render-Functions.
19
19
 
20
20
  For example, suppose you create a "render-function" called MyAppComponent.
21
21
 
@@ -8,9 +8,13 @@ We specialize in helping companies to quickly and efficiently move from versions
8
8
  ## Upgrading to v12
9
9
  ### Recent versions
10
10
  Make sure that you are on a relatively more recent version of rails and webpacker.
11
- v12 is tested on Rails 6. It should work on Rails v5. If you're on an older version,
11
+ v12 is tested on Rails 6. It should work on Rails v5. If you're on any older version,
12
12
  and v12 doesn't work, please file an issue.
13
13
 
14
+ ### Removed Configuration config.symlink_non_digested_assets_regex
15
+ Remove `config.symlink_non_digested_assets_regex` from your `config/initializers/react_on_rails.rb`.
16
+ If you still need that feature, please file an issue.
17
+
14
18
  ### i18n default format changed to JSON
15
19
  * If you're using the internalization helper, then set `config.i18n_output_format = 'js'`. You can
16
20
  later update to the default JSON format as you will need to update your usage of that file. A JSON
@@ -19,22 +23,32 @@ and v12 doesn't work, please file an issue.
19
23
  ### Updated API for `ReactOnRails.register()`
20
24
 
21
25
  In order to solve the issues regarding React Hooks compatibility, the number of parameters
22
- for functions is used to determine if you have a render function that will get invoked to
26
+ for functions is used to determine if you have a Render-Function that will get invoked to
23
27
  return a React component, or you are registering a React component defined by a function.
28
+ Please see [Render-Functions and the Rails Context](./render-functions-and-railscontext.md) for
29
+ more information on what a Render-Function is.
24
30
 
25
31
  ##### Correct
26
32
 
27
33
  Registered Objects are of the following types. Either of these will work:
28
- 1. Take **2 params** and return **a React function or class component**. A function component is a function
29
- that takes zero or one params and returns a React Element, like JSX.
34
+ 1. Takes only zero or one params and you return a React Element, often JSX.
35
+ ```js
36
+ export default (props) => <Component {...props} />;
37
+ ```
38
+ 2. Takes **2 params** and returns **a React function or class component**. A function
39
+ component is a function that takes zero or one params and returns a React Element, like JSX.
30
40
  ```js
31
41
  export default (props, _railsContext) => () => <Component {...props} />;
32
42
  ```
43
+ Note, you cannot return a React Element (JSX).
44
+ 3. Takes **3 params** and uses the 3rd param, `domNodeId`, to call `ReactDOM.hydrate`
45
+
46
+ Previously, with case number 2, you could return a React Element.
33
47
 
34
- 2. Take only zero or one params and you return a React Element, often JSX.
35
- ```js
36
- export default (props) => <Component {...props} />;
37
- ```
48
+ The fix is simple. Here is an example of the change you'll do:
49
+
50
+ ![2020-07-07_09-43-51 (1)](https://user-images.githubusercontent.com/1118459/86927351-eff79e80-c0ce-11ea-9172-d6855c45e2bb.png)
51
+
38
52
  ##### Broken, as this function takes two params and it returns a React Element from a JSX Literal
39
53
  ```js
40
54
  export default (props, _railsContext) => <Component {...props} />;
@@ -21,11 +21,11 @@ Let's say you're requesting a page that needs to fetch a code chunk from the ser
21
21
  > (server) <div data-reactroot="
22
22
  <!--This comment is here because the comment beginning on line 13 messes up Sublime's markdown parsing-->
23
23
 
24
- Different markup is generated on the client than on the server. Why does this happen? When you register a component or render function with `ReactOnRails.register`, react on rails will render the component as soon as the page loads. However, react-router renders a comment while waiting for the code chunk to be fetched from the server. This means that react will tear all of the server rendered code out of the DOM, and then rerender it a moment later once the code chunk arrives from the server, defeating most of the purpose of server rendering.
24
+ Different markup is generated on the client than on the server. Why does this happen? When you register a component or Render-Function with `ReactOnRails.register`, react on rails will render the component as soon as the page loads. However, react-router renders a comment while waiting for the code chunk to be fetched from the server. This means that react will tear all of the server rendered code out of the DOM, and then rerender it a moment later once the code chunk arrives from the server, defeating most of the purpose of server rendering.
25
25
 
26
26
  ### The solution
27
27
 
28
- To prevent this, you have to wait until the code chunk is fetched before doing the initial render on the client side. To accomplish this, react on rails allows you to register a renderer. This works just like registering a render function, except that the function you pass takes three arguments: `renderer(props, railsContext, domNodeId)`, and is responsible for calling `ReactDOM.render` or `ReactDOM.hydrate` to render the component to the DOM. React on rails will automatically detect when a render function takes three arguments, and will **not** call `ReactDOM.render` or `ReactDOM.hydrate`, instead allowing you to control the initial render yourself. Note, you have to be careful to call `ReactDOM.hydrate` rather than `ReactDOM.render` if you are are server rendering.
28
+ To prevent this, you have to wait until the code chunk is fetched before doing the initial render on the client side. To accomplish this, react on rails allows you to register a renderer. This works just like registering a Render-Function, except that the function you pass takes three arguments: `renderer(props, railsContext, domNodeId)`, and is responsible for calling `ReactDOM.render` or `ReactDOM.hydrate` to render the component to the DOM. React on rails will automatically detect when a Render-Function takes three arguments, and will **not** call `ReactDOM.render` or `ReactDOM.hydrate`, instead allowing you to control the initial render yourself. Note, you have to be careful to call `ReactDOM.hydrate` rather than `ReactDOM.render` if you are are server rendering.
29
29
 
30
30
  Here's an example of how you might use this in practice:
31
31
 
@@ -134,7 +134,7 @@ If you're going to try to do code splitting with server rendered routes, you'll
134
134
 
135
135
  The reason is we do server rendering with ExecJS, which is not capable of doing anything asynchronous. It would be impossible to asyncronously fetch a code chunk while server rendering. See [this issue](https://github.com/shakacode/react_on_rails/issues/477) for a discussion.
136
136
 
137
- Also, do not attempt to register a renderer on the server. Instead, register either a render function or a component. If you register a renderer in the server bundle, you'll get an error when react on rails tries to server render the component.
137
+ Also, do not attempt to register a renderer function on the server. Instead, register either a Render-Function or a component. If you register a renderer in the server bundle, you'll get an error when react on rails tries to server render the component.
138
138
 
139
139
  ## How does Webpack know where to find my code chunks?
140
140
 
@@ -17,13 +17,13 @@ module ReactOnRails
17
17
 
18
18
  COMPONENT_HTML_KEY = "componentHtml"
19
19
 
20
- # react_component_name: can be a React function or class component or a "render function".
21
- # "render functions" differ from a React function in that they take two parameters, the
20
+ # react_component_name: can be a React function or class component or a "Render-Function".
21
+ # "Render-Functions" differ from a React function in that they take two parameters, the
22
22
  # props and the railsContext, like this:
23
23
  #
24
24
  # let MyReactComponentApp = (props, railsContext) => <MyReactComponent {...props}/>;
25
25
  #
26
- # Alternately, you can define the render function with an additional property
26
+ # Alternately, you can define the Render-Function with an additional property
27
27
  # `.renderFunction = true`:
28
28
  #
29
29
  # let MyReactComponentApp = (props) => <MyReactComponent {...props}/>;
@@ -79,7 +79,7 @@ module ReactOnRails
79
79
  Value:
80
80
  #{server_rendered_html}
81
81
 
82
- If you're trying to use a render function to return a Hash to your ruby view code, then use
82
+ If you're trying to use a Render-Function to return a Hash to your ruby view code, then use
83
83
  react_component_hash instead of react_component and see
84
84
  https://github.com/shakacode/react_on_rails/blob/master/spec/dummy/client/app/startup/ReactHelmetServerApp.jsx
85
85
  for an example of the JavaScript code.
@@ -93,7 +93,7 @@ module ReactOnRails
93
93
  # It is exactly like react_component except for the following:
94
94
  # 1. prerender: true is automatically added, as this method doesn't make sense for client only
95
95
  # rendering.
96
- # 2. Your JavaScript render function for server rendering must return an Object rather than a React component.
96
+ # 2. Your JavaScript Render-Function for server rendering must return an Object rather than a React component.
97
97
  # 3. Your view code must expect an object and not a string.
98
98
  #
99
99
  # Here is an example of the view code:
@@ -124,10 +124,10 @@ module ReactOnRails
124
124
  )
125
125
  else
126
126
  msg = <<~MSG
127
- render function used by react_component_hash for #{component_name} is expected to return
127
+ Render-Function used by react_component_hash for #{component_name} is expected to return
128
128
  an Object. See https://github.com/shakacode/react_on_rails/blob/master/spec/dummy/client/app/startup/ReactHelmetServerApp.jsx
129
129
  for an example of the JavaScript code.
130
- Note, your render function must either take 2 params or have the property
130
+ Note, your Render-Function must either take 2 params or have the property
131
131
  `.renderFunction = true` added to it to distinguish it from a React Function Component.
132
132
  MSG
133
133
  raise ReactOnRails::Error, msg
@@ -240,7 +240,7 @@ module ReactOnRails
240
240
  end
241
241
 
242
242
  # This is the definitive list of the default values used for the rails_context, which is the
243
- # second parameter passed to both component and store render functions.
243
+ # second parameter passed to both component and store Render-Functions.
244
244
  # This method can be called from views and from the controller, as `helpers.rails_context`
245
245
  #
246
246
  # rubocop:disable Metrics/AbcSize
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "12.0.0"
4
+ VERSION = "12.0.1"
5
5
  end
@@ -13,19 +13,30 @@ unless ReactOnRails::WebpackerUtils.webpacker_webpack_production_config_exists?
13
13
  # the build command.
14
14
  ENV["WEBPACKER_PRECOMPILE"] = "false"
15
15
 
16
+ precompile_tasks = lambda {
17
+ Rake::Task["react_on_rails:assets:webpack"].invoke
18
+ puts "Invoking task webpacker:clean from React on Rails"
19
+
20
+ # VERSIONS is per the rails/webpacker clean method definition.
21
+ # We set it very big so that it is not used, and then clean just
22
+ # removes files older than 1 hour.
23
+ VERSIONS = 100_000
24
+ Rake::Task["webpacker:clean"].invoke(VERSIONS)
25
+ }
26
+
16
27
  if Rake::Task.task_defined?("assets:precompile")
17
28
  Rake::Task["assets:precompile"].enhance do
18
- Rake::Task["react_on_rails:assets:webpack"].invoke
19
- puts "Invoking task webpacker:clean from React on Rails"
20
- Rake::Task["webpacker:clean"].invoke
29
+ precompile_tasks.call
21
30
  end
22
31
  else
23
- Rake::Task.define_task("assets:precompile" => ["react_on_rails:assets:webpack",
24
- "webpacker:clean"])
32
+ Rake::Task.define_task("assets:precompile") do
33
+ precompile_tasks.call
34
+ end
25
35
  end
26
36
  end
27
37
 
28
38
  # Sprockets independent tasks
39
+ # rubocop:disable Metrics/BlockLength
29
40
  namespace :react_on_rails do
30
41
  namespace :assets do
31
42
  desc <<-DESC.strip_heredoc
@@ -55,3 +66,4 @@ namespace :react_on_rails do
55
66
  end
56
67
  end
57
68
  end
69
+ # rubocop:enable Metrics/BlockLength
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
@@ -6,7 +6,7 @@
6
6
  # Also see example_type.rb
7
7
 
8
8
  require "yaml"
9
- require 'rails/version'
9
+ require "rails/version"
10
10
 
11
11
  require_relative "example_type"
12
12
  require_relative "task_helpers"
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "task_helpers"
4
4
 
5
- namespace :lint do # rubocop:disable Metrics/BlockLength
5
+ namespace :lint do
6
6
  include ReactOnRails::TaskHelpers
7
7
 
8
8
  desc "Run Rubocop as shell"
@@ -67,8 +67,6 @@ task :release, %i[gem_version dry_run tools_install] do |_t, args|
67
67
  sh_in_dir(gem_root, release_it_command)
68
68
 
69
69
  # Release the new gem version
70
- unless is_dry_run
71
- sh_in_dir(gem_root, "gem release")
72
- end
70
+ sh_in_dir(gem_root, "gem release") unless is_dry_run
73
71
  end
74
72
  # rubocop:enable Metrics/BlockLength
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.0
4
+ version: 12.0.1
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-07-08 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -346,6 +346,7 @@ files:
346
346
  - docs/additional-reading/asset-pipeline.md
347
347
  - docs/additional-reading/capistrano-deployment.md
348
348
  - docs/additional-reading/convert-rails-5-api-only-app.md
349
+ - docs/additional-reading/converting-from-custom-webpack-config-to-rails-webpacker-config.md
349
350
  - docs/additional-reading/credits.md
350
351
  - docs/additional-reading/elastic-beanstalk.md
351
352
  - docs/additional-reading/foreman-issues.md