[Feature Request] React Compiler support for Parcel React Transformer
π feature request
Add React Compiler support for Parcel's React Transformer.
π€ Expected Behavior
Maybe some kind of an addon package @parcel/transformer-react-compiler.
π― Current Behavior
N/A
π Possible Solution
React Compiler is currently published as a Babel plugin package, but it is possible to run babel. transformAsync directly.
π¦ Context
π» Examples
You can add it to your babel.config.json already right?
You can add it to your
babel.config.jsonalready right?
But it will disable Parcelβs default transpiler.
Hmm I don't think so. Babel will run in addition to the default transpiler. You can configure babel to only include the react compiler and not include things like preset-env, which parcel will handle after babel runs.
I was able to modify my babel.config.json to run the react compiler with the following.
{
"plugins": ["babel-plugin-react-compiler"]
}
Something doesn't seem correct though - the bundle size is quite a bit larger now.
dist\public.b172548e.js 405.65 kB 267ms
dist\public.ee19fac5.js 427.54 kB 435ms
I know the react compiler ran successfully because I logged it's output, but I expected the bundle to be at least the same size, if not smaller.
React Compiler will increase the bundle size a bit due to the extra code it generates for memoization, so I don't think that's unexpected.