Skip to content

Fix Unify minimum Shakapacker versions #2225#2247

Merged
justin808 merged 20 commits intomasterfrom
justin808-shakapacker-version
Jan 25, 2026
Merged

Fix Unify minimum Shakapacker versions #2225#2247
justin808 merged 20 commits intomasterfrom
justin808-shakapacker-version

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Dec 25, 2025

Summary

This PR addresses #2225 by unifying Shakapacker minimum version requirements. The key changes:

  • Removed obsolete version checks: Eliminated the MINIMUM_SHAKAPACKER_VERSION constant (6.5.1) that was redundant with the gemspec constraint (shakapacker >= 6.0)
  • Removed example pinning: Stopped hardcoding Shakapacker 8.2.0 in example generation - examples now rely on the gemspec dependency
  • Kept autobundling requirement: The MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING (7.0.0) remains as it's actively used to validate autobundling feature requirements
  • Updated documentation: README now clarifies CI-tested versions (8.2.0 - 9.4.0) vs. theoretical minimum (6.0)

Pull Request checklist

  • Add/update test to cover these changes (obsolete tests removed)
  • Update documentation (README and CHANGELOG updated)
  • Update CHANGELOG file

Version Requirements After This PR

Requirement Version Notes
Minimum (gemspec) >= 6.0 Theoretical minimum for basic functionality
Autobundling >= 7.0.0 Required for nested_entries support
CI Tested 8.2.0 - 9.4.0 Actually validated in CI matrix

Summary by CodeRabbit

  • Documentation

    • Updated React on Rails Pro to reference React 19 and clarified Shakapacker prerequisites (minimum >= 6.0; CI-tested range 8.2.0–9.5.0; autobundling requires >= 7.0.0). Revised testing guide and changelog to reflect simplified Shakapacker guidance.
  • Chores

    • CI and example messaging updated to Shakapacker 9.5.0; removed obsolete pinning and minimum-version checks and adjusted related generation/messaging.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Removed explicit Shakapacker minimum-version checks and helper pinning logic, simplified autobundling error messaging, bumped CI/dev Shakapacker pins to 9.5.0, updated docs/CI references to React 19 and "latest" Shakapacker, and removed related tests/constants/helpers. All other flows unchanged.

Changes

Cohort / File(s) Summary
Docs & CI
README.md, SWITCHING_CI_CONFIGS.md, /.claude/docs/pr-testing-guide.md, .github/workflows/examples.yml
Updated React references to React 19 and Shakapacker mentions (latest / ranges); CI/test step descriptions adjusted.
Rake tasks & example generation
react_on_rails/rakelib/run_rspec.rake, react_on_rails/rakelib/shakapacker_examples.rake, react_on_rails/rakelib/example_type.rb
Removed Gemfile/package pinning helpers and calls, deleted MINIMUM_SHAKAPACKER_VERSION, removed a debug print, and simplified generator/task messaging.
Configuration & utilities
react_on_rails/lib/react_on_rails/configuration.rb, react_on_rails/lib/react_on_rails/packer_utils.rb, react_on_rails/lib/react_on_rails/packs_generator.rb
Deleted check_minimum_shakapacker_version, removed supports_basic_pack_generation? and its related raise method, simplified autobundling incompatibility message, and removed MINIMUM_SHAKAPACKER_VERSION constant.
Signatures & types
react_on_rails/sig/react_on_rails/configuration.rbs, react_on_rails/sig/react_on_rails/packer_utils.rbs
Removed RBS signatures for the deleted minimum-version check and basic-pack-generation methods.
Tests & changelog
react_on_rails/spec/react_on_rails/packer_utils_spec.rb, CHANGELOG.md
Removed tests asserting basic-pack-generation/version constants; added changelog entry documenting simplified Shakapacker handling.
Dev dependencies & dummy apps
react_on_rails/Gemfile.development_dependencies, react_on_rails/spec/dummy/package.json, react_on_rails_pro/Gemfile.development_dependencies, react_on_rails_pro/spec/dummy/package.json
Bumped Shakapacker dev dependency from 9.4.09.5.0; removed an explicit Ruby version line in pro Gemfile fragment.
Gemspec comment
react_on_rails/react_on_rails.gemspec
Added comment lines documenting minimum Shakapacker requirements referencing the auto-bundling constant.

Sequence Diagram(s)

(Skipped — changes remove/simplify version checks and update docs/CI; no new multi-component sequential flow to visualize.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • Judahmeek
  • alexeyr-ci2
  • AbanoubGhadban

Poem

🐇 I nudged the pins and let them slide,

Docs refreshed, and tests simplified.
React nineteen hops into the sun,
Shakapacker bumped — the job is done. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title partially captures the PR's scope but uses non-standard phrasing ('Fix Unify') that may confuse readers scanning commit history. Consider rephrasing to 'Unify Shakapacker minimum version requirements' or 'Simplify Shakapacker version validation' for clarity and convention.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin808-shakapacker-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@justin808 justin808 force-pushed the justin808-shakapacker-version branch from fa1a2db to de16986 Compare December 25, 2025 05:34
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review - PR #2247

Summary

This PR addresses issue #2225 by attempting to unify minimum Shakapacker version references across the codebase. However, there are critical issues that need to be addressed before merging.


🔴 Critical Issues

1. Incorrect Version Change in example_type.rb (Line 31)

- MINIMUM_SHAKAPACKER_VERSION = "8.2.0"
+ MINIMUM_SHAKAPACKER_VERSION = "6.5.1"

Problem: This change is INCORRECT and breaks the purpose of this constant.

  • The constant MINIMUM_SHAKAPACKER_VERSION in example_type.rb:31 is used for the MINIMUM CI configuration, not the gem's minimum requirement
  • According to issue Unify minimum Shakapacker versions #2225 and the code context, this constant defines what version is used when testing backward compatibility with older Shakapacker versions
  • The gem's actual minimum requirement is 6.5.1 (enforced in packs_generator.rb:11)
  • The CI minimum test configuration uses 8.2.0 to test compatibility (see SWITCHING_CI_CONFIGS.md)

Why this matters:

  • example_type.rb generates test examples for different configurations
  • The minimum CI configuration tests compatibility with Shakapacker 8.2.0 (as documented in SWITCHING_CI_CONFIGS.md:127)
  • Changing this to 6.5.1 would break the CI minimum configuration setup

Correct approach: This constant should remain 8.2.0 because it represents the minimum version tested in CI, NOT the gem's minimum requirement.

2. Removed Debug Output (Line 82 in run_rspec.rake)

- puts "Creating #{example_type.rspec_task_name} task"

Problem: This removal is unrelated to the issue and wasn't mentioned in the PR description.

Questions:

  • Why was this debug line removed?
  • Was it causing issues in CI output?
  • This should be a separate commit/PR or at least mentioned in the PR description

✅ Correct Changes

1. Documentation Updates

The following changes are correct and align with current usage:

  • .claude/docs/pr-testing-guide.md: Updated 9.3.0 → 9.4.0 (matches current dummy/package.json)
  • README.md: Updated React 18 → React 19 for Pro features (reflects current support)
  • SWITCHING_CI_CONFIGS.md: Updated 9.3.0 → 9.4.0 (matches latest config)

📋 What Still Needs to be Done

According to issue #2225, the original problem was three different minimum versions:

  1. README.md says >= 6.0 → Should be >= 6.5.1 (NOT addressed in this PR)
  2. packs_generator.rb says 6.5.1 → Correct, this is the enforced minimum
  3. example_type.rb says 8.2.0 → This is CORRECT for CI minimum testing (should NOT be changed)

Missing fix: The README.md needs updating from >= 6.0 to >= 6.5.1 to match the actual enforced minimum.


🔍 Additional Context

From the codebase analysis:

  1. Gem dependency (react_on_rails.gemspec:35): shakapacker >= 6.0

    • Should probably be >= 6.5.1 to match enforced minimum
  2. Enforced minimum (packs_generator.rb:11): MINIMUM_SHAKAPACKER_VERSION = "6.5.1"

    • This is the actual minimum version that raises errors if not met
  3. CI minimum config (example_type.rb:31): MINIMUM_SHAKAPACKER_VERSION = "8.2.0"

    • This tests backward compatibility with Shakapacker 8.2.0
    • Different purpose than the gem's minimum requirement

🛠️ Recommended Actions

  1. Revert the change to example_type.rb:31 - keep it as 8.2.0
  2. Update README.md prerequisites from >= 6.0 to >= 6.5.1
  3. Update gemspec dependency from >= 6.0 to >= 6.5.1
  4. Either revert or explain the run_rspec.rake change - it's unrelated to this issue
  5. Add/update CHANGELOG.md per the PR checklist
  6. Fill out the PR description properly instead of leaving template text

📝 PR Description Issues

The PR description still contains placeholder text:

Remove this paragraph and provide a general description...

Please update with:

  • What the issue was (inconsistent Shakapacker version references)
  • What you changed and why
  • Explanation of the unrelated run_rspec.rake change

Test Coverage

Please verify:

  • Run bundle exec rubocop - ensure no violations
  • Test that CI still works with minimum configuration
  • Verify examples still generate correctly

Overall: The PR has the right goal but implements it incorrectly. The main issue is confusing the gem's minimum requirement (6.5.1) with the CI minimum test configuration (8.2.0). These serve different purposes and should remain different.

Let me know if you need clarification on any of these points! 🙏

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa1a2db and de16986.

📒 Files selected for processing (5)
  • .claude/docs/pr-testing-guide.md
  • README.md
  • SWITCHING_CI_CONFIGS.md
  • react_on_rails/rakelib/example_type.rb
  • react_on_rails/rakelib/run_rspec.rake
💤 Files with no reviewable changes (1)
  • react_on_rails/rakelib/run_rspec.rake
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rb

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rb: Run bundle exec rubocop and fix ALL violations before every commit/push
Run bundle exec rubocop (MANDATORY) before every commit to ensure zero offenses

Files:

  • react_on_rails/rakelib/example_type.rb
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/config/webpack/**/*.js : Use `namedExport: false` and `exportLocalsConvention: 'camelCase'` for CSS Modules loader options in Shakapacker 9.0+ if existing code uses `import styles from './file.module.css'` pattern
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages

Applied to files:

  • react_on_rails/rakelib/example_type.rb
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)

