parcel icon indicating copy to clipboard operation
parcel copied to clipboard

[Feature Request] React Compiler support for Parcel React Transformer

Open SukkaW opened this issue 3 months ago β€’ 5 comments

πŸ™‹ 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

SukkaW avatar Sep 25 '25 15:09 SukkaW

You can add it to your babel.config.json already right?

devongovett avatar Sep 25 '25 16:09 devongovett

You can add it to your babel.config.json already right?

But it will disable Parcel’s default transpiler.

SukkaW avatar Sep 25 '25 19:09 SukkaW

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.

devongovett avatar Sep 25 '25 20:09 devongovett

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.

bradmarder avatar Nov 01 '25 19:11 bradmarder

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.

devongovett avatar Nov 01 '25 22:11 devongovett