react_on_rails 15.0.0.rc.2 → 16.0.1.rc.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/CHANGELOG.md +103 -34
- data/CLAUDE.md +102 -0
- data/CODING_AGENTS.md +312 -0
- data/CONTRIBUTING.md +378 -3
- data/Gemfile.lock +2 -1
- data/LICENSE.md +30 -4
- data/LICENSES/README.md +14 -0
- data/REACT-ON-RAILS-PRO-LICENSE.md +129 -0
- data/README.md +70 -20
- data/TODO.md +135 -0
- data/eslint.config.ts +5 -0
- data/knip.ts +20 -9
- data/lib/generators/USAGE +4 -5
- data/lib/generators/react_on_rails/USAGE +65 -0
- data/lib/generators/react_on_rails/base_generator.rb +263 -57
- data/lib/generators/react_on_rails/dev_tests_generator.rb +1 -0
- data/lib/generators/react_on_rails/generator_helper.rb +35 -1
- data/lib/generators/react_on_rails/generator_messages.rb +138 -17
- data/lib/generators/react_on_rails/install_generator.rb +336 -26
- data/lib/generators/react_on_rails/react_no_redux_generator.rb +19 -6
- data/lib/generators/react_on_rails/react_with_redux_generator.rb +111 -18
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev +5 -0
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-prod-assets +8 -0
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-static-assets +2 -0
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +0 -5
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/packs/server-bundle.js +1 -8
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx +21 -0
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.tsx +25 -0
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.module.css +4 -0
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.server.jsx +5 -0
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.server.tsx +5 -0
- data/lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt +1 -1
- data/lib/generators/react_on_rails/templates/base/base/app/views/layouts/hello_world.html.erb +4 -2
- data/lib/generators/react_on_rails/templates/base/base/babel.config.js.tt +5 -2
- data/lib/generators/react_on_rails/templates/base/base/bin/dev +34 -0
- data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt +3 -3
- data/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml +76 -7
- data/lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js.tt +1 -1
- data/lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt +8 -8
- data/lib/generators/react_on_rails/templates/base/base/config/webpack/production.js.tt +2 -2
- data/lib/generators/react_on_rails/templates/base/base/config/webpack/test.js.tt +2 -2
- data/lib/generators/react_on_rails/templates/dev_tests/spec/system/hello_world_spec.rb +0 -2
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/actions/helloWorldActionCreators.ts +18 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +0 -6
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +4 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.tsx +24 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/constants/helloWorldConstants.ts +6 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/containers/HelloWorldContainer.ts +20 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/reducers/helloWorldReducer.ts +22 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/startup/HelloWorldApp.client.tsx +23 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/startup/HelloWorldApp.server.jsx +5 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/startup/HelloWorldApp.server.tsx +5 -0
- data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/store/helloWorldStore.ts +18 -0
- data/lib/react_on_rails/configuration.rb +15 -11
- data/lib/react_on_rails/controller.rb +5 -3
- data/lib/react_on_rails/dev/file_manager.rb +78 -0
- data/lib/react_on_rails/dev/pack_generator.rb +27 -0
- data/lib/react_on_rails/dev/process_manager.rb +61 -0
- data/lib/react_on_rails/dev/server_manager.rb +487 -0
- data/lib/react_on_rails/dev.rb +20 -0
- data/lib/react_on_rails/doctor.rb +1149 -0
- data/lib/react_on_rails/engine.rb +6 -0
- data/lib/react_on_rails/git_utils.rb +12 -2
- data/lib/react_on_rails/helper.rb +19 -44
- data/lib/react_on_rails/packer_utils.rb +4 -18
- data/lib/react_on_rails/packs_generator.rb +134 -8
- data/lib/react_on_rails/pro/NOTICE +21 -0
- data/lib/react_on_rails/pro/helper.rb +122 -0
- data/lib/react_on_rails/pro/utils.rb +53 -0
- data/lib/react_on_rails/react_component/render_options.rb +8 -4
- data/lib/react_on_rails/server_rendering_js_code.rb +0 -1
- data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +1 -0
- data/lib/react_on_rails/system_checker.rb +659 -0
- data/lib/react_on_rails/test_helper/webpack_assets_status_checker.rb +1 -0
- data/lib/react_on_rails/utils.rb +16 -1
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/version_syntax_converter.rb +1 -1
- data/lib/react_on_rails.rb +1 -0
- data/lib/tasks/doctor.rake +51 -0
- data/lib/tasks/generate_packs.rake +144 -1
- data/package-lock.json +11984 -0
- data/react_on_rails.gemspec +1 -0
- metadata +55 -11
- data/REACT-ON-RAILS-PRO-LICENSE +0 -95
- data/lib/generators/react_on_rails/adapt_for_older_shakapacker_generator.rb +0 -41
- data/lib/generators/react_on_rails/bin/dev +0 -30
- data/lib/generators/react_on_rails/bin/dev-static +0 -30
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-static.tt +0 -9
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt +0 -5
- data/lib/generators/react_on_rails/templates/base/base/app/javascript/packs/registration.js.tt +0 -8
- /data/lib/generators/react_on_rails/templates/base/base/config/webpack/{webpackConfig.js.tt → generateWebpackConfigs.js.tt} +0 -0
- /data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/startup/{HelloWorldApp.jsx → HelloWorldApp.client.jsx} +0 -0
data/CONTRIBUTING.md
CHANGED
@@ -79,11 +79,11 @@ yalc add react-on-rails
|
|
79
79
|
The workflow is:
|
80
80
|
|
81
81
|
1. Make changes to the node package.
|
82
|
-
2.
|
82
|
+
2. **CRITICAL**: Run yalc push to send updates to all linked apps:
|
83
83
|
|
84
84
|
```
|
85
85
|
cd <top dir>
|
86
|
-
# Will send the updates to other folders
|
86
|
+
# Will send the updates to other folders - MUST DO THIS AFTER ANY CHANGES
|
87
87
|
yalc push
|
88
88
|
cd spec/dummy
|
89
89
|
|
@@ -91,6 +91,8 @@ cd spec/dummy
|
|
91
91
|
yarn
|
92
92
|
```
|
93
93
|
|
94
|
+
**⚠️ Common Mistake**: Forgetting to run `yalc push` after making changes to React on Rails source code will result in test apps not receiving updates, making it appear that your changes have no effect.
|
95
|
+
|
94
96
|
When you run `yalc push`, you'll get an informative message
|
95
97
|
|
96
98
|
```
|
@@ -180,6 +182,42 @@ cd react_on_rails/
|
|
180
182
|
yarn run check
|
181
183
|
```
|
182
184
|
|
185
|
+
## Development Commands
|
186
|
+
|
187
|
+
### Code Formatting
|
188
|
+
|
189
|
+
To format JavaScript/TypeScript files with Prettier:
|
190
|
+
|
191
|
+
```sh
|
192
|
+
yarn start format
|
193
|
+
```
|
194
|
+
|
195
|
+
To check formatting without fixing:
|
196
|
+
|
197
|
+
```sh
|
198
|
+
yarn start format.listDifferent
|
199
|
+
```
|
200
|
+
|
201
|
+
### Linting
|
202
|
+
|
203
|
+
Run all linters (ESLint and RuboCop):
|
204
|
+
|
205
|
+
```sh
|
206
|
+
rake lint
|
207
|
+
```
|
208
|
+
|
209
|
+
Run only RuboCop:
|
210
|
+
|
211
|
+
```sh
|
212
|
+
rake lint:rubocop
|
213
|
+
```
|
214
|
+
|
215
|
+
Run only ESLint:
|
216
|
+
|
217
|
+
```sh
|
218
|
+
yarn run lint
|
219
|
+
```
|
220
|
+
|
183
221
|
### Starting the Dummy App
|
184
222
|
|
185
223
|
To run the dummy app, it's **CRITICAL** to not just run `rails s`. You have to run `foreman start` with one of the Procfiles. If you don't do this, then `webpack` will not generate a new bundle, and you will be seriously confused when you change JavaScript and the app does not change. If you change the Webpack configs, then you need to restart Foreman. If you change the JS code for react-on-rails, you need to run `yarn run build` in the project root.
|
@@ -210,7 +248,7 @@ gem 'react_on_rails', path: '../relative/path/to/react_on_rails'
|
|
210
248
|
|
211
249
|
Then run `bundle`.
|
212
250
|
|
213
|
-
The main installer can be run with
|
251
|
+
The main installer can be run with `./bin/rails generate react_on_rails:install`
|
214
252
|
|
215
253
|
Then use yalc to add the npm module.
|
216
254
|
|
@@ -232,6 +270,269 @@ The generators are covered by generator tests using Rails's generator testing he
|
|
232
270
|
|
233
271
|
`rake run_rspec:shakapacker_examples_basic` is a great way to run tests on one generator. Once that works, you should run `rake run_rspec:shakapacker_examples`. Be aware that this will create a huge number of files under a `/gen-examples` directory. You should be sure to exclude this directory from your IDE and delete it once your testing is done.
|
234
272
|
|
273
|
+
#### Manual Generator Testing Workflow
|
274
|
+
|
275
|
+
For comprehensive testing of generator changes, use this manual testing workflow with dedicated test applications:
|
276
|
+
|
277
|
+
**1. Set up test application with clean baseline:**
|
278
|
+
|
279
|
+
```bash
|
280
|
+
# Create a test Rails app
|
281
|
+
mkdir -p {project_dir}/test-app
|
282
|
+
cd {project_dir}/test-app
|
283
|
+
rails new . --skip-javascript
|
284
|
+
|
285
|
+
# Set up for testing the generator
|
286
|
+
echo 'gem "react_on_rails", path: "../react_on_rails"' >> Gemfile
|
287
|
+
yalc add react-on-rails
|
288
|
+
|
289
|
+
# Create a clean baseline tag for testing
|
290
|
+
git init && git add . && git commit -m "Initial commit"
|
291
|
+
git tag generator_testing_base
|
292
|
+
bundle install
|
293
|
+
|
294
|
+
# Clean reset to baseline state
|
295
|
+
git clean -fd && git reset --hard && git clean -fd
|
296
|
+
```
|
297
|
+
|
298
|
+
**2. Test generator commits systematically:**
|
299
|
+
|
300
|
+
When testing specific generator improvements or fixes, test both Shakapacker scenarios:
|
301
|
+
|
302
|
+
**Scenario A: No Shakapacker installed (fresh Rails app)**
|
303
|
+
|
304
|
+
```bash
|
305
|
+
# Reset to clean baseline before each test
|
306
|
+
git clean -fd && git reset --hard generator_testing_base && git clean -fd
|
307
|
+
|
308
|
+
# Ensure no Shakapacker in Gemfile (remove if present)
|
309
|
+
# Edit Gemfile to update gem path: gem 'react_on_rails', path: '../path/to/main/repo'
|
310
|
+
bundle install
|
311
|
+
|
312
|
+
# Run generator - should install Shakapacker automatically
|
313
|
+
./bin/rails generate react_on_rails:install
|
314
|
+
|
315
|
+
# Verify Shakapacker was added to Gemfile and installed correctly
|
316
|
+
```
|
317
|
+
|
318
|
+
**Scenario B: Shakapacker already installed**
|
319
|
+
|
320
|
+
```bash
|
321
|
+
# Reset to clean baseline
|
322
|
+
git clean -fd && git reset --hard generator_testing_base && git clean -fd
|
323
|
+
|
324
|
+
# Add Shakapacker to Gemfile
|
325
|
+
bundle add shakapacker --strict
|
326
|
+
|
327
|
+
# Run Shakapacker installer first
|
328
|
+
./bin/rails shakapacker:install
|
329
|
+
|
330
|
+
# Edit Gemfile to update gem path: gem 'react_on_rails', path: '../path/to/main/repo'
|
331
|
+
bundle install
|
332
|
+
|
333
|
+
# Run generator - should detect existing Shakapacker
|
334
|
+
./bin/rails generate react_on_rails:install
|
335
|
+
|
336
|
+
# Verify generator adapts to existing Shakapacker setup
|
337
|
+
```
|
338
|
+
|
339
|
+
**3. Document testing results:**
|
340
|
+
|
341
|
+
For each commit tested, document:
|
342
|
+
|
343
|
+
- Generator execution success/failure for both scenarios
|
344
|
+
- Shakapacker installation/detection behavior
|
345
|
+
- Component rendering in browser
|
346
|
+
- Console output and warnings
|
347
|
+
- File generation differences between scenarios
|
348
|
+
- Specific issues found
|
349
|
+
|
350
|
+
This systematic approach ensures generator changes work correctly whether Shakapacker is pre-installed or needs to be installed by the generator.
|
351
|
+
|
352
|
+
#### Testing Generator with Yalc for React Component Functionality
|
353
|
+
|
354
|
+
When testing the install generator with new Rails apps, you need to use **yalc** for the JavaScript package to ensure React components work correctly. The Ruby gem path reference is insufficient for client-side rendering.
|
355
|
+
|
356
|
+
**Problem**: Using only the gem path (`gem "react_on_rails", path: "../path"`) in a new Rails app results in React components not mounting on the client side, even though server-side rendering works fine.
|
357
|
+
|
358
|
+
**Solution**: Use both gem path and yalc for complete testing:
|
359
|
+
|
360
|
+
```ruby
|
361
|
+
# In test app's Gemfile
|
362
|
+
gem 'react_on_rails', path: '../relative/path/to/react_on_rails'
|
363
|
+
```
|
364
|
+
|
365
|
+
```bash
|
366
|
+
# After running the install generator AND after making any changes to the React on Rails source code
|
367
|
+
cd /path/to/react_on_rails
|
368
|
+
npm run build
|
369
|
+
npx yalc publish
|
370
|
+
# CRITICAL: Push changes to all linked apps
|
371
|
+
npx yalc push
|
372
|
+
|
373
|
+
cd /path/to/test_app
|
374
|
+
npm install
|
375
|
+
|
376
|
+
# Restart development server
|
377
|
+
bin/dev
|
378
|
+
```
|
379
|
+
|
380
|
+
**⚠️ CRITICAL DEBUGGING NOTE:**
|
381
|
+
Always run `yalc push` after making changes to React on Rails source code. Without this step, your test app won't receive the updated package, leading to confusing behavior where changes appear to have no effect.
|
382
|
+
|
383
|
+
**Alternative to Yalc: npm pack (More Reliable)**
|
384
|
+
For a more reliable alternative that exactly mimics real package installation:
|
385
|
+
|
386
|
+
```bash
|
387
|
+
# In react_on_rails directory
|
388
|
+
npm run build
|
389
|
+
npm pack # Creates react-on-rails-15.0.0.tgz
|
390
|
+
|
391
|
+
# In test app directory
|
392
|
+
npm install ../path/to/react_on_rails/react-on-rails-15.0.0.tgz
|
393
|
+
```
|
394
|
+
|
395
|
+
This approach:
|
396
|
+
|
397
|
+
- ✅ Exactly mimics real package installation
|
398
|
+
- ✅ No symlink issues across different filesystems
|
399
|
+
- ✅ More reliable for CI/CD testing
|
400
|
+
- ⚠️ Requires manual step after each change (can be scripted)
|
401
|
+
|
402
|
+
**Why this is needed**:
|
403
|
+
|
404
|
+
- The gem provides Rails integration and server-side rendering
|
405
|
+
- Yalc provides the complete JavaScript client library needed for component mounting
|
406
|
+
- Without yalc, you'll see empty divs where React components should render
|
407
|
+
|
408
|
+
**Verification**:
|
409
|
+
|
410
|
+
- Visit the hello_world page in browser
|
411
|
+
- Check browser console for "RENDERED HelloWorld to dom node" success message
|
412
|
+
- Confirm React component is interactive (input field updates name display)
|
413
|
+
|
414
|
+
**Development Mode Console Output**:
|
415
|
+
|
416
|
+
- `bin/dev` (HMR): Shows HMR warnings and resource preload warnings (expected)
|
417
|
+
- `bin/dev static`: Shows only resource preload warnings (cleaner output)
|
418
|
+
- `bin/dev prod`: Cleanest output with minimal warnings (production-like environment)
|
419
|
+
|
420
|
+
**Note**: Resource preload warnings in development modes are normal and can be ignored. They occur because Shakapacker generates preload tags but scripts load asynchronously. Production mode eliminates most of these warnings.
|
421
|
+
|
422
|
+
#### Generator Testing Troubleshooting
|
423
|
+
|
424
|
+
**Common Issues and Solutions:**
|
425
|
+
|
426
|
+
1. **React components not rendering (empty divs)**
|
427
|
+
|
428
|
+
- **Cause**: Missing yalc setup for JavaScript package
|
429
|
+
- **Solution**: Follow yalc setup steps above after running generator
|
430
|
+
|
431
|
+
2. **Generator fails with Shakapacker errors**
|
432
|
+
|
433
|
+
- **Cause**: Conflicting Shakapacker versions or incomplete installation
|
434
|
+
- **Solution**: Clean reset and ensure consistent Shakapacker version across tests
|
435
|
+
|
436
|
+
3. **Babel configuration conflicts during yalc development**
|
437
|
+
|
438
|
+
- **Cause**: Both `babel.config.js` and `package.json` "babel" section defining presets
|
439
|
+
- **Solution**: Remove "babel" section from `package.json`, keep only `babel.config.js`
|
440
|
+
|
441
|
+
4. **"Package.json not found" errors**
|
442
|
+
|
443
|
+
- **Cause**: Generator trying to access non-existent package.json files
|
444
|
+
- **Solution**: Test with commits that fix this specific issue (e.g., bc69dcd0)
|
445
|
+
|
446
|
+
5. **Port conflicts during testing**
|
447
|
+
- **Cause**: Multiple development servers running
|
448
|
+
- **Solution**: Run `bin/dev kill` before starting new test servers
|
449
|
+
|
450
|
+
**Testing Best Practices:**
|
451
|
+
|
452
|
+
- Always use the double clean command: `git clean -fd && git reset --hard && git clean -fd`
|
453
|
+
- Test both Shakapacker scenarios for comprehensive coverage
|
454
|
+
- Document exact error messages and steps to reproduce
|
455
|
+
- Verify React component interactivity, not just rendering
|
456
|
+
- Test all development modes: `bin/dev`, `bin/dev static`, `bin/dev prod`
|
457
|
+
|
458
|
+
## Pre-Commit Requirements
|
459
|
+
|
460
|
+
**CRITICAL**: Before committing any changes, always run the following commands to ensure code quality:
|
461
|
+
|
462
|
+
```bash
|
463
|
+
# Navigate to the main react_on_rails directory
|
464
|
+
cd react_on_rails/
|
465
|
+
|
466
|
+
# Run Prettier for JavaScript/TypeScript formatting
|
467
|
+
yarn run format
|
468
|
+
|
469
|
+
# Run ESLint for JavaScript/TypeScript linting
|
470
|
+
yarn run lint
|
471
|
+
|
472
|
+
# Run RuboCop for Ruby linting and formatting
|
473
|
+
rake lint:rubocop
|
474
|
+
|
475
|
+
# Or run all linters together
|
476
|
+
rake lint
|
477
|
+
```
|
478
|
+
|
479
|
+
**Automated checks:**
|
480
|
+
|
481
|
+
- Format all JavaScript/TypeScript files with Prettier
|
482
|
+
- Check and fix linting issues with ESLint
|
483
|
+
- Check and fix Ruby style issues with RuboCop
|
484
|
+
- Ensure all tests pass before pushing
|
485
|
+
|
486
|
+
**Tip**: Set up your IDE to run these automatically on save to catch issues early.
|
487
|
+
|
488
|
+
## 🤖 Best Practices for AI Coding Agents
|
489
|
+
|
490
|
+
**CRITICAL WORKFLOW** to prevent CI failures:
|
491
|
+
|
492
|
+
### 1. **After Making Code Changes**
|
493
|
+
|
494
|
+
```bash
|
495
|
+
# Auto-fix all linting violations after code changes
|
496
|
+
rake autofix
|
497
|
+
```
|
498
|
+
|
499
|
+
### 2. **Common AI Agent Mistakes**
|
500
|
+
|
501
|
+
❌ **DON'T:**
|
502
|
+
|
503
|
+
- Commit code that hasn't been linted locally
|
504
|
+
- Ignore formatting rules when creating new files
|
505
|
+
- Add manual formatting that conflicts with Prettier/RuboCop
|
506
|
+
|
507
|
+
✅ **DO:**
|
508
|
+
|
509
|
+
- Run `rake lint` after any code changes
|
510
|
+
- Use `rake autofix` to automatically fix all linting violations
|
511
|
+
- Create new files that follow existing patterns
|
512
|
+
- Test locally before committing
|
513
|
+
|
514
|
+
### 4. **Template File Best Practices**
|
515
|
+
|
516
|
+
When creating new template files (`.jsx`, `.rb`, etc.):
|
517
|
+
|
518
|
+
1. Copy existing template structure and patterns
|
519
|
+
2. Run `yarn run eslint . --fix` immediately after creation
|
520
|
+
3. Verify with `rake lint` before committing
|
521
|
+
|
522
|
+
### 5. **RuboCop Complexity Issues**
|
523
|
+
|
524
|
+
For methods with high ABC complexity (usually formatting/display methods):
|
525
|
+
|
526
|
+
```ruby
|
527
|
+
# rubocop:disable Metrics/AbcSize
|
528
|
+
def complex_formatting_method
|
529
|
+
# ... method with lots of string interpolation/formatting
|
530
|
+
end
|
531
|
+
# rubocop:enable Metrics/AbcSize
|
532
|
+
```
|
533
|
+
|
534
|
+
**Remember**: Failing CI wastes time and resources. Always lint locally first!
|
535
|
+
|
235
536
|
### Linting
|
236
537
|
|
237
538
|
All linting is performed from the docker container for CI. You will need docker and docker-compose installed locally to lint code changes via the lint container. You can lint locally by running `npm run lint && npm run flow`
|
@@ -273,3 +574,77 @@ Run `docker-compose build tests` to build the tests container. Run `docker-compo
|
|
273
574
|
What do project maintainers do? What sort of work is involved? [sstephenson](https://github.com/sstephenson) wrote in the [turbolinks](https://github.com/turbolinks/turbolinks) repo:
|
274
575
|
|
275
576
|
> [Why this is not still fully merged?](https://github.com/turbolinks/turbolinks/pull/124#issuecomment-239826060)
|
577
|
+
|
578
|
+
# 📦 Demo Naming and README Standards
|
579
|
+
|
580
|
+
To keep our React on Rails demos clear, discoverable, and SEO-friendly, all demo repos follow a standardized naming and documentation structure.
|
581
|
+
|
582
|
+
---
|
583
|
+
|
584
|
+
## ✅ Repository Naming Convention
|
585
|
+
|
586
|
+
Use the format:
|
587
|
+
|
588
|
+
```
|
589
|
+
react_on_rails-demo-v[REACT_ON_RAILS_VERSION]-[key-topics]
|
590
|
+
```
|
591
|
+
|
592
|
+
**Examples:**
|
593
|
+
|
594
|
+
- `react_on_rails-demo-v15-ssr-auto-registration-bundle-splitting`
|
595
|
+
- `react_on_rails-demo-v15-react-server-components`
|
596
|
+
- `react_on_rails-demo-v15-typescript-setup`
|
597
|
+
- `react_on_rails-demo-v15-cypress-setup`
|
598
|
+
|
599
|
+
**Why this format?**
|
600
|
+
|
601
|
+
- Clear versioning and purpose
|
602
|
+
- Easy to discover in GitHub, search engines, and documentation
|
603
|
+
- Consistent prefix for grouping demos together
|
604
|
+
|
605
|
+
---
|
606
|
+
|
607
|
+
## 📝 README Title Format
|
608
|
+
|
609
|
+
```
|
610
|
+
# React on Rails Demo: [Topics] with v[VERSION] and Rails [VERSION]
|
611
|
+
```
|
612
|
+
|
613
|
+
**Example:**
|
614
|
+
|
615
|
+
```
|
616
|
+
# React on Rails Demo: SSR, Auto-Registration & Bundle Splitting with v15 and Rails 8
|
617
|
+
```
|
618
|
+
|
619
|
+
---
|
620
|
+
|
621
|
+
## 📄 README Description Template
|
622
|
+
|
623
|
+
```
|
624
|
+
A fully working demo of React on Rails v[VERSION] on Rails [VERSION], showcasing [topics].
|
625
|
+
|
626
|
+
✅ Includes:
|
627
|
+
- [Topic 1]
|
628
|
+
- [Topic 2]
|
629
|
+
- [Topic 3]
|
630
|
+
|
631
|
+
📂 Repo name: `react_on_rails-demo-v[VERSION]-[topics]`
|
632
|
+
|
633
|
+
📚 Part of the [React on Rails Demo Series](https://github.com/shakacode?tab=repositories&q=react_on_rails-demo)
|
634
|
+
```
|
635
|
+
|
636
|
+
**Example:**
|
637
|
+
|
638
|
+
```
|
639
|
+
A fully working demo of React on Rails v15 on Rails 8, showcasing server-side rendering, file-system-based auto-registration, and intelligent bundle splitting.
|
640
|
+
|
641
|
+
✅ Includes:
|
642
|
+
- Server-Side Rendering (SSR)
|
643
|
+
- Auto-discovered components based on file structure
|
644
|
+
- Lightweight vs. heavy component splitting
|
645
|
+
- Fix for “package.json not found” install bug
|
646
|
+
|
647
|
+
📂 Repo name: `react_on_rails-demo-v15-ssr-auto-registration-bundle-splitting`
|
648
|
+
|
649
|
+
📚 Part of the [React on Rails Demo Series](https://github.com/shakacode?tab=repositories&q=react_on_rails-demo)
|
650
|
+
```
|
data/Gemfile.lock
CHANGED
data/LICENSE.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
|
-
#
|
1
|
+
# Licensing
|
2
2
|
|
3
|
-
|
3
|
+
- **Core**: MIT (this file)
|
4
|
+
- **Pro**: see [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md)
|
5
|
+
|
6
|
+
---
|
7
|
+
|
8
|
+
## MIT License for Core React on Rails
|
9
|
+
|
10
|
+
This license applies to all files within this repository, with the exception of the code located in the following directories, which are licensed separately under the React on Rails Pro License:
|
11
|
+
|
12
|
+
- `lib/react_on_rails/pro/`
|
13
|
+
- `node_package/src/pro/`
|
14
|
+
|
15
|
+
Copyright (c) 2017, 2018 Justin Gordon and ShakaCode
|
16
|
+
Copyright (c) 2015–2025 ShakaCode, LLC
|
4
17
|
|
5
18
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
19
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -12,10 +25,23 @@ furnished to do so, subject to the following conditions:
|
|
12
25
|
The above copyright notice and this permission notice shall be included in
|
13
26
|
all copies or substantial portions of the Software.
|
14
27
|
|
28
|
+
---
|
29
|
+
|
30
|
+
## Disclaimer
|
31
|
+
|
15
32
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
33
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
34
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
35
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
36
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
|
37
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
38
|
+
SOFTWARE.
|
39
|
+
|
40
|
+
---
|
41
|
+
|
42
|
+
## React on Rails Pro License
|
43
|
+
|
44
|
+
The code in the directories listed above is part of the React on Rails Pro framework and is licensed under the React on Rails Pro License.
|
45
|
+
|
46
|
+
You can find the full text of the license agreement here:
|
47
|
+
[REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md)
|
data/LICENSES/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Licensing Overview
|
2
|
+
|
3
|
+
This repository uses a dual-licensing model:
|
4
|
+
|
5
|
+
- [LICENSE.md](../LICENSE.md) – **MIT** license for the core React on Rails library
|
6
|
+
- [REACT-ON-RAILS-PRO-LICENSE.md](../REACT-ON-RAILS-PRO-LICENSE.md) – **commercial license** for React on Rails Pro
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
## Summary
|
11
|
+
|
12
|
+
- Core (MIT) → free and open-source for any use
|
13
|
+
- Pro → free for non-commercial, educational, and demo use
|
14
|
+
- **Production Use** (including by non-profits) requires a paid subscription
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# ShakaCode React on Rails Pro – End User License Agreement (EULA)
|
2
|
+
|
3
|
+
_Version 2.0 — 2025-09-06_
|
4
|
+
© 2015–2025 ShakaCode, LLC. All rights reserved.
|
5
|
+
|
6
|
+
---
|
7
|
+
|
8
|
+
## 1. Definitions
|
9
|
+
|
10
|
+
- **Organization** – the single legal entity identified in the order (e.g., GitHub Sponsors, invoice).
|
11
|
+
- **Production Use** – any use of the Software in connection with a live application, website, or service accessed by end users **other than**:
|
12
|
+
- evaluation or testing
|
13
|
+
- classroom instruction, tutorials, workshops, coursework
|
14
|
+
- recorded demos, livestreams, or videos
|
15
|
+
- personal/hobby experiments not offered as a service
|
16
|
+
|
17
|
+
---
|
18
|
+
|
19
|
+
## 2. Grant of License (Per-Organization)
|
20
|
+
|
21
|
+
ShakaCode grants the subscribing Organization a **non-exclusive, non-transferable, revocable** license to install and use React on Rails Pro (“Software”) for the Organization’s internal applications.
|
22
|
+
|
23
|
+
- Internal modifications are allowed.
|
24
|
+
- Redistribution, sublicensing, or hosting the Software for third parties is prohibited.
|
25
|
+
|
26
|
+
---
|
27
|
+
|
28
|
+
## 3. Consulting Firms and Individual Consultants
|
29
|
+
|
30
|
+
- **Consulting Firms** – this license covers only the firm’s own internal systems. Each client Organization requires its own license for any Production Use.
|
31
|
+
- **Individual Consultants** – this license covers only the consultant’s own projects personally operated by them, not client organizations. Each client Organization must obtain its own license.
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
## 4. Non-Commercial / Educational / Demo Use (Free)
|
36
|
+
|
37
|
+
Free, royalty-free use is permitted for:
|
38
|
+
|
39
|
+
- classroom instruction, training, workshops, coursework;
|
40
|
+
- tutorials, blog posts, livestreams, or videos;
|
41
|
+
- personal/hobby projects not used in production;
|
42
|
+
- demo apps showcasing coding techniques.
|
43
|
+
|
44
|
+
**Note:** This clause does **not** permit any Production Use by any entity (commercial, non-profit, or individual). All Production Use requires a paid subscription under this Agreement.
|
45
|
+
|
46
|
+
---
|
47
|
+
|
48
|
+
## 5. Restrictions
|
49
|
+
|
50
|
+
The Organization shall not:
|
51
|
+
|
52
|
+
1. redistribute or resell the Software or derivatives;
|
53
|
+
2. remove, obfuscate, or disable required attribution;
|
54
|
+
3. use the Software to build a directly competing product exposing substantially similar functionality.
|
55
|
+
|
56
|
+
---
|
57
|
+
|
58
|
+
## 6. Attribution (HTML Source)
|
59
|
+
|
60
|
+
Pages rendered using the Software must include a retained non-visual attribution comment in the HTML source (provided by the software):
|
61
|
+
|
62
|
+
```html
|
63
|
+
<!-- Powered by React on Rails Pro (c) ShakaCode -->
|
64
|
+
```
|
65
|
+
|
66
|
+
The Organization may not remove or obfuscate this attribution.
|
67
|
+
|
68
|
+
---
|
69
|
+
|
70
|
+
## 7. Fees; Term; Termination
|
71
|
+
|
72
|
+
Fees and billing terms are as agreed in the applicable order (e.g., GitHub Sponsors subscription or annual invoice).
|
73
|
+
The license remains active only while fees are paid. ShakaCode may suspend or terminate for non-payment or material breach.
|
74
|
+
Upon termination or lapse, the Organization must immediately cease use and remove the Software (including derivatives) from all Production systems and repositories, except for non-commercial uses explicitly permitted in Section 4.
|
75
|
+
|
76
|
+
---
|
77
|
+
|
78
|
+
## 8. Updates & Support
|
79
|
+
|
80
|
+
While subscribed, the Organization receives software updates and reasonable support (email or issue tracker, business hours). No specific response or resolution times are guaranteed unless set out in an order or separate SLA.
|
81
|
+
|
82
|
+
---
|
83
|
+
|
84
|
+
## 9. Verification / Audit
|
85
|
+
|
86
|
+
If ShakaCode reasonably suspects non-compliance, the Organization will cooperate in good faith to verify compliance, including enabling inspection for attribution presence and providing a usage statement. ShakaCode will use commercially reasonable efforts to minimize disruption.
|
87
|
+
|
88
|
+
---
|
89
|
+
|
90
|
+
## 10. Feedback & Contributions
|
91
|
+
|
92
|
+
By submitting feedback or improvements, the Organization grants ShakaCode a worldwide, royalty-free, irrevocable license to use and incorporate them.
|
93
|
+
|
94
|
+
---
|
95
|
+
|
96
|
+
## 11. Intellectual Property
|
97
|
+
|
98
|
+
The Software is **licensed, not sold**. ShakaCode retains all rights, title, and interest, including all intellectual property rights.
|
99
|
+
|
100
|
+
---
|
101
|
+
|
102
|
+
## 12. Confidentiality
|
103
|
+
|
104
|
+
License keys and any non-public materials are ShakaCode confidential information. The Organization will protect them with at least reasonable care.
|
105
|
+
|
106
|
+
---
|
107
|
+
|
108
|
+
## 13. Warranty Disclaimer
|
109
|
+
|
110
|
+
> EXCEPT AS EXPRESSLY PROVIDED IN §8, THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED.
|
111
|
+
|
112
|
+
---
|
113
|
+
|
114
|
+
## 14. Limitation of Liability
|
115
|
+
|
116
|
+
To the maximum extent permitted by law, ShakaCode is not liable for indirect, incidental, special, consequential, or punitive damages.
|
117
|
+
Direct damages are limited to amounts paid in the 12 months preceding the claim.
|
118
|
+
|
119
|
+
---
|
120
|
+
|
121
|
+
## 15. Governing Law; Venue
|
122
|
+
|
123
|
+
Choose one: **State of Hawaii**, USA. Exclusive jurisdiction and venue lie in the courts located therein.
|
124
|
+
|
125
|
+
---
|
126
|
+
|
127
|
+
## 16. Entire Agreement; Order of Precedence
|
128
|
+
|
129
|
+
This EULA and any order (pricing/term) are the entire agreement. If there is a conflict, the order controls.
|