feat: warn about upcoming Node.js v22 minimum for build plugins#7053
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds an upcoming system Node.js minimum version (22.12.0) detector behind a feature flag to the plugin node version handler. When enabled and the user's Node version doesn't meet the upcoming minimum, the handler logs a targeted warning and inspects each plugin's package.json to report whether its declared engines.node range supports Node 22.12.0. The function signature of addPluginsNodeVersion expands to accept featureFlags and systemLog, warning links are updated, and tests/fixtures were extended to validate system log output. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
This pull request adds or modifies JavaScript ( |
Restore the targeted warning from the v20 cycle (#5461): when a plugin's package.json engines.node range explicitly excludes Node.js 22, surface an actionable logWarning telling the author to upgrade, in addition to the general advance-notice warning. Also restore defensive optional chaining on pluginPackageJson. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/build/tests/plugins/tests.js`:
- Around line 114-137: The test creates a temp systemLog and asserts
platform-specific output but doesn't guard Windows or guarantee cleanup; wrap
the assertions and use of systemLog inside a platform check (e.g., if
(process.platform !== 'win32') around the Fixture run/expectations) to mirror
other tests, and ensure systemLog.cleanup() is executed in a finally block after
reading systemLog.path so the temp file is removed even if assertions fail;
locate the systemLog variable and the block that calls new
Fixture(...).runWithBuild() and move the cleanup into a finally surrounding that
work.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ff9ec24e-c5e1-452a-862a-9c21239514a9
⛔ Files ignored due to path filters (3)
deno.lockis excluded by!**/*.lockpackages/build/tests/core/snapshots/tests.js.snapis excluded by!**/*.snappackages/build/tests/plugins/snapshots/tests.js.snapis excluded by!**/*.snap
📒 Files selected for processing (5)
packages/build/src/plugins/node_version.tspackages/build/src/plugins/resolve.jspackages/build/tests/core/snapshots/tests.js.mdpackages/build/tests/plugins/snapshots/tests.js.mdpackages/build/tests/plugins/tests.js
🎉 Thanks for submitting a pull request! 🎉
Summary
Related to FRB-2069
Based on #5461 (warn about upcoming Node.js v18 minimum for build plugins)
When a build plugin would run on a Node.js version below the upcoming minimum (>=22.12.0), we now surface a deprecation warning during the build so plugin authors and users have advance notice before the breaking change lands.
Deploy id:

6a21c57c0e44ddcccde465c3For us to review and ship your PR efficiently, please perform the following steps:
we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
your code follows our style guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)