build: replace tsup with tsdown and apply React Compiler to published dist#799
Open
acasazza wants to merge 1 commit into
Open
build: replace tsup with tsdown and apply React Compiler to published dist#799acasazza wants to merge 1 commit into
acasazza wants to merge 1 commit into
Conversation
… dist tsup silently ignored the babelOptions config, so babel-plugin-react-compiler was never actually applied to any published artifact. tsdown (rolldown) wires it through @rolldown/plugin-babel + reactCompilerPreset with target 19, and a post-build check-compiler guard now fails the build if the compiler output ever goes missing again. - hooks: react peer range tightened to >=19.0.0 (compiled output imports the built-in react/compiler-runtime) - react-components: platform browser keeps the require-interop shim browser-safe; gains check-exports (attw) and a ci script like its siblings - drop prop-types: its validators were dead code only used to derive one internal type, and its untyped import broke the rolldown dts build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
babelOptionskey that tsup silently ignored —babel-plugin-react-compilerwas never actually applied to any published artifact. This PR makes it real: 9 compiled functions inhooks, 134 inreact-components(target: '19').What changed
core,hooks,react-components) build withtsdown ^0.22.4; the compiler is wired via@rolldown/plugin-babel+reactCompilerPreset()(official tsdown recipe).buildruns acheck-compilerassertion thatreact/compiler-runtimeis present in both dist files, so a silently-skipped compiler can never ship again. All three packages now have uniformciscripts;react-componentsgains theattw --packexports check it was missing.fixedExtension: false), identical exports maps,"use client"banner, and an externals diff of exactly one line —react/compiler-runtime.platform: 'browser'on react-components keeps rolldown's require-interop shim browser-safe (the node default emits a top-levelnode:moduleimport that breaks consumer bundles).hookspeer range tightened toreact >=19.0.0(compiled output imports the built-in compiler runtime) —make:version.Verification
attwgreen on all resolution modes for all three packages;pnpm typecheckreports the same pre-existing error set as before (no additions).guest-addresses.spec.ts12×/12 clean — better than the 11/12 tsup baseline.Note: mfe-checkout needed a React 18.3.1 → 19.2.7 upgrade to consume the compiled dist (React 18 has no
react/compiler-runtime); that change lives in the mfe-checkout repo and is not yet committed there.🤖 Generated with Claude Code