react_on_rails 12.4.0 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.github/workflows/main.yml +3 -3
  6. data/.gitignore +0 -3
  7. data/.prettierignore +2 -0
  8. data/CHANGELOG.md +32 -2
  9. data/Gemfile.development_dependencies +7 -6
  10. data/REACT-ON-RAILS-PRO-LICENSE +1 -1
  11. data/README.md +22 -12
  12. data/SUMMARY.md +9 -0
  13. data/docs/deployment/heroku-deployment.md +16 -5
  14. data/docs/guides/configuration.md +26 -12
  15. data/docs/guides/how-react-on-rails-works.md +0 -1
  16. data/docs/guides/tutorial.md +18 -14
  17. data/lib/generators/react_on_rails/base_generator.rb +46 -3
  18. data/lib/generators/react_on_rails/generator_helper.rb +4 -0
  19. data/lib/generators/react_on_rails/templates/.eslintrc +3 -1
  20. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev +4 -8
  21. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-static +9 -0
  22. data/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +2 -1
  23. data/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +4 -0
  24. data/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorldServer.js +5 -0
  25. data/lib/generators/react_on_rails/templates/base/base/app/javascript/packs/server-bundle.js +8 -0
  26. data/lib/generators/react_on_rails/templates/base/base/app/views/layouts/hello_world.html.erb +1 -0
  27. data/lib/generators/react_on_rails/templates/base/base/babel.config.js.tt +15 -0
  28. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +1 -1
  29. data/lib/generators/react_on_rails/templates/base/base/config/webpack/clientWebpackConfig.js.tt +17 -0
  30. data/lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js.tt +15 -0
  31. data/lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt +27 -0
  32. data/lib/generators/react_on_rails/templates/base/base/config/webpack/production.js.tt +11 -0
  33. data/lib/generators/react_on_rails/templates/base/base/config/webpack/serverWebpackConfig.js.tt +117 -0
  34. data/lib/generators/react_on_rails/templates/base/base/config/webpack/webpackConfig.js.tt +36 -0
  35. data/lib/generators/react_on_rails/templates/base/base/config/webpacker.yml +62 -0
  36. data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +2 -1
  37. data/lib/react_on_rails/configuration.rb +70 -35
  38. data/lib/react_on_rails/helper.rb +1 -1
  39. data/lib/react_on_rails/react_component/render_options.rb +14 -0
  40. data/lib/react_on_rails/server_rendering_js_code.rb +13 -0
  41. data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +3 -1
  42. data/lib/react_on_rails/version.rb +1 -1
  43. data/lib/tasks/assets.rake +5 -47
  44. data/lib/tasks/locale.rake +1 -2
  45. data/package.json +1 -1
  46. data/rakelib/example_type.rb +5 -1
  47. data/rakelib/examples.rake +8 -3
  48. data/rakelib/release.rake +7 -1
  49. data/rakelib/task_helpers.rb +7 -0
  50. data/react_on_rails.gemspec +3 -3
  51. data/yarn.lock +117 -71
  52. metadata +22 -9
  53. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-hmr +0 -26
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.4.0
4
+ version: 12.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-11 00:00:00.000000000 Z
11
+ date: 2022-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.2'
61
+ version: '5.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.2'
68
+ version: '5.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rainbow
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '4.0'
89
+ version: '4.2'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '4.0'
96
+ version: '4.2'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,8 @@ files:
136
136
  - ".eslintignore"
137
137
  - ".eslintrc"
138
138
  - ".github/FUNDING.yml"
139
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
140
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
139
141
  - ".github/workflows/lint-js-and-ruby.yml"
140
142
  - ".github/workflows/main.yml"
141
143
  - ".github/workflows/package-js-tests.yml"
@@ -244,13 +246,24 @@ files:
244
246
  - lib/generators/react_on_rails/react_with_redux_generator.rb
245
247
  - lib/generators/react_on_rails/templates/.eslintrc
246
248
  - lib/generators/react_on_rails/templates/base/base/Procfile.dev
247
- - lib/generators/react_on_rails/templates/base/base/Procfile.dev-hmr
249
+ - lib/generators/react_on_rails/templates/base/base/Procfile.dev-static
248
250
  - lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb
249
251
  - lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx
252
+ - lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css
253
+ - lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorldServer.js
250
254
  - lib/generators/react_on_rails/templates/base/base/app/javascript/packs/registration.js.tt
255
+ - lib/generators/react_on_rails/templates/base/base/app/javascript/packs/server-bundle.js
251
256
  - lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt
252
257
  - lib/generators/react_on_rails/templates/base/base/app/views/layouts/hello_world.html.erb
258
+ - lib/generators/react_on_rails/templates/base/base/babel.config.js.tt
253
259
  - lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb
260
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/clientWebpackConfig.js.tt
261
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js.tt
262
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt
263
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/production.js.tt
264
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/serverWebpackConfig.js.tt
265
+ - lib/generators/react_on_rails/templates/base/base/config/webpack/webpackConfig.js.tt
266
+ - lib/generators/react_on_rails/templates/base/base/config/webpacker.yml
254
267
  - lib/generators/react_on_rails/templates/dev_tests/.eslintrc
255
268
  - lib/generators/react_on_rails/templates/dev_tests/.rspec
256
269
  - lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb
@@ -330,14 +343,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
343
  requirements:
331
344
  - - ">="
332
345
  - !ruby/object:Gem::Version
333
- version: 2.5.0
346
+ version: 2.7.0
334
347
  required_rubygems_version: !ruby/object:Gem::Requirement
335
348
  requirements:
336
349
  - - ">="
337
350
  - !ruby/object:Gem::Version
338
351
  version: '0'
339
352
  requirements: []
340
- rubygems_version: 3.1.4
353
+ rubygems_version: 3.2.32
341
354
  signing_key:
342
355
  specification_version: 4
343
356
  summary: Rails with react server rendering with webpack.
@@ -1,26 +0,0 @@
1
- # Procfile for development using HMR
2
-
3
- web: rails s -p 3000
4
-
5
- # Note, hot and live reloading don't work with the default generator setup on
6
- # top of the rails/webpacker Webpack config with server rendering.
7
- # If you have server rendering enabled (prerender is true), you either need to
8
- # a. Ensure that you have dev_server.hmr and dev_server.inline BOTH set to false,
9
- # and you have this option in your config/initializers/react_on_rails.rb:
10
- # config.same_bundle_for_client_and_server = true
11
- # If you have either config/webpacker.yml option set to true, you'll see errors like
12
- # "ReferenceError: window is not defined" (if hmr is true)
13
- # "TypeError: Cannot read property 'prototype' of undefined" (if inline is true)
14
- # b. Skip using the webpack-dev-server. bin/webpack --watch is typically
15
- fast enough.
16
- # c. See the React on Rails README for a link to documentation for how to setup
17
- # SSR with HMR and React hot loading using the webpack-dev-server only for the
18
- # client bundles and a static file for the server bundle.
19
-
20
- # Run the webpack-dev-server for client and maybe server files
21
- webpack-dev-server: bin/webpack-dev-server
22
-
23
- # Keep the JS fresh for server rendering. Remove if not server rendering.
24
- # Especially if you have not configured generation of a server bundle without a hash.
25
- # as that will conflict with the manifest created by the bin/webpack-dev-server
26
- # rails-server-assets: SERVER_BUNDLE_ONLY=yes bin/webpack --watch