Skip to content

Conversation

@justin808
Copy link
Member

@justin808 justin808 commented Oct 6, 2025

Summary

  • Renamed demos/basic-v16 to demos/basic-v16-rspack for clarity
  • Updated shakapacker from github:shakacode/shakapacker to ~> 9.0.0.beta.11
  • Updated .demo-metadata.yml, Gemfile, and README.md

This makes the demo's Rspack focus more explicit and uses the official beta release instead of a GitHub reference.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced a new RSpack-based demo (basic-v16-rspack).
    • Added built-in commands to run Rails, Shakapacker, and its dev server.
    • Included a switch-bundler command to toggle between Webpack and RSpack.
  • Tests

    • Added E2E Playwright rake tasks (run/open/report and multi‑mode runner) for the new demo.
  • Documentation

    • Updated README and demo metadata to reflect the RSpack demo.
  • Chores

    • Upgraded Shakapacker to ~> 9.0.0.beta.11 and standardized Gemfile entries.
  • Revert

    • Removed equivalent scripts and E2E tasks from the legacy basic‑v16 demo.

…beta.11

- Renamed demos/basic-v16 to demos/basic-v16-rspack for clarity
- Updated shakapacker from github:shakacode/shakapacker to ~> 9.0.0.beta.11
- Updated .demo-metadata.yml, Gemfile, and README.md with new name and version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new rspack-based demo (basic-v16-rspack) with metadata, Gemfile, bin scripts, config, and e2e tasks. Removes corresponding scripts/tasks from basic-v16. Updates string literal styles across many Ruby files. Adjusts shakapacker to ~> 9.0.0.beta.11. Updates DemoScripts::DemoManager.each_demo signature to use anonymous block.

Changes

Cohort / File(s) Summary
Demo metadata update
demos/basic-v16-rspack/.demo-metadata.yml
Renames demo to basic-v16-rspack; updates demo_directory, shakapacker version (~> 9.0.0.beta.11), and command entry.
Gem and docs adjustments
demos/basic-v16-rspack/Gemfile, demos/basic-v16-rspack/README.md
Switches to versioned shakapacker gem; normalizes quotes; updates title/dependency note in README.
Rails app string-style pass
demos/basic-v16-rspack/... (Rakefile, app/, config.ru, config/.rb, config/environments/, config/initializers/, config/routes.rb, test/test_helper.rb, bin/bundle, bin/dev, bin/rake, bin/rubocop, bin/setup)
Converts double-quoted strings to single-quoted; no functional changes.
Rails boot files
demos/basic-v16-rspack/config/boot.rb, demos/basic-v16-rspack/bin/rails
Adds standard boot and Rails CLI launcher for the new demo.
Shakapacker CLI for rspack demo
demos/basic-v16-rspack/bin/shakapacker, demos/basic-v16-rspack/bin/shakapacker-dev-server
Adds runners invoking Shakapacker runner/dev server with environment setup.
Security and tooling launchers
demos/basic-v16-rspack/bin/brakeman, demos/basic-v16-rspack/bin/thrust
Adds wrappers to load Brakeman and Thruster via Gem.bin_path.
Bundler switch utility (rspack demo)
demos/basic-v16-rspack/bin/switch-bundler
New CLI to switch between webpack and rspack by editing shakapacker.yml and package.json; optional npm install.
E2E tasks (rspack demo)
demos/basic-v16-rspack/lib/tasks/e2e.rake
Adds e2e namespace with tasks: test_all_modes, test, open, report; uses ShakacodeDemoCommon::E2eTestRunner.
Removal of legacy demo scripts
demos/basic-v16/bin/brakeman, demos/basic-v16/bin/rails, demos/basic-v16/bin/shakapacker, demos/basic-v16/bin/shakapacker-dev-server, demos/basic-v16/bin/switch-bundler, demos/basic-v16/bin/thrust, demos/basic-v16/config/boot.rb, demos/basic-v16/lib/tasks/e2e.rake
Deletes corresponding scripts, boot file, and e2e tasks from basic-v16.
Demo manager API tweak
lib/demo_scripts/demo_manager.rb
Changes method signature from def each_demo(&block) to def each_demo(&) and forwards anonymous block.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant SB as switch-bundler
  participant CFG as shakapacker.yml
  participant PKG as package.json
  participant NPM as npm

  Dev->>SB: switch-bundler rspack [--install-deps]
  SB->>CFG: Read current assets_bundler
  alt Already target bundler
    SB-->>Dev: Print "already using target"
  else Needs switch
    SB->>CFG: Update assets_bundler (and transpiler if rspack)
    SB->>PKG: Add/remove deps for target bundler
    SB->>PKG: Write updated package.json
    opt --install-deps
      SB->>NPM: npm install
      NPM-->>SB: Exit status
    end
    SB-->>Dev: Print next steps
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A rabbit hops to RSpack’s tune,
Switching gears beneath the moon.
Scripts appear, old trails retract,
E2E runs keep us on track.
Gems aligned, the paths are clear—
Thump-thump! New demos, drawing near. 🐇✨

✨ 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/rename-v16-rspack

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7e6016 and 5906267.

⛔ Files ignored due to path filters (4)
  • demos/basic-v16-rspack/Gemfile.lock is excluded by !**/*.lock
  • demos/basic-v16-rspack/package-lock.json is excluded by !**/package-lock.json
  • demos/basic-v16-rspack/public/icon.png is excluded by !**/*.png
  • demos/basic-v16-rspack/public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (39)
  • demos/basic-v16-rspack/.demo-metadata.yml (1 hunks)
  • demos/basic-v16-rspack/Gemfile (1 hunks)
  • demos/basic-v16-rspack/README.md (1 hunks)
  • demos/basic-v16-rspack/Rakefile (1 hunks)
  • demos/basic-v16-rspack/app/controllers/hello_world_controller.rb (1 hunks)
  • demos/basic-v16-rspack/app/mailers/application_mailer.rb (1 hunks)
  • demos/basic-v16-rspack/bin/brakeman (1 hunks)
  • demos/basic-v16-rspack/bin/bundle (5 hunks)
  • demos/basic-v16-rspack/bin/dev (1 hunks)
  • demos/basic-v16-rspack/bin/rails (1 hunks)
  • demos/basic-v16-rspack/bin/rake (1 hunks)
  • demos/basic-v16-rspack/bin/rubocop (1 hunks)
  • demos/basic-v16-rspack/bin/setup (2 hunks)
  • demos/basic-v16-rspack/bin/shakapacker (1 hunks)
  • demos/basic-v16-rspack/bin/shakapacker-dev-server (1 hunks)
  • demos/basic-v16-rspack/bin/switch-bundler (1 hunks)
  • demos/basic-v16-rspack/bin/thrust (1 hunks)
  • demos/basic-v16-rspack/config.ru (1 hunks)
  • demos/basic-v16-rspack/config/application.rb (1 hunks)
  • demos/basic-v16-rspack/config/boot.rb (1 hunks)
  • demos/basic-v16-rspack/config/environment.rb (1 hunks)
  • demos/basic-v16-rspack/config/environments/development.rb (3 hunks)
  • demos/basic-v16-rspack/config/environments/production.rb (4 hunks)
  • demos/basic-v16-rspack/config/environments/test.rb (2 hunks)
  • demos/basic-v16-rspack/config/initializers/assets.rb (1 hunks)
  • demos/basic-v16-rspack/config/initializers/react_on_rails.rb (3 hunks)
  • demos/basic-v16-rspack/config/puma.rb (1 hunks)
  • demos/basic-v16-rspack/config/routes.rb (1 hunks)
  • demos/basic-v16-rspack/lib/tasks/e2e.rake (1 hunks)
  • demos/basic-v16-rspack/test/test_helper.rb (1 hunks)
  • demos/basic-v16/bin/brakeman (0 hunks)
  • demos/basic-v16/bin/rails (0 hunks)
  • demos/basic-v16/bin/shakapacker (0 hunks)
  • demos/basic-v16/bin/shakapacker-dev-server (0 hunks)
  • demos/basic-v16/bin/switch-bundler (0 hunks)
  • demos/basic-v16/bin/thrust (0 hunks)
  • demos/basic-v16/config/boot.rb (0 hunks)
  • demos/basic-v16/lib/tasks/e2e.rake (0 hunks)
  • lib/demo_scripts/demo_manager.rb (2 hunks)

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 closed this Oct 6, 2025
@claude
Copy link

claude bot commented Oct 6, 2025

Pull Request Review - PR #22

Summary

This PR renames demos/basic-v16 to demos/basic-v16-rspack and updates the Shakapacker dependency from a GitHub reference to the official beta release. The changes are well-structured and improve clarity about the demo's Rspack focus.


Issues Found - CRITICAL

Package.json Inconsistency at demos/basic-v16-rspack/package.json:21

The package.json still references "github:shakacode/shakapacker" while the Gemfile was updated to "~> 9.0.0.beta.11". This creates an inconsistency between Ruby and JavaScript dependencies.

Recommendation: Update to "^9.0.0-beta.11"


Strengths

  1. Clear Intent - The rename makes the Rspack focus explicit
  2. Consistent Updates - All references properly updated
  3. Dependency Stabilization - Moving to official beta release
  4. Code Quality - Consistent single-quote style throughout Ruby files
  5. Added Utility - The bin/switch-bundler script is valuable

Code Quality

Ruby Code Style:

  • Consistent single-quote usage
  • Proper frozen string literals
  • Good use of Ruby idioms

bin/switch-bundler Script:

  • Clear documentation and usage examples
  • Proper error handling (line 114-118)
  • Safe YAML loading (line 40)

Minor suggestions:

  • Add error handling for file operations
  • Check system() call return status (line 87)

Security

  • No obvious security vulnerabilities
  • File operations are local and controlled
  • No user input injection risks
  • Minor: Consider backup mechanism before modifying package.json

Performance

  • File rename operations are efficient
  • No performance concerns in Ruby code
  • Synchronous design appropriate for CLI tool

Test Coverage

This is a refactoring/rename PR. Recommend manually verifying the demo starts correctly after the rename.


Additional Recommendations

  1. Update CI/CD pipelines referencing basic-v16
  2. Verify Gemfile.lock is updated correctly
  3. Consider migration note in main README

Verdict

Approve with minor fixes required

The PR is well-executed, but the package.json dependency inconsistency should be addressed before merging.

Priority: Fix package.json shakapacker version mismatch (Critical)

Great work on maintaining consistency across all configuration files!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants