Skip to content

Upgrade Shakapacker to 8.0.0, Upgrade ROR to 14.0.4#415

Merged
justin808 merged 25 commits intomasterfrom
ramezweissa/shakapacker-ror-upgrades
Jul 5, 2024
Merged

Upgrade Shakapacker to 8.0.0, Upgrade ROR to 14.0.4#415
justin808 merged 25 commits intomasterfrom
ramezweissa/shakapacker-ror-upgrades

Conversation

@rameziophobia
Copy link
Copy Markdown
Contributor

@rameziophobia rameziophobia commented Jun 30, 2024

Summary by CodeRabbit

  • New Features

    • Updated dependencies to react-on-rails v14.0.4 and shakapacker v8.0.0.
    • Scripts now use shakapacker instead of webpacker for building.
    • Improved error handling in lazyApollo.ts for missing csrfToken.
  • Documentation

    • Updated references and file paths in various configuration files.
    • Added NVM configuration in spec/dummy/.nvmrc.
    • Renamed file path in spec/dummy/README.md and added reference to CONTRIBUTING.md.
  • Refactor

    • Replaced Webpacker with Shakapacker in various files such as assets_precompile_spec.rb and utils_spec.rb.
    • Updated webpack.config.js function to handle invalid NODE_ENV.
  • Bug Fixes

    • Improved error handling in restartWorkers in restartWorkers.ts.
    • Resolved TypeScript error in worker.ts related to worker ID access.
  • Chores

    • Introduced shakapacker Ruby scripts for setup and development server.
    • Modified comments and configurations in shakapacker.yml and various Procfile.dev commands.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 30, 2024

Walkthrough

The changes involve updating dependencies and build scripts to use shakapacker instead of webpacker, altering import statements, and adjusting configurations across the project to accommodate these updates.

Changes

File(s) Summary
package.json, Procfile.dev, spec/dummy/.nvmrc, spec/dummy/Procfile.dev, spec/dummy/README.md Upgrade dependencies and build scripts to use shakapacker instead of webpacker.
packages/node-renderer/src/shared/errorReporter.ts, packages/node-renderer/src/worker.ts Modify import statements related to Sentry in the node-renderer package.
react_on_rails_pro.gemspec Update version dependency for react_on_rails in the react_on_rails_pro gemspec file.
spec/dummy/config/shakapacker.yml, spec/dummy/config/webpack/commonWebpackConfig.js, spec/dummy/config/webpack/webpack.config.js Adjust configurations to work with shakapacker instead of webpacker.
spec/dummy/bin/shakapacker, spec/dummy/bin/shakapacker-dev-server Introduce scripts for running shakapacker in the Rails application environment.

Poem

🐰 Hop and skip,
Dependencies flip,
Shakapacker in,
Where once webpacker's grin,
CodeRabbit celebrates,
A change that innovates! 🎩🐇


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vaukalak
Copy link
Copy Markdown
Contributor

vaukalak commented Jul 1, 2024

rameziophobia one thing to mention, that shakapacker uses package_json package, which allows to use different package managers (npm, yarn_berry etc.).
And the default currently is npm . Hence I would advise to wait for shakacode/react_on_rails#1639 to be merged, and then update the react-on-rails version. Cause in reality, only after that improvement shakapacker 8 is fully supported.

@rameziophobia rameziophobia force-pushed the ramezweissa/shakapacker-ror-upgrades branch from ea4280e to 17883e2 Compare July 3, 2024 13:47
@rameziophobia rameziophobia changed the title Upgrade Shakapacker to 8.0.0, Upgrade ROR to 14.0.3 Upgrade Shakapacker to 8.0.0, Upgrade ROR to 14.0.4 Jul 3, 2024
Copy link
Copy Markdown
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

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

Overall, looking good but with a HUGE omission of the breaking changes (changelog) that require an upgrade to latest shakapacker and react on rails.

@rameziophobia

Comment thread lib/react_on_rails_pro/utils.rb
}

const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how is this related?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

when using node v20 the typescript types for HTTP are more specific. They don't allow null | undefined in the headers and throw a compilation error. we can either do this or raise an error here if the token is not found @justin808

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isn't it safer to raise an error rather than blank?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It can be safer but I didn't want to alter the flow of that component as I don't have context on it. I can just change it and see if any tests will fail

Comment thread spec/dummy/config/webpack/webpack.config.js Outdated
@rameziophobia rameziophobia force-pushed the ramezweissa/shakapacker-ror-upgrades branch from f4887f1 to 00d4974 Compare July 4, 2024 09:27
@rameziophobia rameziophobia requested a review from justin808 July 4, 2024 10:53
AbanoubGhadban pushed a commit to shakacode/react_on_rails that referenced this pull request Sep 25, 2025
This is a follow-up PR for
shakacode/react_on_rails_pro#415

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

- **Bug Fixes**
- Updated the global declaration of `ReactOnRails` in `vm.ts` for
compatibility with node 16+.
- **Documentation**
- Added a note in `basics.md` about `react-on-rails` installation for
`global.ReactOnRails` types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
AbanoubGhadban pushed a commit to shakacode/react_on_rails that referenced this pull request Sep 26, 2025
This is a follow-up PR for
shakacode/react_on_rails_pro#415

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

- **Bug Fixes**
- Updated the global declaration of `ReactOnRails` in `vm.ts` for
compatibility with node 16+.
- **Documentation**
- Added a note in `basics.md` about `react-on-rails` installation for
`global.ReactOnRails` types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

4 participants