react_on_rails 13.0.0 → 13.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: d0c8e1ea64a37bf952902b50d8336916e2d579f8a2e4f04e2467bd750d8418d7
4
- data.tar.gz: 388204125e919bb352bb14df64ab67549459c2f63c416e6dc98de39daccf2395
3
+ metadata.gz: ac7cd79c4a43ac75a9a909b79cca371e421f4a80f7144da56a9cfc1ef2f3de05
4
+ data.tar.gz: 7820198820fa77afcfa9efd4aeff17a718dd3feb6cff55cdb05ad05e545ed8ae
5
5
  SHA512:
6
- metadata.gz: b59cea6f171d0734b118238b2b7cc1b6cf7573ea47e77716f4175d9fc69dc896d175cc331c064f6dad563cbe5a8474e81ae55568b455e152f7674b15e1670961
7
- data.tar.gz: 1f7a8895a3f90eff53089451c79a27bc920ac4488bb9475bdd46373b467e10ca6d8ebe445e715cdb86e50590b27da9a9ca99aa455c724be3cd85a83f8065701d
6
+ metadata.gz: 4f45505a93f080c6231b59289efe7c50dd2c25c356f14a7f9195264d26bfed337356f3729584fe27abab2fa0169713139b2b277bd15d664348bb06ad6d6331ce
7
+ data.tar.gz: 6df2a541c5f9b13e0d63c67b188198027aebc44758ed3c5f3a3c5ca5282da35a45830912df7ee3b988badf92040e924148ff7847d3c91436352e9b94d1b5769d
data/CHANGELOG.md CHANGED
@@ -16,9 +16,13 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
16
16
  Changes since last non-beta release.
17
17
 
18
18
  *Please add entries here for your pull requests that are not yet released.*
19
+ ### [13.0.1] - 2022-02-09
20
+ #### Improved
21
+ - Updated the default generator [PR 1431](https://github.com/shakacode/react_on_rails/pull/1431) by [justin808](https://github.com/justin808).
22
+
19
23
  ### [13.0.0] - 2022-02-08
20
24
  #### Breaking
21
- - Removed webpacker as a dependency. Add gem Shakapacker to your project.
25
+ - Removed webpacker as a dependency. Add gem Shakapacker to your project, and update your package.json to also use shakapacker.
22
26
 
23
27
  #### Fixed
24
28
  - Propper throwing of exceptions.
@@ -46,7 +50,7 @@ Changes since last non-beta release.
46
50
  - Supports Rails 7.
47
51
 
48
52
  #### Changed
49
- - Changed logic of determining the usage of the default rails/webpacker webpack config or a custom command to only check if the config.build_production_command is defined. [PR 1402](https://github.com/shakacode/react_on_rails/pull/1402)by [justin808](https://github.com/justin808) and [gscarv13](https://github.com/gscarv13).
53
+ - Changed logic of determining the usage of the default rails/webpacker webpack config or a custom command to only check if the config.build_production_command is defined. [PR 1402](https://github.com/shakacode/react_on_rails/pull/1402) by [justin808](https://github.com/justin808) and [gscarv13](https://github.com/gscarv13).
50
54
  - Minimimum required Ruby is 2.7 to match lastest rails/webpacker.
51
55
 
52
56
  ### [12.4.0] - 2021-09-22
@@ -1006,7 +1010,9 @@ Best done with Object destructing:
1006
1010
  ##### Fixed
1007
1011
  - Fix several generator related issues.
1008
1012
 
1009
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.6.0...master
1013
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/13.0.1...master
1014
+ [13.0.1]: https://github.com/shakacode/react_on_rails/compare/13.0.0...13.0.1
1015
+ [13.0.0]: https://github.com/shakacode/react_on_rails/compare/12.6.0...13.0.0
1010
1016
  [12.6.0]: https://github.com/shakacode/react_on_rails/compare/12.5.2...12.6.0
1011
1017
  [12.5.2]: https://github.com/shakacode/react_on_rails/compare/12.5.1...12.5.2
1012
1018
  [12.5.1]: https://github.com/shakacode/react_on_rails/compare/12.5.0...12.5.1
data/NEWS.md CHANGED
@@ -7,7 +7,7 @@ RR 474: React on Rails V12 – Don’t Shave That Yak! with Justin Gordon](https
7
7
 
8
8
  * **October 1, 2020**: See the [spec/dummy](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy) example repo for a simple configuration of webpack via the rails/webpacker gem
9
9
  that supports SSR.
10
- * **August 2, 2020**: See the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh) for a new way to setup the creation of your SSR bundle with `rails/webpacker`.
10
+ * **August 2, 2020**: See the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_demo_ssr_hmr) for a new way to setup the creation of your SSR bundle with `rails/webpacker`.
11
11
  * July 8, 2020: Release **v12**.
12
12
  1. **React Hooks Support** for top level components
13
13
  2. **Typescript bindings**
data/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  # News
15
15
  * ShakaCode now maintains the official successor to `rails/webpacker`, [`shakapacker`](https://github.com/shakacode/shakapacker).
16
- * Project is updated to support Rails 7!
16
+ * Project is updated to support Rails 7 and Shakapacker v6+!
17
17
 
18
18
  -----
19
19
 
@@ -44,12 +44,12 @@ To provide a high performance framework for integrating Ruby on Rails with React
44
44
  Given that `rails/webpacker` gem already provides basic React integration, why would you use "React on Rails"?
45
45
 
46
46
  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.
47
- 1. Tight integration with [rails/webpacker](https://github.com/rails/webpacker).
48
- 1. Server-Side Rendering (SSR), often used for SEO crawler indexing and UX performance, is not offered by `rails/webpacker`.
47
+ 1. Tight integration with [shakapacker](https://github.com/shakacode/shakapacker) (or it's predecessor [rails/webpacker](https://github.com/rails/webpacker].
48
+ 1. Server-Side Rendering (SSR), often used for SEO crawler indexing and UX performance.
49
49
  1. [Redux](https://github.com/reactjs/redux) and [React Router](https://github.com/ReactTraining/react-router#readme) integration with server-side-rendering.
50
50
  1. [Internationalization (I18n) and (localization)](https://www.shakacode.com/react-on-rails/docs/guides/i18n)
51
51
  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+depth%3Aall/).
52
- 1. [Reason ML Support](https://github.com/shakacode/reason-react-on-rails-example).
52
+ 1. [ReScript Support](https://github.com/shakacode/rescript-react-on-rails-example).
53
53
 
54
54
  See [Rails/Webpacker React Integration Options](https://www.shakacode.com/react-on-rails/docs/guides/rails-webpacker-react-integration-options) for comparisons to other gems.
55
55
 
@@ -12,7 +12,7 @@ app/javascript:
12
12
  │ └── hello-world-bundle.js
13
13
  ```
14
14
 
15
- Per the example repo [shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh),
15
+ Per the example repo [shakacode/react_on_rails_demo_ssr_hmr](https://github.com/shakacode/react_on_rails_demo_ssr_hmr),
16
16
  you should consider keeping your codebase mostly consistent with the defaults for [rails/webpacker](https://github.com/rails/webpacker).
17
17
 
18
18
  ## Steps to convert from the generator defaults to use a `/client` directory for source code
@@ -1,4 +1,4 @@
1
- # Rails/Webpacker React Integration Options
1
+ # Shakapacker (Rails/Webpacker) React Integration Options
2
2
 
3
3
  You only _need_ props hydration if you need SSR. However, there's no good reason to
4
4
  have your app make a second round trip to the Rails server to get initialization props.
@@ -81,7 +81,7 @@ Webpack's HMR allows the replacement of modules for React in-place without reloa
81
81
  ### React Refresh Webpack Plugin
82
82
  [github.com/pmmmwh/react-refresh-webpack-plugin](https://github.com/pmmmwh/react-refresh-webpack-plugin)
83
83
 
84
- You can see an example commit of adding this [here](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/commit/7e53803fce7034f5ecff335db1f400a5743a87e7).
84
+ You can see an example commit of adding this [here](https://github.com/shakacode/react_on_rails_demo_ssr_hmr/commit/7e53803fce7034f5ecff335db1f400a5743a87e7).
85
85
 
86
86
  1. Add react refresh packages:
87
87
  `yarn add @pmmmwh/react-refresh-webpack-plugin react-refresh -D`
@@ -111,6 +111,8 @@ You can see an example commit of adding this [here](https://github.com/shakacode
111
111
  }
112
112
  ```
113
113
 
114
+ ---
115
+
114
116
  ### React Hot Loader (Deprecated)
115
117
 
116
118
  1. Add the `react-hot-loader` and ` @hot-loader/react-dom` npm packages.
@@ -179,4 +181,3 @@ module.exports = environment.toWebpackConfig()
179
181
 
180
182
  module.exports = environment;
181
183
  ```
182
-
@@ -3,7 +3,7 @@
3
3
  See also [Client vs. Server Rendering](https://www.shakacode.com/react-on-rails/docs/guides/client-vs-server-rendering/).
4
4
 
5
5
  ## What is the easiest way to setup a webpack configuration for server-side-rendering?
6
- See the example webpack setup here: [github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh).
6
+ See the example webpack setup here: [github.com/shakacode/react_on_rails_demo_ssr_hmr](https://github.com/shakacode/react_on_rails_demo_ssr_hmr).
7
7
 
8
8
  ## What is Server Rendering?
9
9
 
@@ -1,10 +1,10 @@
1
1
  # React on Rails Basic Tutorial
2
2
 
3
- **November 11, 2020**: See the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh) for a new way to setup the creation of your SSR bundle with `rails/webpacker`. This file will be update shortly. Most of it is still relevant.
3
+ _Also see the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_demo_ssr_hmr)_
4
4
 
5
5
  -----
6
6
 
7
- *Updated for Ruby 2.7.1, Rails 6.0.3.1, React on Rails v12.5.0, and Shakapacker v6*
7
+ *Updated for Ruby 2.7, Rails 7, React on Rails v13, and Shakapacker v6*
8
8
 
9
9
  This tutorial guides you through setting up a new or existing Rails app with **React on Rails**, demonstrating Rails + React + Redux + Server Rendering.
10
10
 
@@ -23,7 +23,7 @@ By the time you read this, the latest may have changed. Be sure to check the ver
23
23
 
24
24
  ## Setting up your environment
25
25
 
26
- Trying out **React on Rails** is super easy, so long as you have the basic prerequisites. This includes the basics for Rails 6.x and node version 14+. I recommend `rvm` or `rbevn` and `nvm` to install Ruby and Node. Rails can be installed as an ordinary gem.
26
+ Trying out **React on Rails** is super easy, so long as you have the basic prerequisites. This includes the basics for Rails 6.x and node version 14+. I recommend `rvm` or `rbenv` and `nvm` to install Ruby and Node. Rails can be installed as an ordinary gem.
27
27
 
28
28
  ```
29
29
  nvm install node # download and install latest stable Node
@@ -49,6 +49,7 @@ cd <directory where you want to create your new Rails app>
49
49
 
50
50
  # Any name you like for the rails app
51
51
  # Skip javascript so will add that next and get the current version
52
+ # This is for Rails 7
52
53
  rails new --skip-turbolinks --skip-javascript test-react-on-rails
53
54
 
54
55
  cd test-react-on-rails
@@ -60,7 +61,7 @@ of both the gem and npm package. In other words, don't use the `^` or `~` in the
60
61
  _Use the latest version for `react_on_rails` and `shakapacker`._
61
62
 
62
63
  ```
63
- gem 'react_on_rails', '13.0.0' # prefer exact gem version to match npm version
64
+ gem 'react_on_rails', '13.0.1' # prefer exact gem version to match npm version
64
65
  gem 'shakapacker', '6.1.1' # prefer exact gem version to match npm version
65
66
 
66
67
  ```
@@ -68,7 +69,7 @@ gem 'shakapacker', '6.1.1' # prefer exact gem version to match npm v
68
69
  Note: The latest released React On Rails version is considered stable. Please use the latest
69
70
  version to ensure you get all the security patches and the best support.
70
71
 
71
- ## Run the webpacker (shakapacker) generator
72
+ ## Run the shakapacker (webpacker) generator
72
73
 
73
74
  ```terminal
74
75
  bundle exec rails webpacker:install
@@ -11,7 +11,7 @@
11
11
 
12
12
  To get a deeper understanding of `rails/webpacker`, watch [RailsConf 2020 CE - Webpacker, It-Just-Works, But How? by Justin Gordon](https://youtu.be/sJLoOpc5LD8)
13
13
 
14
- Per the example repo [shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh),
14
+ Per the example repo [shakacode/react_on_rails_demo_ssr_hmr](https://github.com/shakacode/react_on_rails_demo_ssr_hmr),
15
15
  you should consider keeping your codebase mostly consistent with the defaults for [rails/webpacker](https://github.com/rails/webpacker).
16
16
 
17
17
  # React on Rails
data/docs/home.md CHANGED
@@ -16,7 +16,7 @@
16
16
  ## Example Apps
17
17
  1. [spec/dummy](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy) example repo for a simple configuration of webpack via the rails/webpacker gem
18
18
  that supports SSR.
19
- 2. Example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh) for a new way to setup the creation of your SSR bundle with `rails/webpacker`.
19
+ 2. Example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_demo_ssr_hmr) for a new way to setup the creation of your SSR bundle with `rails/webpacker`.
20
20
  3. Live, [open source](https://github.com/shakacode/react-webpack-rails-tutorial), example of this gem, see [reactrails.com](http://reactrails.com).
21
21
 
22
22
  # Other Resources
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/babel.config.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/babel.config.js") %>
2
2
 
3
3
  module.exports = function (api) {
4
4
  const defaultConfigFunc = require('shakapacker/package/babel/preset.js')
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/clientWebpackConfig.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/clientWebpackConfig.js") %>
2
2
 
3
3
  const commonWebpackConfig = require('./commonWebpackConfig');
4
4
 
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/commonWebpackConfig.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/commonWebpackConfig.js") %>
2
2
 
3
3
  // Common configuration applying to client and server configuration
4
4
  const { webpackConfig: baseClientWebpackConfig, merge } = require('shakapacker');
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/development.js") %>
2
2
 
3
3
  const { devServer, inliningCss } = require('shakapacker');
4
4
 
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/production.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/production.js") %>
2
2
 
3
3
  const webpackConfig = require('./webpackConfig');
4
4
 
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/serverWebpackConfig.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/serverWebpackConfig.js") %>
2
2
 
3
3
  const { merge, config } = require('shakapacker');
4
4
  const commonWebpackConfig = require('./commonWebpackConfig');
@@ -1,6 +1,9 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/test.js") %>
2
2
 
3
- // Use dev
4
- const config = require('./development');
3
+ const webpackConfig = require('./webpackConfig')
5
4
 
6
- module.exports = config;
5
+ const testOnly = (_clientWebpackConfig, _serverWebpackConfig) => {
6
+ // place any code here that is for test only
7
+ }
8
+
9
+ module.exports = webpackConfig(testOnly)
@@ -1,4 +1,4 @@
1
- <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/webpackConfig.js") %>
1
+ <%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/config/webpack/webpackConfig.js") %>
2
2
 
3
3
  const clientWebpackConfig = require('./clientWebpackConfig');
4
4
  const serverWebpackConfig = require('./serverWebpackConfig');
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "13.0.0"
4
+ VERSION = "13.0.1"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "13.0.0",
3
+ "version": "13.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": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.0
4
+ version: 13.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon