Skip to content

feat!: require vite 6+, node.js 22.22+ - #712

Merged
serhalp merged 1 commit into
mainfrom
serhalp/vite-plugin-bump-node-vite
Jun 18, 2026
Merged

feat!: require vite 6+, node.js 22.22+#712
serhalp merged 1 commit into
mainfrom
serhalp/vite-plugin-bump-node-vite

Conversation

@serhalp

@serhalp serhalp commented Jun 17, 2026

Copy link
Copy Markdown
Member

Description

I believe this is the lowest we can go to support React Router 8 while retaining support for React Router 7.

Note: bumped lowest tested node.js version in CI already in #709.

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for remix-edge ready!

Name Link
🔨 Latest commit 5b37498
🔍 Latest deploy log https://app.netlify.com/projects/remix-edge/deploys/6a330d673781310007a1605b
😎 Deploy Preview https://deploy-preview-712--remix-edge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for remix-serverless ready!

Name Link
🔨 Latest commit 5b37498
🔍 Latest deploy log https://app.netlify.com/projects/remix-serverless/deploys/6a330d672dcb130008fb0262
😎 Deploy Preview https://deploy-preview-712--remix-serverless.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The package.json for vite-plugin-react-router has two compatibility fields updated: the peerDependencies entry for vite now requires >=6.0.0 (previously >=5.0.0), and the engines.node field now requires >=22.22.0 (previously >=20.6.1). The e2e and test GitHub Actions workflows are updated to test against Node.js 22.22.0 instead of 22.13.0, aligning the CI test matrix with the new minimum engine requirement.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main breaking changes: requiring Vite 6+ and Node.js 22.22+, which matches the core modifications in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly explains the changes: Vite peer dependency bump from 5+ to 6+ with reasoning about Vite 5 being unsupported, and Node.js minimum version bump from 20.6.1+ to 22.22.0+ with explanation about Node.js 20 being unsupported. The description is directly related to the changeset.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serhalp/vite-plugin-bump-node-vite

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

@github-actions github-actions Bot added the type: chore work needed to keep the product and development running smoothly label Jun 17, 2026
@serhalp serhalp changed the title chore!: require vite 6+, node.js 22.13+ feat!: require vite 6+, node.js 22.13+ Jun 17, 2026
@github-actions github-actions Bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jun 17, 2026
@serhalp
serhalp marked this pull request as ready for review June 17, 2026 20:58
@serhalp
serhalp requested a review from a team as a code owner June 17, 2026 20:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/vite-plugin-react-router/package.json`:
- Line 78: Update the Vite version constraints in package.json to exclude
vulnerable releases. Change the peerDependencies vite constraint from ">=6.0.0"
to ">=6.4.3" to patch the HIGH-severity server.fs.deny bypass vulnerability on
Windows and associated MODERATE issues. Additionally, update devDependencies
vite to "^8.0.16" to ensure the patched version of Vite 8 that addresses the
same HIGH and MODERATE vulnerabilities is used.
🪄 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: 3f601bf7-6eac-4f8d-a223-418ff2dfa73a

📥 Commits

Reviewing files that changed from the base of the PR and between 6a56ab0 and c6a921b.

📒 Files selected for processing (1)
  • packages/vite-plugin-react-router/package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)

Comment thread packages/vite-plugin-react-router/package.json
I believe this is the lowest we can go to support React Router 8 while retaining support for React
Router 7.
@serhalp
serhalp force-pushed the serhalp/vite-plugin-bump-node-vite branch from c6a921b to 5b37498 Compare June 17, 2026 21:11
@serhalp serhalp changed the title feat!: require vite 6+, node.js 22.13+ feat!: require vite 6+, node.js 22.22+ Jun 17, 2026
@serhalp
serhalp merged commit a99b5c4 into main Jun 18, 2026
33 checks passed
@serhalp
serhalp deleted the serhalp/vite-plugin-bump-node-vite branch June 18, 2026 12:12
serhalp added a commit that referenced this pull request Jun 18, 2026
## Description

React Router 8 has just been released.

[React Router 8](https://reactrouter.com/upgrading/v7) makes the Vite
Environment API mandatory and supports Vite 7-8. React Router 7 supports
Vite 6-7 (and 8, starting with 7.14) but users can opt in to this mode
as well via `future.v8_viteEnvironmentApi`.

Either way, the Vite Env API is forward compatible from the "client" and
"ssr" pseudo-environments present previously, and those are backwards
compatible as well.

The main change to contend with here is reading from
`config.environments?.ssr?.build` instead of `config.ssr.build`
directly. This is supported by all combinations of versions and flags
listed above. **Edit:** I ended up doing this via the
`configEnvironment` hook, which is equivalent but runs after React
Router has actually configured its environments.

We also replace `isSsrBuild` with a simple `applyToEnvironment` hook,
which is compatible with all these combinations as well.

Finally, this starts reading from `rolldownOptions` and falling back to
`rollupOptions`. This was entirely optional, but since the latter is
soft-deprecated, I introduced this here. Again, all combinations of
versions and flags are compatible with this.

Essentially:

```
       Vite 5    Vite 6   Vite 7   Vite 8
RR7      EOL       ✓        ✓        ✓    (Vite 8 requires RR 7.14.0+)
RR8      EOL       —        ✓        ✓
```

Now, unfortunately I ended up also needing to somewhat fundamentally
rework the whole plugin's approach. The previous approach was to
register our own input that wraps the (leakily) expected React Router
input. This is now fundamentally incompatible with React Router 8 as
soon as a site has any prerendered pages, because React Router 8 uses a
separate Vite Environment `prerender` that it builds by first building
the other envs, then starting a preview server, making real HTTP
requests to each path to be prerendered, and saving the response to
disk. This request was failing, seemingly due to some
[assumption in React Router 8 that is not happy with its own entry
coexisting with
another](https://github.com/remix-run/react-router/blob/da102b5928d2cf0b94cd0abc2895d0939698e7e9/packages/react-router-dev/vite/plugin.ts#L3578-L3586).
Funny enough, I more or less ended up just porting parts of our
[framework-agnostic
plugin](https://github.com/netlify/framework-adapters/blob/69d233d505afb85d848f702e70441bc3e71008bd/packages/vite-plugin/src/lib/build.ts)
here.

The bulk of the diff in this PR is adding two new fixtures for RR8
serverless + RR7 edge, and refactoring the existing test suite to allow
running table tests with different versions of Vite. This was important
because in testing this locally I contended with all sorts of different
behaviours across combinations. This is a bit clunky and will slow down
CI but I believe it is worthwhile given all this combinatorial
complexity.

Closes #698 

## Related Tickets & Documents

See also #711 and #712
serhalp pushed a commit that referenced this pull request Jun 18, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>vite-plugin-react-router: 4.0.0</summary>

##
[4.0.0](vite-plugin-react-router-v3.1.1...vite-plugin-react-router-v4.0.0)
(2026-06-18)


### ⚠ BREAKING CHANGES

* publish ESM only, remove CJS build
([#713](#713))
* require vite 6+, node.js 22.22+
([#712](#712))

### Features

* publish ESM only, remove CJS build
([#713](#713))
([1dece2c](1dece2c))
* require vite 6+, node.js 22.22+
([#712](#712))
([a99b5c4](a99b5c4))
* support Vite Env API and React Router 8
([#714](#714))
([eeb3a82](eeb3a82))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore work needed to keep the product and development running smoothly type: feature code contributing to the implementation of a feature and/or user facing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants