Repository navigation
fix(init): match the React starter's oxc-transform-react to @vitejs/plugin-react - #637
Conversation
…lugin-react
The React starter enables `react({ compiler: true })` and adds
oxc-transform-react ^0.149.0, but @vitejs/plugin-react 6.1.2, which
@void/react depends on, declares an optional peer of ^0.152.0. On 0.x
that range is 0.152.x only, so new projects start with an invalid peer
(`npm ls` reports it, and strict peer installs can fail).
The range had drifted unnoticed since it was added, so a unit test now
compares it with the installed plugin's peer and fails when a catalog
bump moves it.
cpojer
left a comment
There was a problem hiding this comment.
This makes sense, although it should probably just be part of the deps setup so it automatically gets updated when we update real deps for Void.
|
Thanks for merging! Agreed it would be better if this followed the real deps automatically. One thing to keep in mind if we do that: the range has to follow So the automatic approach would probably be to generate the starter's range from the installed plugin-react's |
What
Updates the React starter's
oxc-transform-reactfrom^0.149.0to^0.152.0, and adds a unit test (template.test.ts) that compares it with the optional peer range declared by the installed@vitejs/plugin-react.Why
The React starter enables
react({ compiler: true }).@vitejs/plugin-react6.1.2, which@void/reactdepends on, declaresoxc-transform-react: ^0.152.0as an optional peer. On 0.x that range is 0.152.x only, so new projects started with an invalid peer (npm lsreports it, and strict peer installs can fail).The pinned range already differed from the peer when it was introduced (
@vitejs/plugin-react6.1.1 declared^0.145.0), and nothing caught it. The new test fails when a catalog bump moves the peer, so the starter has to be updated in the same change.Verification
template.test.tspasses, and reverting the range to^0.149.0makes it fail withexpected '^0.149.0' to be '^0.152.0'.vp run --filter ./packages/void typecheckpasses.voidReact({ react: { compiler: true } })setup andoxc-transform-react@0.152.0installed:npm lsno longer reports the invalid peer, the build passes, and the SSR bundle matches the0.149.0build apart from the project path and deployment ID.🤖 Generated with Claude Code