react_on_rails 12.0.1 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +12 -2
- data/.eslintrc +2 -1
- data/.github/workflows/lint-js-and-ruby.yml +53 -0
- data/.github/workflows/main.yml +178 -0
- data/.github/workflows/package-js-tests.yml +35 -0
- data/.github/workflows/rspec-package-specs.yml +45 -0
- data/.prettierrc +0 -3
- data/.rubocop.yml +46 -38
- data/.travis.yml +3 -1
- data/CHANGELOG.md +39 -11
- data/CONTRIBUTING.md +4 -3
- data/Gemfile +1 -33
- data/Gemfile.development_dependencies +51 -0
- data/NEWS.md +5 -0
- data/README.md +66 -57
- data/SUMMARY.md +1 -1
- data/docs/{basics → additional-details}/generator-details.md +1 -6
- data/docs/{outdated → additional-details}/manual-installation-overview.md +6 -6
- data/docs/additional-details/recommended-project-structure.md +69 -0
- data/docs/additional-details/upgrade-webpacker-v3-to-v4.md +10 -0
- data/docs/api/javascript-api.md +2 -2
- data/docs/api/redux-store-api.md +3 -3
- data/docs/api/view-helpers-api.md +7 -8
- data/docs/basics/client-vs-server-rendering.md +4 -2
- data/docs/basics/configuration.md +42 -25
- data/docs/basics/deployment.md +2 -2
- data/docs/basics/hmr-and-hot-reloading-with-the-webpack-dev-server.md +64 -9
- data/docs/{outdated → basics}/how-react-on-rails-works.md +8 -9
- data/docs/basics/installation-into-an-existing-rails-app.md +13 -6
- data/docs/basics/react-server-rendering.md +8 -5
- data/docs/basics/rspec-configuration.md +10 -10
- data/docs/{tutorial.md → basics/tutorial.md} +28 -30
- data/docs/basics/upgrading-react-on-rails.md +41 -18
- data/docs/basics/webpack-configuration.md +14 -22
- data/docs/contributor-info/linters.md +5 -6
- data/docs/contributor-info/pull-requests.md +2 -4
- data/docs/contributor-info/releasing.md +1 -1
- data/docs/home.md +382 -0
- data/docs/{outdated → javascript}/code-splitting.md +5 -5
- data/docs/{additional-reading → javascript}/converting-from-custom-webpack-config-to-rails-webpacker-config.md +3 -3
- data/docs/{additional-reading → javascript}/images.md +5 -6
- data/docs/{articles.md → misc/articles.md} +1 -1
- data/docs/misc/doctrine.md +5 -6
- data/docs/outdated/deferred-rendering.md +39 -0
- data/docs/outdated/rails-assets-relative-paths.md +3 -3
- data/docs/outdated/rails-assets.md +8 -8
- data/docs/outdated/rails3.md +2 -2
- data/docs/{additional-reading → rails}/convert-rails-5-api-only-app.md +1 -1
- data/docs/rails-webpacker-react-integration-options.md +182 -0
- data/docs/testimonials/testimonials.md +6 -6
- data/lib/generators/react_on_rails/base_generator.rb +8 -1
- data/lib/generators/react_on_rails/dev_tests_generator.rb +1 -1
- data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +8 -2
- data/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +1 -1
- data/lib/generators/react_on_rails/templates/dev_tests/spec/{features → system}/hello_world_spec.rb +2 -2
- data/lib/react_on_rails/configuration.rb +2 -0
- data/lib/react_on_rails/git_utils.rb +3 -3
- data/lib/react_on_rails/helper.rb +15 -9
- data/lib/react_on_rails/locales/base.rb +3 -3
- data/lib/react_on_rails/locales/to_js.rb +0 -4
- data/lib/react_on_rails/locales/to_json.rb +0 -4
- data/lib/react_on_rails/prerender_error.rb +1 -1
- data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +6 -6
- data/lib/react_on_rails/test_helper/webpack_assets_compiler.rb +1 -1
- data/lib/react_on_rails/test_helper.rb +2 -0
- data/lib/react_on_rails/utils.rb +24 -4
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/webpacker_utils.rb +9 -5
- data/lib/tasks/assets.rake +20 -11
- data/package.json +24 -29
- data/rakelib/docker.rake +0 -5
- data/rakelib/lint.rake +3 -9
- data/rakelib/release.rake +27 -13
- data/rakelib/run_rspec.rake +10 -11
- data/rakelib/task_helpers.rb +16 -4
- data/react_on_rails.gemspec +3 -17
- data/yarn.lock +2272 -4960
- metadata +50 -225
- data/docs/additional-reading/upgrade-webpacker-v3-to-v4.md +0 -10
- data/docs/additional-reading/webpack-dev-server.md +0 -15
- data/docs/basics/recommended-project-structure.md +0 -77
- data/ruby-lint.yml +0 -25
- /data/docs/{basics → additional-details}/migrating-from-react-rails.md +0 -0
- /data/docs/{additional-reading → additional-details}/updating-dependencies.md +0 -0
- /data/docs/{additional-reading → deployment}/elastic-beanstalk.md +0 -0
- /data/docs/{basics → deployment}/heroku-deployment.md +0 -0
- /data/docs/{additional-reading → javascript}/angular-js-integration-migration.md +0 -0
- /data/docs/{additional-reading → javascript}/asset-pipeline.md +0 -0
- /data/docs/{additional-reading → javascript}/capistrano-deployment.md +0 -0
- /data/docs/{additional-reading → javascript}/credits.md +0 -0
- /data/docs/{additional-reading → javascript}/foreman-issues.md +0 -0
- /data/docs/{additional-reading → javascript}/node-dependencies-and-npm.md +0 -0
- /data/docs/{additional-reading → javascript}/react-and-redux.md +0 -0
- /data/docs/{additional-reading → javascript}/react-helmet.md +0 -0
- /data/docs/{additional-reading → javascript}/react-router.md +0 -0
- /data/docs/{additional-reading → javascript}/server-rendering-tips.md +0 -0
- /data/docs/{additional-reading → javascript}/troubleshooting-when-using-webpacker.md +0 -0
- /data/docs/{additional-reading → javascript}/webpack-v1-notes.md +0 -0
- /data/docs/{additional-reading → javascript}/webpack.md +0 -0
- /data/docs/{coding-style → misc}/style.md +0 -0
- /data/docs/{additional-reading → misc}/tips.md +0 -0
- /data/docs/{additional-reading → rails}/rails-engine-integration.md +0 -0
- /data/docs/{additional-reading → rails}/rails_view_rendering_from_inline_javascript.md +0 -0
- /data/docs/{additional-reading → rails}/turbolinks.md +0 -0
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
|
|
4
|
+
version: 12.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Gordon
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
@@ -94,20 +94,6 @@ dependencies:
|
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '4.0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: awesome_print
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
97
|
- !ruby/object:Gem::Dependency
|
|
112
98
|
name: bundler
|
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,20 +108,6 @@ dependencies:
|
|
|
122
108
|
- - "~>"
|
|
123
109
|
- !ruby/object:Gem::Version
|
|
124
110
|
version: '2'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: coveralls
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - ">="
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0'
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - ">="
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0'
|
|
139
111
|
- !ruby/object:Gem::Dependency
|
|
140
112
|
name: gem-release
|
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,160 +122,6 @@ dependencies:
|
|
|
150
122
|
- - ">="
|
|
151
123
|
- !ruby/object:Gem::Version
|
|
152
124
|
version: '0'
|
|
153
|
-
- !ruby/object:Gem::Dependency
|
|
154
|
-
name: generator_spec
|
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
|
156
|
-
requirements:
|
|
157
|
-
- - ">="
|
|
158
|
-
- !ruby/object:Gem::Version
|
|
159
|
-
version: '0'
|
|
160
|
-
type: :development
|
|
161
|
-
prerelease: false
|
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
-
requirements:
|
|
164
|
-
- - ">="
|
|
165
|
-
- !ruby/object:Gem::Version
|
|
166
|
-
version: '0'
|
|
167
|
-
- !ruby/object:Gem::Dependency
|
|
168
|
-
name: listen
|
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
|
170
|
-
requirements:
|
|
171
|
-
- - ">="
|
|
172
|
-
- !ruby/object:Gem::Version
|
|
173
|
-
version: '0'
|
|
174
|
-
type: :development
|
|
175
|
-
prerelease: false
|
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
-
requirements:
|
|
178
|
-
- - ">="
|
|
179
|
-
- !ruby/object:Gem::Version
|
|
180
|
-
version: '0'
|
|
181
|
-
- !ruby/object:Gem::Dependency
|
|
182
|
-
name: pry
|
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
|
184
|
-
requirements:
|
|
185
|
-
- - ">="
|
|
186
|
-
- !ruby/object:Gem::Version
|
|
187
|
-
version: '0'
|
|
188
|
-
type: :development
|
|
189
|
-
prerelease: false
|
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
191
|
-
requirements:
|
|
192
|
-
- - ">="
|
|
193
|
-
- !ruby/object:Gem::Version
|
|
194
|
-
version: '0'
|
|
195
|
-
- !ruby/object:Gem::Dependency
|
|
196
|
-
name: pry-byebug
|
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
|
198
|
-
requirements:
|
|
199
|
-
- - ">="
|
|
200
|
-
- !ruby/object:Gem::Version
|
|
201
|
-
version: '0'
|
|
202
|
-
type: :development
|
|
203
|
-
prerelease: false
|
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
-
requirements:
|
|
206
|
-
- - ">="
|
|
207
|
-
- !ruby/object:Gem::Version
|
|
208
|
-
version: '0'
|
|
209
|
-
- !ruby/object:Gem::Dependency
|
|
210
|
-
name: pry-doc
|
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
|
212
|
-
requirements:
|
|
213
|
-
- - ">="
|
|
214
|
-
- !ruby/object:Gem::Version
|
|
215
|
-
version: '0'
|
|
216
|
-
type: :development
|
|
217
|
-
prerelease: false
|
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
219
|
-
requirements:
|
|
220
|
-
- - ">="
|
|
221
|
-
- !ruby/object:Gem::Version
|
|
222
|
-
version: '0'
|
|
223
|
-
- !ruby/object:Gem::Dependency
|
|
224
|
-
name: pry-rescue
|
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
|
226
|
-
requirements:
|
|
227
|
-
- - ">="
|
|
228
|
-
- !ruby/object:Gem::Version
|
|
229
|
-
version: '0'
|
|
230
|
-
type: :development
|
|
231
|
-
prerelease: false
|
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
233
|
-
requirements:
|
|
234
|
-
- - ">="
|
|
235
|
-
- !ruby/object:Gem::Version
|
|
236
|
-
version: '0'
|
|
237
|
-
- !ruby/object:Gem::Dependency
|
|
238
|
-
name: pry-state
|
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
|
240
|
-
requirements:
|
|
241
|
-
- - ">="
|
|
242
|
-
- !ruby/object:Gem::Version
|
|
243
|
-
version: '0'
|
|
244
|
-
type: :development
|
|
245
|
-
prerelease: false
|
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
247
|
-
requirements:
|
|
248
|
-
- - ">="
|
|
249
|
-
- !ruby/object:Gem::Version
|
|
250
|
-
version: '0'
|
|
251
|
-
- !ruby/object:Gem::Dependency
|
|
252
|
-
name: rails
|
|
253
|
-
requirement: !ruby/object:Gem::Requirement
|
|
254
|
-
requirements:
|
|
255
|
-
- - "~>"
|
|
256
|
-
- !ruby/object:Gem::Version
|
|
257
|
-
version: '5.2'
|
|
258
|
-
type: :development
|
|
259
|
-
prerelease: false
|
|
260
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
261
|
-
requirements:
|
|
262
|
-
- - "~>"
|
|
263
|
-
- !ruby/object:Gem::Version
|
|
264
|
-
version: '5.2'
|
|
265
|
-
- !ruby/object:Gem::Dependency
|
|
266
|
-
name: rake
|
|
267
|
-
requirement: !ruby/object:Gem::Requirement
|
|
268
|
-
requirements:
|
|
269
|
-
- - "~>"
|
|
270
|
-
- !ruby/object:Gem::Version
|
|
271
|
-
version: '10.0'
|
|
272
|
-
type: :development
|
|
273
|
-
prerelease: false
|
|
274
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
275
|
-
requirements:
|
|
276
|
-
- - "~>"
|
|
277
|
-
- !ruby/object:Gem::Version
|
|
278
|
-
version: '10.0'
|
|
279
|
-
- !ruby/object:Gem::Dependency
|
|
280
|
-
name: rspec
|
|
281
|
-
requirement: !ruby/object:Gem::Requirement
|
|
282
|
-
requirements:
|
|
283
|
-
- - ">="
|
|
284
|
-
- !ruby/object:Gem::Version
|
|
285
|
-
version: '0'
|
|
286
|
-
type: :development
|
|
287
|
-
prerelease: false
|
|
288
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
289
|
-
requirements:
|
|
290
|
-
- - ">="
|
|
291
|
-
- !ruby/object:Gem::Version
|
|
292
|
-
version: '0'
|
|
293
|
-
- !ruby/object:Gem::Dependency
|
|
294
|
-
name: rubocop
|
|
295
|
-
requirement: !ruby/object:Gem::Requirement
|
|
296
|
-
requirements:
|
|
297
|
-
- - '='
|
|
298
|
-
- !ruby/object:Gem::Version
|
|
299
|
-
version: 0.85.0
|
|
300
|
-
type: :development
|
|
301
|
-
prerelease: false
|
|
302
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
303
|
-
requirements:
|
|
304
|
-
- - '='
|
|
305
|
-
- !ruby/object:Gem::Version
|
|
306
|
-
version: 0.85.0
|
|
307
125
|
description: See README.md
|
|
308
126
|
email:
|
|
309
127
|
- justin@shakacode.com
|
|
@@ -318,6 +136,10 @@ files:
|
|
|
318
136
|
- ".eslintignore"
|
|
319
137
|
- ".eslintrc"
|
|
320
138
|
- ".github/FUNDING.yml"
|
|
139
|
+
- ".github/workflows/lint-js-and-ruby.yml"
|
|
140
|
+
- ".github/workflows/main.yml"
|
|
141
|
+
- ".github/workflows/package-js-tests.yml"
|
|
142
|
+
- ".github/workflows/rspec-package-specs.yml"
|
|
321
143
|
- ".gitignore"
|
|
322
144
|
- ".npmignore"
|
|
323
145
|
- ".prettierignore"
|
|
@@ -331,6 +153,7 @@ files:
|
|
|
331
153
|
- CONTRIBUTING.md
|
|
332
154
|
- Dockerfile_tests
|
|
333
155
|
- Gemfile
|
|
156
|
+
- Gemfile.development_dependencies
|
|
334
157
|
- KUDOS.md
|
|
335
158
|
- LICENSE.md
|
|
336
159
|
- NEWS.md
|
|
@@ -342,68 +165,70 @@ files:
|
|
|
342
165
|
- app/helpers/react_on_rails_helper.rb
|
|
343
166
|
- book.json
|
|
344
167
|
- docker-compose.yml
|
|
345
|
-
- docs/additional-
|
|
346
|
-
- docs/additional-
|
|
347
|
-
- docs/additional-
|
|
348
|
-
- docs/additional-
|
|
349
|
-
- docs/additional-
|
|
350
|
-
- docs/additional-
|
|
351
|
-
- docs/additional-reading/elastic-beanstalk.md
|
|
352
|
-
- docs/additional-reading/foreman-issues.md
|
|
353
|
-
- docs/additional-reading/images.md
|
|
354
|
-
- docs/additional-reading/node-dependencies-and-npm.md
|
|
355
|
-
- docs/additional-reading/rails-engine-integration.md
|
|
356
|
-
- docs/additional-reading/rails_view_rendering_from_inline_javascript.md
|
|
357
|
-
- docs/additional-reading/react-and-redux.md
|
|
358
|
-
- docs/additional-reading/react-helmet.md
|
|
359
|
-
- docs/additional-reading/react-router.md
|
|
360
|
-
- docs/additional-reading/server-rendering-tips.md
|
|
361
|
-
- docs/additional-reading/tips.md
|
|
362
|
-
- docs/additional-reading/troubleshooting-when-using-webpacker.md
|
|
363
|
-
- docs/additional-reading/turbolinks.md
|
|
364
|
-
- docs/additional-reading/updating-dependencies.md
|
|
365
|
-
- docs/additional-reading/upgrade-webpacker-v3-to-v4.md
|
|
366
|
-
- docs/additional-reading/webpack-dev-server.md
|
|
367
|
-
- docs/additional-reading/webpack-v1-notes.md
|
|
368
|
-
- docs/additional-reading/webpack.md
|
|
168
|
+
- docs/additional-details/generator-details.md
|
|
169
|
+
- docs/additional-details/manual-installation-overview.md
|
|
170
|
+
- docs/additional-details/migrating-from-react-rails.md
|
|
171
|
+
- docs/additional-details/recommended-project-structure.md
|
|
172
|
+
- docs/additional-details/updating-dependencies.md
|
|
173
|
+
- docs/additional-details/upgrade-webpacker-v3-to-v4.md
|
|
369
174
|
- docs/api/javascript-api.md
|
|
370
175
|
- docs/api/redux-store-api.md
|
|
371
176
|
- docs/api/view-helpers-api.md
|
|
372
|
-
- docs/articles.md
|
|
373
177
|
- docs/basics/client-vs-server-rendering.md
|
|
374
178
|
- docs/basics/configuration.md
|
|
375
179
|
- docs/basics/deployment.md
|
|
376
|
-
- docs/basics/generator-details.md
|
|
377
|
-
- docs/basics/heroku-deployment.md
|
|
378
180
|
- docs/basics/hmr-and-hot-reloading-with-the-webpack-dev-server.md
|
|
181
|
+
- docs/basics/how-react-on-rails-works.md
|
|
379
182
|
- docs/basics/i18n.md
|
|
380
183
|
- docs/basics/installation-into-an-existing-rails-app.md
|
|
381
|
-
- docs/basics/migrating-from-react-rails.md
|
|
382
184
|
- docs/basics/minitest-configuration.md
|
|
383
185
|
- docs/basics/react-server-rendering.md
|
|
384
|
-
- docs/basics/recommended-project-structure.md
|
|
385
186
|
- docs/basics/render-functions-and-railscontext.md
|
|
386
187
|
- docs/basics/rspec-configuration.md
|
|
188
|
+
- docs/basics/tutorial.md
|
|
387
189
|
- docs/basics/upgrading-react-on-rails.md
|
|
388
190
|
- docs/basics/webpack-configuration.md
|
|
389
|
-
- docs/coding-style/style.md
|
|
390
191
|
- docs/contributor-info/errors-with-hooks.md
|
|
391
192
|
- docs/contributor-info/generator-testing.md
|
|
392
193
|
- docs/contributor-info/linters.md
|
|
393
194
|
- docs/contributor-info/pull-requests.md
|
|
394
195
|
- docs/contributor-info/releasing.md
|
|
196
|
+
- docs/deployment/elastic-beanstalk.md
|
|
197
|
+
- docs/deployment/heroku-deployment.md
|
|
198
|
+
- docs/home.md
|
|
199
|
+
- docs/javascript/angular-js-integration-migration.md
|
|
200
|
+
- docs/javascript/asset-pipeline.md
|
|
201
|
+
- docs/javascript/capistrano-deployment.md
|
|
202
|
+
- docs/javascript/code-splitting.md
|
|
203
|
+
- docs/javascript/converting-from-custom-webpack-config-to-rails-webpacker-config.md
|
|
204
|
+
- docs/javascript/credits.md
|
|
205
|
+
- docs/javascript/foreman-issues.md
|
|
206
|
+
- docs/javascript/images.md
|
|
207
|
+
- docs/javascript/node-dependencies-and-npm.md
|
|
208
|
+
- docs/javascript/react-and-redux.md
|
|
209
|
+
- docs/javascript/react-helmet.md
|
|
210
|
+
- docs/javascript/react-router.md
|
|
211
|
+
- docs/javascript/server-rendering-tips.md
|
|
212
|
+
- docs/javascript/troubleshooting-when-using-webpacker.md
|
|
213
|
+
- docs/javascript/webpack-v1-notes.md
|
|
214
|
+
- docs/javascript/webpack.md
|
|
215
|
+
- docs/misc/articles.md
|
|
395
216
|
- docs/misc/code_of_conduct.md
|
|
396
217
|
- docs/misc/doctrine.md
|
|
397
|
-
- docs/
|
|
398
|
-
- docs/
|
|
399
|
-
- docs/outdated/
|
|
218
|
+
- docs/misc/style.md
|
|
219
|
+
- docs/misc/tips.md
|
|
220
|
+
- docs/outdated/deferred-rendering.md
|
|
400
221
|
- docs/outdated/rails-assets-relative-paths.md
|
|
401
222
|
- docs/outdated/rails-assets.md
|
|
402
223
|
- docs/outdated/rails3.md
|
|
224
|
+
- docs/rails-webpacker-react-integration-options.md
|
|
225
|
+
- docs/rails/convert-rails-5-api-only-app.md
|
|
226
|
+
- docs/rails/rails-engine-integration.md
|
|
227
|
+
- docs/rails/rails_view_rendering_from_inline_javascript.md
|
|
228
|
+
- docs/rails/turbolinks.md
|
|
403
229
|
- docs/testimonials/hvmn.md
|
|
404
230
|
- docs/testimonials/resortpass.md
|
|
405
231
|
- docs/testimonials/testimonials.md
|
|
406
|
-
- docs/tutorial.md
|
|
407
232
|
- jest.config.js
|
|
408
233
|
- lib/generators/USAGE
|
|
409
234
|
- lib/generators/react_on_rails/base_generator.rb
|
|
@@ -424,10 +249,10 @@ files:
|
|
|
424
249
|
- lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb
|
|
425
250
|
- lib/generators/react_on_rails/templates/dev_tests/.eslintrc
|
|
426
251
|
- lib/generators/react_on_rails/templates/dev_tests/.rspec
|
|
427
|
-
- lib/generators/react_on_rails/templates/dev_tests/spec/features/hello_world_spec.rb
|
|
428
252
|
- lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb
|
|
429
253
|
- lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb
|
|
430
254
|
- lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb
|
|
255
|
+
- lib/generators/react_on_rails/templates/dev_tests/spec/system/hello_world_spec.rb
|
|
431
256
|
- lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/actions/helloWorldActionCreators.js
|
|
432
257
|
- lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx
|
|
433
258
|
- lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/constants/helloWorldConstants.js
|
|
@@ -476,7 +301,6 @@ files:
|
|
|
476
301
|
- rakelib/run_rspec.rake
|
|
477
302
|
- rakelib/task_helpers.rb
|
|
478
303
|
- react_on_rails.gemspec
|
|
479
|
-
- ruby-lint.yml
|
|
480
304
|
- script/bootstrap
|
|
481
305
|
- script/release
|
|
482
306
|
- script/setup
|
|
@@ -491,8 +315,9 @@ metadata: {}
|
|
|
491
315
|
post_install_message: |2
|
|
492
316
|
|
|
493
317
|
--------------------------------------------------------------------------------
|
|
494
|
-
|
|
495
|
-
which
|
|
318
|
+
Checkout https://www.shakacode.com/react-on-rails-pro for information about
|
|
319
|
+
"React on Rails Pro" which includes one hour a month of support and a gem for
|
|
320
|
+
better performance, via caching helpers, and our node rendering server.
|
|
496
321
|
--------------------------------------------------------------------------------
|
|
497
322
|
rdoc_options: []
|
|
498
323
|
require_paths:
|
|
@@ -508,8 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
508
333
|
- !ruby/object:Gem::Version
|
|
509
334
|
version: '0'
|
|
510
335
|
requirements: []
|
|
511
|
-
rubygems_version: 3.
|
|
512
|
-
signing_key:
|
|
336
|
+
rubygems_version: 3.1.4
|
|
337
|
+
signing_key:
|
|
513
338
|
specification_version: 4
|
|
514
339
|
summary: Rails with react server rendering with webpack.
|
|
515
340
|
test_files: []
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Upgrading rails/webpacker v3.5 to v4
|
|
2
|
-
|
|
3
|
-
The following steps can be followed to update a Webpacker v3.5 app to v4.
|
|
4
|
-
|
|
5
|
-
1. Update the gem `webpacker` and the package `@rails/webpacker`
|
|
6
|
-
1. Merge changes from the new default [.babelrc](../lib/install/config/.babelrc) to your `/.babelrc`. If you are using React, you need to add `"@babel/preset-react"`, to the list of `presets`.
|
|
7
|
-
1. Copy the file [.browserslistrc](../lib/install/config/.browserslistrc) to `/`.
|
|
8
|
-
1. Merge any differences between [config/webpacker.yml](../lib/install/config/webpacker.yml) and your `/config/webpacker.yml`.
|
|
9
|
-
|
|
10
|
-
Here is an [example commit of these changes](https://github.com/shakacode/react_on_rails-tutorial-v11/pull/1/files).
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## Developing with the Webpack Dev Server
|
|
2
|
-
One of the benefits of using webpack is access to [webpack's dev server](https://webpack.github.io/docs/webpack-dev-server.html) and its [hot module replacement](https://webpack.github.io/docs/hot-module-replacement-with-webpack.html) functionality.
|
|
3
|
-
|
|
4
|
-
The webpack dev server with HMR will apply changes from the code (or styles!) to the browser as soon as you save whatever file you're working on. You won't need to reload the page, and your data will still be there. Start foreman as normal (it boots up the Rails server *and* the webpack HMR dev server at the same time).
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
foreman start -f Procfile.dev
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Open your browser to [localhost:3000](http://localhost:3000). Whenever you make changes to your JavaScript code in the `client` folder, they will automatically show up in the browser. Hot module replacement is already enabled by default.
|
|
11
|
-
|
|
12
|
-
Note that **React-related error messages are possibly more helpful when encountered in the dev server** than the Rails server as they do not include noise added by the React on Rails gem.
|
|
13
|
-
|
|
14
|
-
### Adding Additional Routes for the Dev Server
|
|
15
|
-
As you add more routes to your front-end application, you will need to make the corresponding API for the dev server in `client/server.js`. See our example `server.js` from our [tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client%2Fserver-express.js).
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Recommended Project structure
|
|
2
|
-
|
|
3
|
-
The React on Rails generator uses the standard `rails/webpacker` convention of this structure:
|
|
4
|
-
|
|
5
|
-
```yml
|
|
6
|
-
app/javascript:
|
|
7
|
-
├── bundles:
|
|
8
|
-
│ # Logical groups of files that can be used for code splitting
|
|
9
|
-
│ └── hello-world-bundle.js
|
|
10
|
-
├── packs:
|
|
11
|
-
│ # only webpack entry files here
|
|
12
|
-
│ └── hello-world-bundle.js
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
However, you may wish to move all your client side files to a single directory called something like `/client`.
|
|
16
|
-
|
|
17
|
-
## Steps to convert from the generator defaults to use a `/client` directory structure.
|
|
18
|
-
|
|
19
|
-
1. Move the directory:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
mv app/javascript client
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
2. Edit your `/config/webpacker.yml` file. Change the `default/source_path`:
|
|
26
|
-
|
|
27
|
-
```yml
|
|
28
|
-
source_path: client
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Moving node_modules from `/` to `/client` with a custom webpack setup.
|
|
32
|
-
|
|
33
|
-
`rails/webpacker` probably doesn't support having your main node_modules directory under `/client`, so only follow these steps if you want to use your own webpack configuration.
|
|
34
|
-
|
|
35
|
-
1. Move the `/package.json` to `/client/package.json`
|
|
36
|
-
2. Create a `/package.json` that delegates to `/client/package.json`. See the example in [spec/dummy/package.json](../../spec/dummy/package.json).
|
|
37
|
-
3. See the webpack configuration in [spec/dummy/client](../../spec/dummy/client) for a webpack configuration example.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## JavaScript Assets
|
|
41
|
-
1. `/client`: All client side JavaScript goes under the `/client` directory. Place all the major domains of the client side app under client.
|
|
42
|
-
1. `/client/app`: All application JavaScript. Note the adherence to the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript#naming-conventions) where we name the files to correspond to exported Objects (PascalCase) or exported functions (camelCase). We don't use dashes or snake_case for JavaScript files, except for possibly some config files.
|
|
43
|
-
1. `/client/app/bundles`: Top level of different app domains. Use a name within this directory for you app domains. For example, if you had a domain called `widget-editing`, then you would have: `/client/app/bundles/widget-editing`
|
|
44
|
-
1. `/client/app/lib`: Common code for bundles
|
|
45
|
-
1. Within each bundle directory (or the lib directory), such as a domain named "comments"
|
|
46
|
-
`/client/app/bundles/comments`, use following directory structure, if you're using redux. However, with React hooks, this will probably be a bit different:
|
|
47
|
-
|
|
48
|
-
* `/actions`: Redux actions.
|
|
49
|
-
* `/components`: "dumb" components (no connections to Redux or Ajax). These get props and can render themselves and children.
|
|
50
|
-
* `/constants`: Constants used by Redux actions and reducers.
|
|
51
|
-
* `/containers`: "smart" components. These components are bound to Redux.
|
|
52
|
-
* `/reducers`: Reducers for redux.
|
|
53
|
-
* `/routes`: Routes for React Router.
|
|
54
|
-
* `/store`: Store, which might be [configured differently for dev vs. production](https://github.com/reactjs/redux/tree/master/examples/real-world/store).
|
|
55
|
-
* `/startup`: Component bindings to stores, with registration of components and stores.
|
|
56
|
-
* `/schemas`: Schemas for AJAX JSON requests and responses, as used by the [Normalizr](https://github.com/gaearon/normalizr) package.
|
|
57
|
-
|
|
58
|
-
## CSS, Sass, Fonts, and Images
|
|
59
|
-
Should you move your styling assets to Webpack? Or stick with the plain Rails asset pipeline. It depends! You have 2 basic choices:
|
|
60
|
-
|
|
61
|
-
### Simple Rails Way
|
|
62
|
-
This isn't really any technique, as you keep handling all your styling assets using Rails standard tools, such as using the [sass-rails gem](https://rubygems.org/gems/sass-rails/versions/5.0.4). Basically, Webpack doesn't get involved with styling. Your Rails layouts just doing the styling the standard Rails way.
|
|
63
|
-
|
|
64
|
-
#### Advantages
|
|
65
|
-
1. Much simpler! There's no changes really from your current processes.
|
|
66
|
-
|
|
67
|
-
### Using Webpack to Manage Styling Assets
|
|
68
|
-
This technique involves customization of the webpack config files to generate CSS, image, and font assets.
|
|
69
|
-
|
|
70
|
-
#### Directory structure
|
|
71
|
-
1. `/client/app/assets`: Assets for CSS for client app.
|
|
72
|
-
1. `/client/app/assets/fonts` and `/client/app/assets/styles`: Globally shared assets for styling. Note, most Sass and image assets will be stored next to the JavaScript files.
|
|
73
|
-
|
|
74
|
-
#### Advantages
|
|
75
|
-
1. You can use [CSS modules](https://github.com/css-modules/css-modules), which is super compelling once you seen the benefits.
|
|
76
|
-
1. You can do hot reloading of your assets. Thus, you do not have to refresh your web page to see asset change, including changing styles.
|
|
77
|
-
1. You can run your client code on a mocked out express server for super fast prototyping. In other words, your client application can somewhat more easily be move to a different application server.
|
data/ruby-lint.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Not currently using ruby-lint
|
|
2
|
-
---
|
|
3
|
-
presenter: syntastic
|
|
4
|
-
|
|
5
|
-
# Be sure to edit this per your project!
|
|
6
|
-
directories:
|
|
7
|
-
- app
|
|
8
|
-
- lib
|
|
9
|
-
- spec
|
|
10
|
-
|
|
11
|
-
ignore_paths:
|
|
12
|
-
- client
|
|
13
|
-
- node_modules
|
|
14
|
-
- coverage
|
|
15
|
-
- examples
|
|
16
|
-
|
|
17
|
-
analysis_classes:
|
|
18
|
-
# - argument_amount
|
|
19
|
-
- pedantics
|
|
20
|
-
- shadowing_variables
|
|
21
|
-
# Too many false positives for these
|
|
22
|
-
# - undefined_methods
|
|
23
|
-
# - undefined_variables
|
|
24
|
-
# - unused_variables
|
|
25
|
-
- useless_equality_checks
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|