feat: add rollup:react-compiler
task
#963
Merged
+696
−83
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.
Allows shipping React Compiler output as a separate conditional export condition:
There are a few intentional limits:
react-compiler
condition only supports ESM output, no CJS.react-compiler
sets browser targets, not node, as compiled code is supposed to run in the browser (during SSR, or react server component rendering, there is no lifecycles and thus no need to memoize).source
condition in thereact-compiler
condition, even if it's the same as the parentsource
. I left todos in the code for where we need to implement support for a shorthand:"react-compiler": "./dist/index.react-compiler.js"
version.There's a new root configuration
reactCompilerOptions
, that applies both if thereact-compiler
export condition is used, or if thebabel.reactCompiler = true
option is used.It's mostly useful to specify a
logger.logEvent
to see what the compiler is skipping, and for what reason.