Applied to files:

  • react_on_rails/rakelib/example_type.rb
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes

Applied to files:

  • .claude/docs/pr-testing-guide.md
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/config/webpack/**/*.js : Use `namedExport: false` and `exportLocalsConvention: 'camelCase'` for CSS Modules loader options in Shakapacker 9.0+ if existing code uses `import styles from './file.module.css'` pattern

Applied to files:

  • .claude/docs/pr-testing-guide.md
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to {package.json,webpack.config.js,packages/*/package.json,react_on_rails_pro/package.json} : When resolving merge conflicts in build configuration files, verify file paths are correct by running `grep -r 'old/path' .` and test affected scripts like `pnpm run prepack` before continuing the merge

Applied to files:

  • .claude/docs/pr-testing-guide.md
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use Playwright E2E tests in `react_on_rails/spec/dummy/e2e/playwright/` for React component integration testing. Tests automatically start Rails server on port 5017 before running

Applied to files:

  • .claude/docs/pr-testing-guide.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use `app('clean')`, `appEval(code)`, `appFactories(options)`, and `appScenario(name)` helpers from cypress-on-rails in Playwright tests for Rails integration

Applied to files:

  • .claude/docs/pr-testing-guide.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: For infrastructure/config changes, perform comprehensive local testing including: finding all affected files with grep, testing build pipeline, running relevant specs, and linting everything before pushing

Applied to files:

  • .claude/docs/pr-testing-guide.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Git pre-commit hooks automatically run RuboCop (auto-fix), ESLint (auto-fix), Prettier (auto-format), and trailing newline checks on all changed files before each commit

Applied to files:

  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-01-23T18:20:45.824Z
Learnt from: alexeyr-ci
Repo: shakacode/react_on_rails PR: 1687
File: spec/dummy/package.json:0-0
Timestamp: 2025-01-23T18:20:45.824Z
Learning: When adding or updating dependencies in spec/dummy/package.json, maintain version consistency with other package.json files in the codebase to avoid potential version conflicts.

Applied to files:

  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Install Playwright browsers with `cd react_on_rails/spec/dummy && pnpm playwright install --with-deps` before running E2E tests

Applied to files:

  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.

Applied to files:

  • SWITCHING_CI_CONFIGS.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: dummy-app-integration-tests (3.4, 22, latest)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: build
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: claude-review
  • GitHub Check: markdown-link-check
🔇 Additional comments (3)
SWITCHING_CI_CONFIGS.md (2)

26-26: Version update looks good, but verify consistency with example_type.rb.

The Shakapacker version bump from 9.3.0 to 9.4.0 is appropriate for the latest configuration.

However, note that line 35 still shows the minimum configuration uses Shakapacker 8.2.0, while react_on_rails/rakelib/example_type.rb was changed to use 6.5.1. Ensure these values are intentionally different or update them to match.


127-127: Downgrade path updated consistently.

The downgrade path correctly reflects the new latest version (9.4.0 → 8.2.0).

.claude/docs/pr-testing-guide.md (1)

568-568: Version update is consistent with other documentation.

The Shakapacker version bump to 9.4.0 aligns with the changes in SWITCHING_CI_CONFIGS.md.

Comment thread react_on_rails/rakelib/example_type.rb Outdated

# Minimum Shakapacker version for compatibility testing
MINIMUM_SHAKAPACKER_VERSION = "8.2.0"
MINIMUM_SHAKAPACKER_VERSION = "6.5.1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check the exact content of the file mentioned
cat -n react_on_rails/rakelib/example_type.rb | head -40

Repository: shakacode/react_on_rails

Length of output: 1635


🏁 Script executed:

# Check if SWITCHING_CI_CONFIGS.md exists and look at line 35
if [ -f "SWITCHING_CI_CONFIGS.md" ]; then
  sed -n '30,40p' SWITCHING_CI_CONFIGS.md
else
  echo "File not found. Searching for similar files..."
  fd -i "switching" -t f
fi

Repository: shakacode/react_on_rails

Length of output: 304


🏁 Script executed:

# Search for references to both versions in the codebase
rg -n "8\.2\.0|6\.5\.1" -C 2

Repository: shakacode/react_on_rails

Length of output: 37084


🏁 Script executed:

# Search specifically for MINIMUM_SHAKAPACKER_VERSION references
rg -n "MINIMUM_SHAKAPACKER_VERSION" -C 2

Repository: shakacode/react_on_rails

Length of output: 11117


🌐 Web query:

Shakapacker 6.5.1 npm package version release

💡 Result:

Shakapacker version 6.5.1 is published on npm (package page for v6.5.1). [1]
The Shakapacker GitHub repository notes a v6-stable branch for v6.x documentation/code. [2]

Sources:
[1] npm package page — shakapacker v6.5.1.
[2] GitHub — shakacode/shakapacker (v6-stable reference).


Clarify the minimum Shakapacker version for CI testing.

The code claims to support Shakapacker 6.5.1 for basic pack generation (as defined in MINIMUM_SHAKAPACKER_VERSION across multiple files and documented in docs/configuration/configuration.md), but the CI configuration in SWITCHING_CI_CONFIGS.md tests only with Shakapacker 8.2.0. This creates an untested compatibility gap.

Shakapacker 6.5.1 exists and is the documented minimum for basic pack generation, while 8.2.0 is the minimum for async loading support (an advanced feature). Decide:

  • If basic pack generation with 6.5.1 should be tested: update the CI minimum config to test with 6.5.1
  • If 8.2.0 is the practical minimum: update the code constant to reflect this and document the breaking change
🤖 Prompt for AI Agents
In react_on_rails/rakelib/example_type.rb around line 31,
MINIMUM_SHAKAPACKER_VERSION ("6.5.1") conflicts with CI which only tests
Shakapacker 8.2.0; choose one of two fixes: (A) if we intend to
guarantee/support basic pack generation on 6.5.1, update the CI matrix in
SWITCHING_CI_CONFIGS.md and CI workflow to include tests against 6.5.1 (and
add/update any test fixtures) and leave the constant and docs as-is; or (B) if
8.2.0 is the practical minimum, bump MINIMUM_SHAKAPACKER_VERSION in this file
(and any other files where it appears), update docs
(docs/configuration/configuration.md and SWITCHING_CI_CONFIGS.md) and the
changelog to state 8.2.0 as the breaking minimum, and ensure CI continues
testing 8.2.0; implement the chosen option consistently across code, docs, and
CI.

@justin808
Copy link
Copy Markdown
Member Author

/run-skipped-tests

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Full CI Mode Enabled

Triggered all workflows for full CI coverage

Note: Added the full-ci label to this PR. All future commits will run the full CI suite (including minimum dependency tests) until the label is removed.

To disable full CI mode, use the /stop-run-skipped-ci command.

View progress in the Actions tab.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review for PR #2247

Critical Issues Found

1. BLOCKER: Debug Code Left in Production

In react_on_rails/rakelib/shakapacker_examples.rake lines 64-67, there are debug puts statements with ZZZZZ that must be removed before merging.

2. HIGH: Incomplete Version Update

The file bin/ci-switch-config still references 9.3.0 in 3 places. These need to be updated to 9.4.0 to match your documentation changes.

3. MEDIUM: Issue 2225 Not Fully Addressed

The core discrepancy between README (6.0) and packs_generator.rb (6.5.1 enforced) still exists. Consider updating README to reflect the actual enforced minimum version of 6.5.1.

Positive Changes

  • Removes unnecessary version pinning in test examples
  • Removes unused MINIMUM_SHAKAPACKER_VERSION constant
  • Updates documentation for React 19 and Shakapacker 9.4.0

Required Actions

  1. Remove debug code (lines 64-67 in shakapacker_examples.rake)
  2. Update bin/ci-switch-config: replace 9.3.0 with 9.4.0 (3 occurrences)
  3. Consider updating README minimum Shakapacker version to 6.5.1

Testing

Run these to verify:

  • rake run_rspec:shakapacker_examples_latest
  • bin/ci-switch-config status
  • bundle exec rubocop

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
react_on_rails/rakelib/shakapacker_examples.rake (1)

111-112: Update or remove stale comment.

This comment mentions "Gemfile was updated with pinned shakapacker version," but according to the PR changes, the logic to update Gemfile with Shakapacker pins (update_gemfile_versions method) was removed. The bundle_install_in call may still be needed due to other Gemfile changes (like rspec-rails from the dev_tests generator at line 106), but the comment is now misleading.

🔎 Proposed fix
-        # Re-run bundle install since Gemfile was updated with pinned shakapacker version
-        bundle_install_in(example_type.dir)
+        # Re-run bundle install to ensure all gem dependencies are resolved
+        bundle_install_in(example_type.dir)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de16986 and 4c1cbec.

📒 Files selected for processing (4)
  • .github/workflows/examples.yml
  • react_on_rails/rakelib/example_type.rb
  • react_on_rails/rakelib/run_rspec.rake
  • react_on_rails/rakelib/shakapacker_examples.rake
💤 Files with no reviewable changes (1)
  • react_on_rails/rakelib/example_type.rb
🚧 Files skipped from review as they are similar to previous changes (1)
  • react_on_rails/rakelib/run_rspec.rake
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/config/webpack/**/*.js : Use `namedExport: false` and `exportLocalsConvention: 'camelCase'` for CSS Modules loader options in Shakapacker 9.0+ if existing code uses `import styles from './file.module.css'` pattern
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to {package.json,webpack.config.js,packages/*/package.json,react_on_rails_pro/package.json} : When resolving merge conflicts in build configuration files, verify file paths are correct by running `grep -r 'old/path' .` and test affected scripts like `pnpm run prepack` before continuing the merge

Applied to files:

  • .github/workflows/examples.yml
  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
Repo: shakacode/react_on_rails PR: 1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: In IDE configuration, exclude these directories to prevent slowdowns: /coverage, /tmp, /gen-examples, /packages/react-on-rails/lib, /node_modules, /react_on_rails/spec/dummy/node_modules, /react_on_rails/spec/dummy/tmp, /react_on_rails/spec/dummy/app/assets/webpack, /react_on_rails/spec/dummy/log, /react_on_rails/spec/dummy/e2e/playwright-report, /react_on_rails/spec/dummy/test-results

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
Repo: shakacode/react_on_rails PR: 1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to lib/react_on_rails/engine.rb : In Rails Engine code, DO NOT use `rake_tasks` block to explicitly load rake files from `lib/tasks/` - Rails::Engine automatically loads them. Only use `rake_tasks` block if tasks are in non-standard location, need programmatic generation, or need to pass context

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-01-23T18:20:45.824Z
Learnt from: alexeyr-ci
Repo: shakacode/react_on_rails PR: 1687
File: spec/dummy/package.json:0-0
Timestamp: 2025-01-23T18:20:45.824Z
Learning: When adding or updating dependencies in spec/dummy/package.json, maintain version consistency with other package.json files in the codebase to avoid potential version conflicts.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/app_commands/**/*.rb : Create custom Rails app commands in `e2e/playwright/app_commands/` directory with .rb files for reusable helpers in Playwright tests

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use Playwright E2E tests in `react_on_rails/spec/dummy/e2e/playwright/` for React component integration testing. Tests automatically start Rails server on port 5017 before running

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: examples (3.2, minimum)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: build-dummy-app-webpack-test-bundles (3.2, 20, minimum)
  • GitHub Check: build-dummy-app-webpack-test-bundles (3.4, 22, latest)
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: dummy-app-integration-tests (3.4, 22, latest)
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: rspec-gem-specs (3.3.7)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: build
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: claude-review
🔇 Additional comments (1)
.github/workflows/examples.yml (1)

198-198: LGTM! Job name updated to remove hardcoded version reference.

The removal of the explicit Shakapacker version from the job name aligns with the PR objective to unify minimum version handling and remove hardcoded version pins. The actual versions tested are now determined by the dependency configuration and rake tasks, which centralizes version management.

Comment thread react_on_rails/rakelib/shakapacker_examples.rake Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

PR Review: Fix Unify minimum Shakapacker versions #2225

Thank you for working on this cleanup! This PR addresses the inconsistency in minimum Shakapacker version declarations. Here's my detailed review:


Positive Changes

  1. Removes unnecessary version pinning: The removal of MINIMUM_SHAKAPACKER_VERSION = "8.2.0" from example_type.rb and related methods is correct. The examples should use whatever Shakapacker version is installed via rake shakapacker:install, not force a specific version.

  2. Cleaner code: Removing update_shakapacker_dependency() and update_gemfile_versions() eliminates unnecessary complexity.

  3. Updated documentation: Version references updated from 9.3.0 to 9.4.0 in docs.

  4. Removed debug output: The puts line was removed, cleaning up output.


🚨 CRITICAL ISSUES

1. Debug Code Left in Production

Location: react_on_rails/rakelib/shakapacker_examples.rake:64-67

There are debug print statements with ZZZZZ pattern that must be removed before merging. This appears to be debugging code that was accidentally left in.

2. Potential Method Error

Location: Line 66 uses .ai method on react_version

This looks suspicious - .ai is not a standard Ruby method. Did you mean .inspect? This will likely cause a runtime error.


⚠️ Issues to Address

3. Debug Echo Statements in Workflow

Location: .github/workflows/examples.yml:76, 84

There are extra echo statements that appear to be for debugging. While less critical than the Ruby debug code, they add noise to CI logs. Consider removing them unless they serve a specific debugging purpose for this PR.


📝 Missing Items

4. PR Description Not Completed

The PR description still contains template text. Please complete the summary, checklist, and update CHANGELOG if this is user-facing.

5. Testing Strategy

According to CLAUDE.md, you should document what tests you ran locally and verify example generation still works without the pinned Shakapacker version.


🔍 Code Quality Notes

6. Consistency Check

The PR correctly identifies that the minimum Shakapacker version is now unified at 6.5.1 (from PacksGenerator::MINIMUM_SHAKAPACKER_VERSION), not 8.2.0. Consider updating README.md to reflect 6.5.1 rather than 6.0 for accuracy.


🎯 Action Items Before Merge

Must Fix (Blocking):

  1. ❌ Remove debug code in shakapacker_examples.rake:64-67
  2. ❌ Fix .ai method call (line 66)

Should Fix (Strongly Recommended):
3. ⚠️ Remove debug echo statements in workflow file
4. ⚠️ Complete PR description and checklist
5. ⚠️ Document local testing performed

Nice to Have:
6. 💡 Update README.md minimum version from 6.0 to 6.5.1 for accuracy


Summary

The core changes are good and address the issue correctly. However, debug code was left in that will break CI. Please clean this up and document your testing before merging.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Pull Request Review

Summary

This PR addresses issue #2225 by removing the pinning of minimum Shakapacker versions in example generation. The changes primarily clean up version-specific references and testing infrastructure.


Strengths

  1. Cleanup of version-specific code - Successfully removes the MINIMUM_SHAKAPACKER_VERSION constant and related pinning logic from example generation
  2. Documentation updates - Updates references from React 18 to React 19 and Shakapacker 9.3.0 to 9.4.0
  3. Removes unnecessary complexity - Eliminates the update_shakapacker_dependency and update_gemfile_versions functions
  4. Cleaner CI naming - Updates job descriptions to be more accurate

Issues and Concerns

1. Incomplete Resolution of Issue #2225

The original issue identified three different minimum Shakapacker versions being stated:

  • README: 6.0.0
  • packs_generator.rb: 6.5.1 (enforced via check_minimum_shakapacker_version)
  • Example testing: 8.2.0

This PR only addresses the third item (example testing). The first two remain inconsistent:

  • README.md:55 still says: Shakapacker >= 6.0
  • packs_generator.rb:11 enforces: MINIMUM_SHAKAPACKER_VERSION = "6.5.1"

According to issue #2225, these should be unified to 6.5.1 since check_minimum_shakapacker_version explicitly fails with versions older than that.

Recommendation: Update README.md Prerequisites section to: Shakapacker >= 6.5.1

2. Missing CHANGELOG Entry

Per CLAUDE.md guidelines, this is a user-visible change that affects how examples are generated and the testing/validation behavior for minimum Shakapacker versions.

Recommendation: Add to CHANGELOG.md under the Fixed section

3. PR Description Not Updated

The PR body still contains the template text and unchecked items.

Recommendation: Update the PR description with what was changed, why, and reference to issue #2225

4. Debug Code Removal

Good catch removing the debug echo statements in commit 48ee384. However, one debug line remains in .github/workflows/examples.yml:76

Recommendation: Remove this debug line as well for consistency.


Testing Concerns

The PR removes significant logic but does not appear to add tests to verify:

  1. Examples still generate correctly without version pinning
  2. Examples can successfully use different Shakapacker versions
  3. The minimum version check in packs_generator.rb still works correctly

Recommendation: Run the example generation tests locally


Action Items Before Merge

  1. Update README.md to change Shakapacker >= 6.0 to Shakapacker >= 6.5.1
  2. Add CHANGELOG entry documenting this change
  3. Update PR description with actual summary and check completed items
  4. Remove remaining debug line in .github/workflows/examples.yml:76
  5. Verify no other references to MINIMUM_SHAKAPACKER_VERSION exist
  6. Run example tests locally to verify generation still works
  7. Clarify testing strategy: Document what Shakapacker versions are actually being tested in CI

Overall Assessment

Status: Needs Work - Good progress but incomplete

This PR makes good progress on cleaning up version pinning, but only partially addresses issue #2225. It needs CHANGELOG entry, proper PR description, and removal of leftover debug code.

Recommendation: Address the action items above before merging. This is solid cleanup work that just needs the finishing touches to be complete and properly documented.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review - PR #2247

Summary

This PR simplifies the Shakapacker version testing strategy by removing the minimum version pinning logic from example generation. The changes align with the goal stated in issue #2225 to unify minimum Shakapacker version requirements.


✅ Positive Aspects

  1. Simplification: Removes unnecessary complexity from the build process by eliminating Shakapacker version pinning in examples
  2. Consistency: The actual minimum version enforcement remains in the right place (packs_generator.rb:11 with MINIMUM_SHAKAPACKER_VERSION = "6.5.1")
  3. Documentation Updates: Properly updates version references from 9.3.0 to 9.4.0 and removes outdated references to 8.2.0 pinning
  4. Clean Removal: Completely removes the now-unused MINIMUM_SHAKAPACKER_VERSION constant and related pinning logic

⚠️ Issues & Concerns

1. Incomplete Solution to Issue #2225

The original issue identifies three different minimum versions:

  • README.md says 6.0.0 ✅ (not changed in this PR)
  • packs_generator.rb enforces 6.5.1 ✅ (unchanged, correct)
  • Example tests were pinning to 8.2.0 ✅ (this PR removes the pinning)

However, this PR only addresses point #3 by removing the 8.2.0 pinning. It does NOT unify the versions as requested in #2225.

Recommendation: Update README.md prerequisites to state 6.5.1 (matching the enforced version) or add a follow-up task to address this.

2. Missing Test Coverage Verification

The PR removes code without verifying that tests still pass with this change:

# REMOVED: update_shakapacker_dependency() function
# REMOVED: update_gemfile_versions() function  
# REMOVED: Gemfile shakapacker pinning

Questions to verify:

  • Do the example generation tests still pass without Shakapacker pinning?
  • Are the CI jobs that run run_rspec:shakapacker_examples_pinned still working correctly?
  • Does the React 16/17/18 testing still work as intended?

Recommendation: Add a comment in the PR description confirming which test suites were run locally to verify this change.

3. Removed Debug Output

# REMOVED from run_rspec.rake:82
- puts "Creating #{example_type.rspec_task_name} task"

This debug output removal seems unrelated to the main goal. While cleaning up debug statements is good, it should ideally be:

  • Mentioned in the PR description
  • Possibly a separate commit for clarity

4. Documentation May Need Updates

Several documentation files reference Shakapacker 8.2.0 with specific feature context (not just version numbers). Search results show:

  • docs/upgrading/release-notes/16.1.0.md - Has specific instructions for 8.2.0
  • docs/configuration/configuration.md - References 8.2.0 for async loading support
  • docs/building-features/streaming-server-rendering.md - Migration guide mentions 8.2.0

Question: Should these docs be updated to reflect that we no longer test against 8.2.0 specifically? Or are they historical references that should remain?

5. Empty Line Added in Workflow

# .github/workflows/examples.yml:76
+          

This appears to be an accidental whitespace change and should be removed.


🔍 Code Quality

Good Practices

  • Clean removal of unused constants
  • Proper function removal without leaving dead code
  • Task name updates reflect the change accurately

Potential Issues

  • Missing CHANGELOG entry: According to CLAUDE.md, user-visible changes should be documented. Since this changes the testing strategy (no longer pinning to 8.2.0), consider whether this warrants a changelog entry.

🧪 Testing Recommendations

Before merging, please verify:

# 1. Verify example generation still works
rake shakapacker_examples:gen_all

# 2. Run the affected test suites
rake run_rspec:shakapacker_examples_latest
rake run_rspec:shakapacker_examples_pinned

# 3. Verify React 16/17/18 compatibility tests still work
rake run_rspec:shakapacker_examples_react18

# 4. Check that the minimum version check still works
# (in an app with Shakapacker < 6.5.1)

📝 Suggested Follow-ups

  1. Address the full scope of Unify minimum Shakapacker versions #2225: Update README.md to state minimum version as 6.5.1 (matching the enforced version)
  2. Document the testing strategy: Clarify in comments or docs that we test with latest Shakapacker, not minimum
  3. Consider test coverage: Add a test that verifies the minimum version enforcement still works
  4. Clean up the workflow file: Remove the empty line added at line 76

Summary

This is a reasonable simplification that removes unnecessary complexity from the build process. However, it partially addresses issue #2225 rather than fully resolving it. The changes are safe as long as the actual minimum version enforcement (in packs_generator.rb) remains intact.

Recommendation: ✅ Approve with minor suggestions

The core change is sound, but please:

  1. Verify the test suites mentioned above pass
  2. Remove the accidental empty line in the workflow
  3. Consider adding a follow-up task to fully address Unify minimum Shakapacker versions #2225
  4. Confirm whether CHANGELOG needs an entry for this change

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/examples.yml (1)

199-199: Consider clarifying what's pinned in the task name.

The task name now correctly removes the Shakapacker version reference, aligning with the removal of Shakapacker pinning logic. However, "Pinned version examples" could be more explicit about what's pinned.

Optional clarification
-      - name: "Main CI - Pinned version examples (React 16, 17, 18)"
+      - name: "Main CI - Pinned React version examples (React 16, 17, 18)"

This makes it immediately clear that React versions (not Shakapacker) are pinned.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48ee384 and b3ce4d6.

📒 Files selected for processing (1)
  • .github/workflows/examples.yml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/config/webpack/**/*.js : Use `namedExport: false` and `exportLocalsConvention: 'camelCase'` for CSS Modules loader options in Shakapacker 9.0+ if existing code uses `import styles from './file.module.css'` pattern
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-dummy-app-webpack-test-bundles (3.2, 20, minimum)
  • GitHub Check: rspec-package-tests (3.2, minimum)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: examples (3.2, minimum)
  • GitHub Check: build
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: claude-review
🔇 Additional comments (1)
.github/workflows/examples.yml (1)

77-80: LGTM! Full-CI label support correctly implemented.

The condition now properly includes the has_full_ci_label check alongside existing triggers (master, workflow_dispatch, force_run), allowing the full matrix to run when the label is present.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review for PR #2247

Summary

This PR addresses issue #2225 by removing legacy Shakapacker version pinning logic and updating documentation to reflect current supported versions (6.5.1+ for basic features, 7.0.0+ for autobundling).


Positive Changes

  1. Cleaner Test Generation: Removed unnecessary Shakapacker version pinning in example generation, simplifying the rake tasks and eliminating duplicate logic.

  2. Documentation Updates: Updated references from React 18 to React 19 and Shakapacker 9.3.0 to 9.4.0, keeping docs current.

  3. Removed Debug Code: Cleaned up debug print statements (e.g., puts "Creating #{example_type.rspec_task_name} task").

  4. Simplified CI Configuration: Removed version-specific references from CI job names since pinning logic is gone.


🐛 Critical Issues

1. Incomplete Method Removal

The PR removes supports_basic_pack_generation? from packer_utils.rb (line 39) but leaves:

  • RBS signature: react_on_rails/sig/react_on_rails/packer_utils.rbs:4 still declares it
  • Tests: react_on_rails/spec/react_on_rails/packer_utils_spec.rb:94-108 still test it

Impact: This will cause:

  • RBS validation failures (bundle exec rake rbs:validate)
  • Test failures when these specs run
  • Type checking errors if Steep is enabled

Fix Required:

# Remove from sig/react_on_rails/packer_utils.rbs:4
- def self.supports_basic_pack_generation?: () -> bool

# Remove test block from spec/react_on_rails/packer_utils_spec.rb:94-108
- describe ".supports_basic_pack_generation?" do
-   # entire test block
- end

2. Orphaned Error Message Method

raise_shakapacker_version_incompatible_for_basic_pack_generation (packer_utils.rb:157) is now unused but still exists.

Fix Required: Remove this method and its RBS signature (sig/react_on_rails/packer_utils.rbs:12).


⚠️ Testing Concerns

Missing Test Updates

Per CLAUDE.md requirements:

CRITICAL - LOCAL TESTING REQUIREMENTS:

  1. NEVER claim a test is "fixed" without running it locally first

Required before merge:

# Verify RBS signatures are valid
bundle exec rake rbs:validate

# Run affected tests
bundle exec rake run_rspec:gem

# Ensure all specs pass
bundle exec rake run_rspec

📋 Documentation & Changelog

PR Description

The PR description still contains the template text:

Remove this paragraph and provide a general description...

Fix Required: Update with actual description explaining the change.

Changelog

  • Add entry to CHANGELOG.md (this is a user-facing change - removal of version pinning affects example generation)
  • Format: [PR 2247](https://github.com/shakacode/react_on_rails/pull/2247) by [justin808](https://github.com/justin808): Remove legacy Shakapacker version pinning from example generation

🔍 Minor Observations

  1. Consistency: The PR correctly maintains MINIMUM_SHAKAPACKER_VERSION = "6.5.1" in packs_generator.rb, which aligns with README.md stating "Shakapacker >= 6.0" (6.5.1 is the actual minimum for pack generation).

  2. Clean Removals: The removal of check_minimum_shakapacker_version from configuration.rb is clean - no orphaned calls found.


🚀 Recommendation

Do not merge until:

  1. RBS signature and tests for supports_basic_pack_generation? are removed
  2. Unused raise_shakapacker_version_incompatible_for_basic_pack_generation method is removed
  3. Local tests pass (bundle exec rake rbs:validate && bundle exec rake run_rspec:gem)
  4. CHANGELOG.md is updated
  5. PR description is filled in

Once these are addressed, this is a solid cleanup that properly unifies the minimum Shakapacker version handling! 👍

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review - PR #2247

Thank you for working on unifying the minimum Shakapacker versions! This is a good cleanup that addresses issue #2225. Here's my feedback:


✅ Strengths

  1. Well-scoped cleanup: Removes version checking code that's no longer needed since the project now requires Shakapacker >= 6.0 universally
  2. Comprehensive changes: Updates documentation, tests, CI configs, and code consistently
  3. Removes dead code: Eliminates check_minimum_shakapacker_version, supports_basic_pack_generation?, and related test pinning logic
  4. Updates version references: Correctly updates references from 9.3.0 → 9.4.0 and removes outdated 8.2.0 pinning

⚠️ Issues & Suggestions

1. CRITICAL: Missing CHANGELOG Entry

Per CLAUDE.md guidelines:

  • ✅ This is a user-visible change (removes version checks, updates minimum versions)
  • ❌ No CHANGELOG.md entry added

Action Required: Add an entry to CHANGELOG.md following the format:

#### Enhancements
- [PR 2247](https://github.com/shakacode/react_on_rails/pull/2247) by [justin808](https://github.com/justin808): Remove obsolete Shakapacker version checking code. React on Rails v16 requires Shakapacker >= 6.0, making the old version checks unnecessary.

2. Dead Code: Unused Error Method

react_on_rails/lib/react_on_rails/packer_utils.rb:157-164 defines raise_shakapacker_version_incompatible_for_basic_pack_generation but it's no longer called anywhere after removing check_minimum_shakapacker_version.

Recommendation: Remove this dead error method and its RBS signature for cleaner code.

3. Documentation Inconsistency

The error message in packer_utils.rb:151 still references:

Basic pack generation requires ::Shakapacker #{ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION} or above.

This is in raise_shakapacker_version_incompatible_for_autobundling which is about autobundling (requires 7.0.0), not basic pack generation (6.5.1). The message is confusing.

Recommendation: Update the error message to focus on autobundling requirements only:

def self.raise_shakapacker_version_incompatible_for_autobundling
  msg = <<~MSG
    **ERROR** ReactOnRails: Please upgrade ::Shakapacker to version #{ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING} or \
    above to use the automated bundle generation feature (which requires nested_entries support). \
    The currently installed version is #{ReactOnRails::PackerUtils.shakapacker_version}.
  MSG

  raise ReactOnRails::Error, msg
end

4. Consider Removing MINIMUM_SHAKAPACKER_VERSION Constant

react_on_rails/lib/react_on_rails/packs_generator.rb:11 defines:

MINIMUM_SHAKAPACKER_VERSION = "6.5.1"

This constant is now only used in the unused raise_shakapacker_version_incompatible_for_basic_pack_generation error method. If that method is removed, this constant becomes dead code.

Recommendation:

  • If the 6.5.1 requirement is still documented/important, keep it but add a comment explaining its purpose
  • Otherwise, remove it to avoid confusion

🧪 Testing Considerations

Per CLAUDE.md's critical testing requirements:

  1. Good: The PR removes test pinning to 8.2.0, which aligns with not actively testing older versions
  2. ⚠️ Question: Have you verified that removing check_minimum_shakapacker_version doesn't break anything for users on Shakapacker 6.0-6.4? The check was enforcing 6.5.1+, but README now says >= 6.0.

Recommendation: Either:

  • Update README.md Prerequisites to say "Shakapacker >= 6.5.1" (matching the code's actual requirement for pack generation)
  • OR verify/test that 6.0-6.4 work and are truly supported

📝 Minor Observations

  1. Good: Removed the debug log (puts "Creating #{example_type.rspec_task_name} task") - cleaner output
  2. Good: Updated job description to remove version-specific details (more maintainable)
  3. Good: Consistent updates across Pro docs (.claude/docs/pr-testing-guide.md)

🎯 Summary

Impact: Medium - Cleanup that reduces maintenance burden but needs CHANGELOG entry and dead code removal.

Required Before Merge:

  • Add CHANGELOG.md entry
  • Clarify README vs code version requirements (6.0 vs 6.5.1)

Recommended Follow-ups:

  • Remove raise_shakapacker_version_incompatible_for_basic_pack_generation and its RBS signature
  • Clean up error message in raise_shakapacker_version_incompatible_for_autobundling
  • Consider removing unused MINIMUM_SHAKAPACKER_VERSION constant

Overall: Good cleanup work! Just needs CHANGELOG and a decision on the 6.0 vs 6.5.1 requirement.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review - PR #2247: Fix Unify minimum Shakapacker versions #2225

Summary

This PR addresses issue #2225 by removing minimum Shakapacker version pinning (8.2.0) from example generation and test infrastructure. The changes simplify version handling by removing the MINIMUM_SHAKAPACKER_VERSION constant from example_type.rb and associated pinning logic.


✅ Strengths

  1. Cleaner Architecture: Removing the check_minimum_shakapacker_version method and associated infrastructure eliminates redundant version checks that were causing confusion.

  2. Consistent Documentation: Updates to documentation files (README.md, SWITCHING_CI_CONFIGS.md, pr-testing-guide.md) correctly reflect the removal of Shakapacker 8.2.0 pinning.

  3. Proper Cleanup: The PR removes all related code including:

    • Configuration validation method
    • RBS type signatures
    • Test specs
    • Rake task logic for pinning Shakapacker versions
  4. CI Job Description Update: The GitHub workflow description change from "Pinned version examples (React 16, 17, 18 with Shakapacker 8.2.0)" to just "Pinned version examples (React 16, 17, 18)" is accurate.


⚠️ Issues & Concerns

🔴 CRITICAL: Incomplete Fix for Issue #2225

The PR only partially addresses the reported issue. Issue #2225 identifies 3 different minimum Shakapacker versions:

  1. README.md says >= 6.0.0 (still present after this PR)
  2. packs_generator.rb:11 says 6.5.1 via MINIMUM_SHAKAPACKER_VERSION constant (still present after this PR)
  3. example_type.rb tested with 8.2.0 (removed by this PR ✅)

This PR only fixes #3, but leaves #1 and #2 inconsistent.

What Still Needs to Be Done:

Looking at packs_generator.rb:11-13:

MINIMUM_SHAKAPACKER_VERSION = "6.5.1"
# Auto-registration requires nested_entries support which was added in 7.0.0
MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING = "7.0.0"

And README.md still says:

- Shakapacker >= 6.0 (Webpacker is no longer supported as of v16)

The README should be updated to reflect the actual minimum version of 6.5.1 (or the team should decide on the definitive minimum and update accordingly).


🟡 MEDIUM: Missing CHANGELOG Entry

Per CLAUDE.md requirements:

Format: [PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)
Use /update-changelog command for guided changelog updates

This PR makes user-visible changes:

  • Removes Shakapacker version pinning from example generation
  • Changes CI testing strategy (no longer testing against Shakapacker 8.2.0 specifically)

Recommendation: Add a CHANGELOG entry under "Internal" or "Changed" section explaining the simplification.


🟡 MEDIUM: Test Coverage Gap

The PR removes supports_basic_pack_generation? method and its tests from packer_utils_spec.rb, but:

  1. Was this method used anywhere else? Let me verify:

Looking at the removed method in configuration.rb:

def check_minimum_shakapacker_version
  ReactOnRails::PackerUtils.raise_shakapacker_version_incompatible_for_basic_pack_generation unless
    ReactOnRails::PackerUtils.supports_basic_pack_generation?
end

This method was called from configuration.rb, but the call site was also removed. ✅ Good.

  1. Are there other code paths that might still reference the minimum version?

The constant MINIMUM_SHAKAPACKER_VERSION = "6.5.1" is still defined in packs_generator.rb:11 but the PR removes the validation that enforces it. This means:

  • Users with Shakapacker < 6.5.1 will no longer get a helpful error message
  • They'll encounter runtime errors instead of clear validation errors

Question: Is this intentional? Should there still be a version check somewhere, or is 6.5.1 no longer the actual minimum?


🟢 MINOR: Debug Log Removal

Line removed from run_rspec.rake:82:

puts "Creating #{example_type.rspec_task_name} task"

This is good cleanup, but consider:

  • Was this debug output helping during development?
  • Should it be behind a verbose flag instead of removed entirely?

Minor point, probably fine to remove.


🧪 Testing Recommendations

CRITICAL - Test Locally First

Per CLAUDE.md section on "CRITICAL - LOCAL TESTING REQUIREMENTS":

NEVER claim a test is "fixed" without running it locally first

Before merging, you MUST verify:

# 1. Clean install
rm -rf node_modules
pnpm install --frozen-lockfile

# 2. Run affected test suites
bundle exec rake run_rspec:gem
bundle exec rake run_rspec:shakapacker_examples_latest
bundle exec rake run_rspec:shakapacker_examples_pinned

# 3. Verify example generation still works without Shakapacker pinning
bundle exec rake shakapacker_examples:gen_all

# 4. Lint everything
bundle exec rubocop
pnpm run lint

What Could Break

  1. Example generation - The removal of Shakapacker pinning logic might cause examples to fail if they relied on specific 8.2.0 behavior
  2. CI minimum dependency tests - The "minimum" config still expects to test against Shakapacker 8.2.0 per SWITCHING_CI_CONFIGS.md
  3. Version validation - Users with old Shakapacker versions won't get helpful error messages anymore

📋 Checklist Items from PR Template

  • Add/update test to cover these changes - Tests were removed, but were new tests added to verify the simplified behavior?
  • Update documentation - Partially done, but README.md minimum version still inconsistent
  • Update CHANGELOG file - ❌ Missing

🎯 Recommendations

Must Fix Before Merge:

  1. Update README.md to reflect the actual minimum Shakapacker version (probably 6.5.1, not 6.0)
  2. Add CHANGELOG entry explaining the removal of Shakapacker version pinning
  3. Run full local test suite to verify example generation still works
  4. Monitor CI - particularly the "minimum" dependency tests that still reference Shakapacker 8.2.0 in SWITCHING_CI_CONFIGS.md

Consider:

  1. Clarify the minimum version strategy: Should there still be a validation check for Shakapacker < 6.5.1? Or is the minimum now just 6.0 (as README suggests)?
  2. Add a comment in packs_generator.rb explaining why MINIMUM_SHAKAPACKER_VERSION = "6.5.1" is still defined but not enforced
  3. Update SWITCHING_CI_CONFIGS.md line 127 which still says "Shakapacker 9.4.0 → 8.2.0" - is 8.2.0 still tested in minimum mode?

📚 References

  • Issue: Unify minimum Shakapacker versions #2225
  • CLAUDE.md guidelines: .claude/docs/pr-testing-guide.md, CLAUDE.md (CHANGELOG section, local testing requirements)
  • Related files: packs_generator.rb:11, README.md prerequisites section

Overall: This is a good cleanup PR that removes confusing version pinning logic, but it incompletely addresses issue #2225 and needs documentation updates to be fully consistent.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review

Thank you for addressing issue #2225 to unify the minimum Shakapacker versions! This is a good cleanup that removes confusing version requirements. However, I've identified a critical bug that will cause test failures.


🚨 Critical Issue - Test Failure

Location: react_on_rails/spec/react_on_rails/packer_utils_spec.rb:188

The test "ensures version requirements are logically consistent" references an undefined variable basic_version:

it "ensures version requirements are logically consistent" do
  auto_reg_version = Gem::Version.new(
    ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING
  )

  expect(auto_reg_version).to be >= basic_version,  # ❌ basic_version is undefined
                              "Auto-registration version should be >= basic pack generation version"
end

Root cause: The diff removed the definition of basic_version (which was based on MINIMUM_SHAKAPACKER_VERSION), but this test still references it.

Fix: This entire test should be removed since it was validating that MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING >= MINIMUM_SHAKAPACKER_VERSION, which is no longer relevant after removing the basic version requirement.


✅ Positive Aspects

  1. Correct removal of unused constant: The MINIMUM_SHAKAPACKER_VERSION constant in packs_generator.rb:11 can now be safely removed since it's not referenced anywhere after your changes
  2. Good documentation updates: Version references in comments and documentation are appropriately updated (9.3.0 → 9.4.0, React 18 → 19)
  3. Proper cleanup: Removed related methods (check_minimum_shakapacker_version, supports_basic_pack_generation?, etc.)
  4. Consistent approach: Updates span configuration, rake tasks, generators, and tests

📋 Recommendations

1. Fix the broken test (Required)

Remove the broken test entirely since it validates a relationship that no longer exists:

# DELETE this test:
it "ensures version requirements are logically consistent" do
  auto_reg_version = Gem::Version.new(
    ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING
  )

  expect(auto_reg_version).to be >= basic_version,
                              "Auto-registration version should be >= basic pack generation version"
end

2. Remove the unused constant (Recommended)

Since MINIMUM_SHAKAPACKER_VERSION in packs_generator.rb:11 is no longer referenced, remove it:

- MINIMUM_SHAKAPACKER_VERSION = "6.5.1"
  # Auto-registration requires nested_entries support which was added in 7.0.0
  MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING = "7.0.0"

3. Update README Prerequisites (Optional but recommended)

The README currently states Shakapacker >= 6.0, but based on the code, the actual minimum is now effectively 7.0.0 for the core auto-bundling feature that React on Rails uses. Consider updating:

- Shakapacker >= 7.0 (Webpacker is no longer supported as of v16)

4. Verify local testing

According to CLAUDE.md, before pushing you should:

  • Run bundle exec rubocop (mandatory)
  • Run relevant tests: rake run_rspec:gem to catch the failing test

🔍 Security & Performance

  • ✅ No security concerns
  • ✅ No performance implications
  • ✅ Proper error message cleanup

Test Coverage

  • Current PR will break tests - the undefined basic_version reference will cause failures
  • ✅ Good removal of obsolete version-specific tests
  • ℹ️ After fixes, run bundle exec rake run_rspec:gem to verify

Summary

This is a valuable cleanup that addresses the version inconsistency issue. However, it cannot be merged as-is due to the broken test. Please apply recommendation #1 (remove the broken test), and strongly consider #2 (remove the unused constant). Once fixed, this will be ready to merge.

The PR title mentions "Fix" but the body is still using the template - please update the PR description to explain what this PR does and why it's needed per the checklist.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 25, 2025

Code Review - PR #2247: Unify minimum Shakapacker versions

Summary

This PR addresses issue #2225 by removing inconsistent minimum Shakapacker version checks and simplifying version handling. The changes eliminate the obsolete MINIMUM_SHAKAPACKER_VERSION (6.5.1) references while keeping the more important MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING (7.0.0) for autobundling features.


✅ Positive Aspects

  1. Good cleanup of obsolete code: Removes the supports_basic_pack_generation? method and related check_minimum_shakapacker_version validation that was checking for 6.5.1 - a version that's no longer relevant.

  2. Simplifies codebase: Eliminates complex Gemfile/package.json manipulation in example generation that was pinning to 8.2.0, making the build process cleaner.

  3. Proper test cleanup: Removes tests for the deleted supports_basic_pack_generation? functionality.

  4. RBS signatures updated: Correctly removes method signatures from .rbs files to keep type definitions in sync.

  5. Documentation updates: Updates references to current Shakapacker version (9.4.0) and React 19 in docs.

  6. Removes debug logging: Cleans up puts statement in run_rspec.rake (line 82 removed).


⚠️ Issues & Concerns

1. Missing CHANGELOG entry

According to CLAUDE.md, user-visible changes should be documented in the CHANGELOG. While this is mostly internal cleanup, it does affect:

  • Generator behavior (no longer pins Shakapacker to 8.2.0)
  • Removed validation check that could have caught version issues

Recommendation: Add a CHANGELOG entry under "Changed" or "Removed":

#### Changed
- Removed obsolete Shakapacker 6.5.1 version check for basic pack generation. Minimum supported Shakapacker version is now implicitly 6.0 (as documented in README), with autobundling requiring 7.0.0+. [PR 2247](https://github.com/shakacode/react_on_rails/pull/2247) by [justin808](https://github.com/justin808).

2. Potential version confusion

After this PR, we have:

  • README: Documents Shakapacker >= 6.0 as minimum
  • Code: MINIMUM_SHAKAPACKER_VERSION = "6.5.1" still exists in packs_generator.rb:11 but is no longer used anywhere
  • Autobundling: Requires 7.0.0+ (still enforced)

The unused constant is confusing and should be removed:

# react_on_rails/lib/react_on_rails/packs_generator.rb:11
MINIMUM_SHAKAPACKER_VERSION = "6.5.1"  # ← UNUSED, should be deleted

Recommendation: Remove the unused constant or add a comment explaining it's kept for reference only.

3. README still shows 6.0 minimum

The README states >= 6.0 but the issue (#2225) suggests it should be 6.5.1. However, after removing the 6.5.1 check, there's no longer code enforcement.

Questions:

  • Is 6.0 actually supported, or should README be updated to 6.5.1 or 7.0.0?
  • What features work with 6.0 vs 7.0.0?

Recommendation: Update README to clarify:

- Shakapacker >= 6.5.1 (with autobundling requiring >= 7.0.0)

4. CI/Testing concerns

The PR removes minimum version testing (8.2.0 pinning in examples). While the CI still tests with minimum config (Ruby 3.2, Node 20), it's unclear what Shakapacker version is used in minimum CI.

Recommendation: Verify that minimum CI configuration tests against an appropriate Shakapacker version (not just latest 9.4.0).


🔍 Code Quality

Strengths:

  • Clean removal of dead code
  • Consistent updates across related files
  • RBS signatures properly maintained
  • No security concerns

Minor issues:

  • Unused constant left in codebase
  • Comments in run_rspec.rake updated but could be more descriptive

🧪 Test Coverage

✅ Removed obsolete tests for deleted functionality
✅ Updated test descriptions to reflect current versions
⚠️ Question: Are there tests that verify the 7.0.0 autobundling requirement still works?


📋 Checklist Review

From the PR template:

  • Add/update test to cover these changes - Tests were removed (appropriately), but verify autobundling validation still tested
  • Update documentation - Partially done (version references updated), but README still shows 6.0
  • Update CHANGELOG file - ❌ Missing

💡 Recommendations

Before merging:

  1. Add CHANGELOG entry (mandatory per CLAUDE.md)
  2. ⚠️ Remove unused MINIMUM_SHAKAPACKER_VERSION constant or document why it's kept
  3. ⚠️ Update README to clarify minimum version (6.5.1 or 7.0.0?)
  4. Verify CI tests against appropriate minimum Shakapacker version

After merging:

  • Monitor for user reports about version compatibility issues
  • Consider adding a migration guide if 6.0-6.4.x users are affected

🎯 Overall Assessment

This is a good cleanup PR that simplifies the codebase and removes confusing version checks. However, it needs:

  • CHANGELOG entry
  • Cleanup of unused constant
  • README clarification

Recommendation: Request changes for CHANGELOG and unused constant cleanup before merging.


Review conducted following CLAUDE.md guidelines. All feedback is constructive and aimed at maintaining code quality and documentation standards.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
react_on_rails/lib/react_on_rails/packer_utils.rb (1)

146-154: Breaking change not documented in CHANGELOG.md.

The removal of public methods supports_basic_pack_generation? and raise_shakapacker_version_incompatible_for_basic_pack_generation is a breaking change that must be documented in the Unreleased section of CHANGELOG.md. The current Unreleased section contains only CVE security fixes and lacks an entry for this PR.

Additionally:

  • ✓ Removed methods are confirmed not referenced elsewhere in the codebase.
  • ✓ RBS signature in sig/react_on_rails/packer_utils.rbs is properly updated with raise_shakapacker_version_incompatible_for_autobundling and correctly excludes removed method signatures.
  • ⚠ Rubocop verification cannot be completed in this environment but is mandatory per coding guidelines.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f752934 and 6914808.

📒 Files selected for processing (3)
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/sig/react_on_rails/packer_utils.rbs
  • react_on_rails/spec/react_on_rails/packer_utils_spec.rb
💤 Files with no reviewable changes (2)
  • react_on_rails/spec/react_on_rails/packer_utils_spec.rb
  • react_on_rails/sig/react_on_rails/packer_utils.rbs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rb

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rb: Run bundle exec rubocop and fix ALL violations before every commit/push
Run bundle exec rubocop (MANDATORY) before every commit to ensure zero offenses

Files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-02-18T13:08:01.477Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
Repo: shakacode/react_on_rails PR: 1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-10-23T17:22:01.074Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1875
File: lib/react_on_rails/utils.rb:112-124
Timestamp: 2025-10-23T17:22:01.074Z
Learning: In React on Rails, when Pro is installed but not licensed, the intended behavior is to raise an error on boot. The `react_on_rails_pro?` method validates licenses and should raise errors early (including during path resolution in methods like `server_bundle?`) to enforce licensing requirements rather than failing later with obscure errors.

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: dummy-app-integration-tests (3.2, 20, minimum)
  • GitHub Check: dummy-app-integration-tests (3.4, 22, latest)
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: examples (3.2, minimum)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: rspec-package-tests (3.2, minimum)
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: build
  • GitHub Check: claude-review

@justin808 justin808 force-pushed the justin808-shakapacker-version branch from 6914808 to 71bc8d7 Compare January 12, 2026 04:18
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 12, 2026

PR Review: Unify minimum Shakapacker versions (#2225)

Summary

This PR successfully addresses issue #2225 by simplifying Shakapacker version handling, removing obsolete minimum version checks for Shakapacker 6.5.1, and updating documentation to reflect current versions (React 19, Shakapacker 9.4.0).

✅ Strengths

  1. Clean Removal of Obsolete Code: The PR correctly removes the now-unnecessary MINIMUM_SHAKAPACKER_VERSION (6.5.1) validation logic while retaining the MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING (7.0.0) which is still relevant for the auto-bundling feature.

  2. Proper Cleanup: All references to removed methods are cleaned up:

    • check_minimum_shakapacker_version method removed from configuration.rb
    • supports_basic_pack_generation? method removed from packer_utils.rb
    • raise_shakapacker_version_incompatible_for_basic_pack_generation error message removed
    • RBS type signatures updated accordingly
    • Associated tests removed
  3. Documentation Updates: Version references updated throughout:

    • CI workflow descriptions updated (React 19, Shakapacker 9.4.0)
    • Testing guide updated
    • Config switching documentation updated
  4. No Breaking Changes: The gemspec still requires shakapacker >= 6.0, which is the actual minimum. The 6.5.1 check was overly strict and has been superseded by higher version requirements for auto-bundling (7.0.0).

⚠️ Issues Found

1. CRITICAL: Commented-out Code Should Be Resolved

Location: react_on_rails/rakelib/shakapacker_examples.rake:88-92

# Check before merge this PR if we can remove adding Shakapacker as React on Rails will do this
#
# Pin to 9.4.0 to ensure gem and npm package versions match
# (shakapacker 9.5.0 gem was released but npm package version detection has issues)
# sh_in_dir(example_type.dir, "echo \"gem 'shakapacker', '9.4.0'\" >> #{example_type.gemfile}")

Recommendation: This comment explicitly asks to check before merging whether Shakapacker should be added. This needs to be resolved:

  • Option A: If React on Rails now automatically adds Shakapacker as a dependency (via gemspec >= 6.0), remove the commented code and update the comment to explain why it's not needed
  • Option B: If examples still need explicit Shakapacker pinning, uncomment and keep the code
  • Option C: Test whether example generation works without this line

Action Required: Please verify example generation works correctly without explicitly adding Shakapacker to the Gemfile:

cd react_on_rails
bundle exec rake shakapacker_examples:gen_example_basic
cd gen-examples/basic
bundle list | grep shakapacker  # Verify shakapacker is present

2. Minor: Debug Output Removed

Location: react_on_rails/rakelib/run_rspec.rake:82

The line puts "Creating #{example_type.rspec_task_name} task" was removed. While this is listed as removing a "debug log" in the PR description, confirm this wasn't being used for CI output parsing or monitoring.

3. Test Coverage: Missing Constant Definition Test

The test that validated MINIMUM_SHAKAPACKER_VERSION == "6.5.1" was removed, but there's no test that the constant still exists in PacksGenerator. While the constant is still defined (react_on_rails/lib/react_on_rails/packs_generator.rb:11), consider whether it should be removed entirely since it's no longer referenced.

Recommendation: Either:

  • Remove the unused constant from PacksGenerator entirely, OR
  • Add a comment explaining why it's kept for documentation purposes

🔍 Security & Performance

  • Security: No security concerns
  • Performance: Removing unnecessary version checks slightly improves initialization performance

🧪 Testing Recommendations

Before merging, please verify:

  1. Example Generation Works:

    bundle exec rake shakapacker_examples:gen_all
  2. Tests Pass:

    bundle exec rake run_rspec:gem
    bundle exec rake run_rspec:shakapacker_examples_latest
  3. Verify Shakapacker Version Detection Still Works:

    bundle exec rspec react_on_rails/spec/react_on_rails/packer_utils_spec.rb
  4. Lint Check (MANDATORY per CLAUDE.md):

    bundle exec rubocop

📋 Checklist from PR Template

The PR description still contains the template placeholders. Please update:

  • Add/update test to cover these changes ← Clarify if new tests needed
  • Update documentation ← Mostly done, but see docs note below
  • Update CHANGELOG file ← REQUIRED per CLAUDE.md

📝 Documentation Note

Consider checking if these docs need updates:

  • docs/configuration/configuration.md - Still references 6.5.1 (see grep results)
  • docs/core-concepts/auto-bundling-file-system-based-automated-bundle-generation.md - Still mentions 6.5.1 as minimum

🎯 Verdict

Conditional Approval - The PR is well-structured and addresses the issue correctly, but requires resolving:

  1. MUST FIX: Commented-out Shakapacker installation code (lines 88-92 of shakapacker_examples.rake)
  2. SHOULD FIX: Update CHANGELOG.md per CLAUDE.md requirements
  3. CONSIDER: Remove or document the unused MINIMUM_SHAKAPACKER_VERSION constant

Once these items are addressed, this PR will be ready to merge.

📚 References

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @react_on_rails/rakelib/shakapacker_examples.rake:
- Around line 88-92: Determine whether React on Rails now injects Shakapacker;
if it does, delete the entire commented block (the TODO and the sh_in_dir(...)
stub referencing example_type.gemfile and the commented "gem 'shakapacker',
'9.4.0'") to remove dead code; if it does not, uncomment and pin the gem line by
replacing the commented sh_in_dir call with a live call that appends "gem
'shakapacker', '9.4.0'" (using the existing sh_in_dir and example_type.gemfile
symbols) and remove the TODO comment so the intent is explicit.
🧹 Nitpick comments (2)
react_on_rails/rakelib/shakapacker_examples.rake (2)

62-68: Update stale comment.

The comment on line 62 states "Updates package.json and Gemfile" but the method now only updates package.json. The Gemfile update logic was removed as part of this PR.

📝 Suggested fix
-  # Updates package.json and Gemfile to use specific React version for compatibility testing
+  # Updates package.json to use specific React version for compatibility testing
   def apply_react_version(dir, react_version)

109-112: Stale comment and potentially unnecessary bundle install.

The comment on lines 111-112 states "Re-run bundle install since Gemfile was updated with pinned shakapacker version", but since the Gemfile update logic for Shakapacker was removed (line 92 is commented out), this bundle_install_in call may no longer be necessary.

📝 Suggested fix

If no Gemfile modifications occur in apply_react_version, consider removing the redundant bundle install:

       if example_type.pinned_react_version?
         apply_react_version(example_type.dir, example_type.react_version_string)
-        # Re-run bundle install since Gemfile was updated with pinned shakapacker version
-        bundle_install_in(example_type.dir)
         # Run npm install BEFORE shakapacker:binstubs to ensure the npm shakapacker version

However, if the Shakapacker gem line (line 92) is intended to be uncommented, keep this but update the comment accordingly.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6914808 and 71bc8d7.

📒 Files selected for processing (12)
  • .claude/docs/pr-testing-guide.md
  • .github/workflows/examples.yml
  • README.md
  • SWITCHING_CI_CONFIGS.md
  • react_on_rails/lib/react_on_rails/configuration.rb
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/example_type.rb
  • react_on_rails/rakelib/run_rspec.rake
  • react_on_rails/rakelib/shakapacker_examples.rake
  • react_on_rails/sig/react_on_rails/configuration.rbs
  • react_on_rails/sig/react_on_rails/packer_utils.rbs
  • react_on_rails/spec/react_on_rails/packer_utils_spec.rb
💤 Files with no reviewable changes (5)
  • react_on_rails/sig/react_on_rails/configuration.rbs
  • react_on_rails/spec/react_on_rails/packer_utils_spec.rb
  • react_on_rails/lib/react_on_rails/configuration.rb
  • react_on_rails/rakelib/example_type.rb
  • react_on_rails/sig/react_on_rails/packer_utils.rbs
🚧 Files skipped from review as they are similar to previous changes (3)
  • react_on_rails/rakelib/run_rspec.rake
  • .github/workflows/examples.yml
  • .claude/docs/pr-testing-guide.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rb

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rb: Run bundle exec rubocop and fix ALL violations before every commit/push
Run bundle exec rubocop (MANDATORY) before every commit to ensure zero offenses

Files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages

Applied to files:

  • README.md
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)

Applied to files:

  • README.md
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)

Applied to files:

  • README.md
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.

Applied to files:

  • README.md
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
Repo: shakacode/react_on_rails PR: 1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.

Applied to files:

  • README.md
  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
Repo: shakacode/react_on_rails PR: 1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.

Applied to files:

  • README.md
  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-02-18T13:08:01.477Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.

Applied to files:

  • README.md
  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.

Applied to files:

  • README.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use Playwright E2E tests in `react_on_rails/spec/dummy/e2e/playwright/` for React component integration testing. Tests automatically start Rails server on port 5017 before running

Applied to files:

  • README.md
  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-07-08T05:57:29.630Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1745
File: node_package/src/RSCRequestTracker.ts:8-14
Timestamp: 2025-07-08T05:57:29.630Z
Learning: The global `generateRSCPayload` function in React on Rails Pro (RORP) is provided by the framework during rendering requests, not implemented in application code. The `declare global` statements are used to document the expected interface that RORP will inject at runtime.

Applied to files:

  • README.md
📚 Learning: 2025-02-13T16:50:47.848Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: node_package/src/clientStartup.ts:18-21
Timestamp: 2025-02-13T16:50:47.848Z
Learning: In the react_on_rails module, the `reactOnRailsPageUnloaded` function in clientStartup.ts is intentionally kept private as it's only used internally as a callback for `onPageUnloaded`.

Applied to files:

  • README.md
📚 Learning: 2025-10-23T17:22:01.074Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1875
File: lib/react_on_rails/utils.rb:112-124
Timestamp: 2025-10-23T17:22:01.074Z
Learning: In React on Rails, when Pro is installed but not licensed, the intended behavior is to raise an error on boot. The `react_on_rails_pro?` method validates licenses and should raise errors early (including during path resolution in methods like `server_bundle?`) to enforce licensing requirements rather than failing later with obscure errors.

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`

Applied to files:

  • react_on_rails/lib/react_on_rails/packer_utils.rb
  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Shakapacker configuration should be tested by creating debug scripts in dummy app root (debug-webpack-rules.js, debug-webpack-with-config.js) to inspect webpack rules before committing configuration changes

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: In IDE configuration, exclude these directories to prevent slowdowns: /coverage, /tmp, /gen-examples, /packages/react-on-rails/lib, /node_modules, /react_on_rails/spec/dummy/node_modules, /react_on_rails/spec/dummy/tmp, /react_on_rails/spec/dummy/app/assets/webpack, /react_on_rails/spec/dummy/log, /react_on_rails/spec/dummy/e2e/playwright-report, /react_on_rails/spec/dummy/test-results

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to lib/react_on_rails/engine.rb : In Rails Engine code, DO NOT use `rake_tasks` block to explicitly load rake files from `lib/tasks/` - Rails::Engine automatically loads them. Only use `rake_tasks` block if tasks are in non-standard location, need programmatic generation, or need to pass context

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/config/webpack/**/*.js : Use `namedExport: false` and `exportLocalsConvention: 'camelCase'` for CSS Modules loader options in Shakapacker 9.0+ if existing code uses `import styles from './file.module.css'` pattern

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2024-12-12T13:07:09.929Z
Learnt from: alexeyr-ci
Repo: shakacode/react_on_rails PR: 1644
File: node_package/src/ReactOnRailsRSC.ts:87-87
Timestamp: 2024-12-12T13:07:09.929Z
Learning: When handling errors in 'node_package/src/ReactOnRailsRSC.ts', include the error stack in error messages in development and test environments to aid debugging.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Never manually format code during conflict resolution - always use `rake autofix` after resolving logical conflicts to maintain automated formatting standards

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-01-23T18:20:45.824Z
Learnt from: alexeyr-ci
Repo: shakacode/react_on_rails PR: 1687
File: spec/dummy/package.json:0-0
Timestamp: 2025-01-23T18:20:45.824Z
Learning: When adding or updating dependencies in spec/dummy/package.json, maintain version consistency with other package.json files in the codebase to avoid potential version conflicts.

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/app_commands/**/*.rb : Create custom Rails app commands in `e2e/playwright/app_commands/` directory with .rb files for reusable helpers in Playwright tests

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to {package.json,webpack.config.js,packages/*/package.json,react_on_rails_pro/package.json} : When resolving merge conflicts in build configuration files, verify file paths are correct by running `grep -r 'old/path' .` and test affected scripts like `pnpm run prepack` before continuing the merge

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: For infrastructure/config changes, perform comprehensive local testing including: finding all affected files with grep, testing build pipeline, running relevant specs, and linting everything before pushing

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use `app('clean')`, `appEval(code)`, `appFactories(options)`, and `appScenario(name)` helpers from cypress-on-rails in Playwright tests for Rails integration

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to **/*.rb : Run `bundle exec rubocop` and fix ALL violations before every commit/push

Applied to files:

  • react_on_rails/rakelib/shakapacker_examples.rake
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Git pre-commit hooks automatically run RuboCop (auto-fix), ESLint (auto-fix), Prettier (auto-format), and trailing newline checks on all changed files before each commit

Applied to files:

  • SWITCHING_CI_CONFIGS.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Install Playwright browsers with `cd react_on_rails/spec/dummy && pnpm playwright install --with-deps` before running E2E tests

Applied to files:

  • SWITCHING_CI_CONFIGS.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: dummy-app-integration-tests (3.2, 20, minimum)
  • GitHub Check: dummy-app-integration-tests (3.4, 22, latest)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: examples (3.2, minimum)
  • GitHub Check: rspec-package-tests (3.2, minimum)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: build
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: claude-review
🔇 Additional comments (3)
SWITCHING_CI_CONFIGS.md (1)

26-27: LGTM! Documentation version updates are consistent.

The Shakapacker version references are updated consistently from 9.3.0 to 9.4.0, and the downgrade path documentation correctly reflects the new baseline.

Also applies to: 127-128

README.md (1)

56-56: LGTM! React version reference updated correctly.

The React on Rails Pro documentation now correctly references React 19 features.

Based on learnings, ensure CHANGELOG.md is updated for this user-visible change (React 19 support documentation) using the format [PR 2247](https://github.com/shakacode/react_on_rails/pull/2247) by [username](https://github.com/username).

react_on_rails/lib/react_on_rails/packer_utils.rb (1)

146-154: LGTM! Error message simplified appropriately.

The error message now clearly communicates the autobundling version requirement and current installed version without referencing the removed basic pack generation feature. The message is concise and actionable.

Comment thread react_on_rails/rakelib/shakapacker_examples.rake Outdated
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react-on-rails/client bundled (gzip) 62.5 KB (0%)
react-on-rails/client bundled (gzip) (time) 62.5 KB (0%)
react-on-rails/client bundled (brotli) 53.7 KB (0%)
react-on-rails/client bundled (brotli) (time) 53.7 KB (0%)
react-on-rails-pro/client bundled (gzip) 63.48 KB (0%)
react-on-rails-pro/client bundled (gzip) (time) 63.48 KB (0%)
react-on-rails-pro/client bundled (brotli) 54.58 KB (0%)
react-on-rails-pro/client bundled (brotli) (time) 54.58 KB (0%)
registerServerComponent/client bundled (gzip) 127.38 KB (0%)
registerServerComponent/client bundled (gzip) (time) 127.38 KB (0%)
registerServerComponent/client bundled (brotli) 61.58 KB (0%)
registerServerComponent/client bundled (brotli) (time) 61.58 KB (0%)
wrapServerComponentRenderer/client bundled (gzip) 121.96 KB (0%)
wrapServerComponentRenderer/client bundled (gzip) (time) 121.96 KB (0%)
wrapServerComponentRenderer/client bundled (brotli) 56.66 KB (0%)
wrapServerComponentRenderer/client bundled (brotli) (time) 56.66 KB (0%)

justin808 added a commit that referenced this pull request Feb 6, 2026
Added changelog entry for 16.3.0 release (2026-02-05) with entries for three bug fixes:
- PR #2275: Fix rspack configuration not applying to all environments
- PR #2280: Fix precompile hook when Shakapacker is pre-installed
- PR #2273: Fix bin/dev failing with --route flag

Also includes PR #2247 (Simplified Shakapacker version handling) under Changed section.

Updated version comparison links at bottom of changelog.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
justin808 added a commit that referenced this pull request Feb 6, 2026
### Summary

Added changelog entry for React on Rails 16.3.0 (released 2026-02-05)
documenting all user-visible changes:

**Changed:**
- PR #2247: Simplified Shakapacker version handling

**Fixed:**
- PR #2275: Fix rspack configuration not applying to all environments
(fixes `bin/switch-bundler` crash and `--rspack` flag only updating
default section)
- PR #2280: Fix precompile hook when Shakapacker is pre-installed (fixes
missing component bundles in production)
- PR #2273: Fix `bin/dev` failing with `--route` flag

Updated version comparison links at the bottom of the file.

### Pull Request checklist

- [x] Update CHANGELOG file

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Changed**
  * Simplified handling of Shakapacker version (16.3.0)

* **Bug Fixes**
* Fixed environment/application behavior not being applied consistently
  * Fixed precompile hook when assets are pre-installed
  * Fixed route handling in the development command
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
justin808 added a commit that referenced this pull request Feb 8, 2026
### Summary

Added changelog entry for React on Rails 16.3.0 (released 2026-02-05)
documenting all user-visible changes:

**Changed:**
- PR #2247: Simplified Shakapacker version handling

**Fixed:**
- PR #2275: Fix rspack configuration not applying to all environments
(fixes `bin/switch-bundler` crash and `--rspack` flag only updating
default section)
- PR #2280: Fix precompile hook when Shakapacker is pre-installed (fixes
missing component bundles in production)
- PR #2273: Fix `bin/dev` failing with `--route` flag

Updated version comparison links at the bottom of the file.

### Pull Request checklist

- [x] Update CHANGELOG file

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Changed**
  * Simplified handling of Shakapacker version (16.3.0)

* **Bug Fixes**
* Fixed environment/application behavior not being applied consistently
  * Fixed precompile hook when assets are pre-installed
  * Fixed route handling in the development command
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant