react/scripts/rollup
mofeiZ 0c28a09eef
[ci] Reduce non-deterministic builds for eslint-plugin-react-hooks (#33026)
See https://github.com/rollup/plugins/issues/1425

Currently, `@babel/helper-string-parser/lib/index.js` is either emitted
as a wrapped esmodule or inline depending on the ordering of async
functions in `rollup/commonjs`. Specifically,
`@babel/types/lib/definitions/core.js` is cyclic (i.e. transitively
depends upon itself), but sometimes
`@babel/helper-string-parser/lib/index.js` is emitted before this is
realized.


A relatively straightforward patch is to wrap all modules (see
https://github.com/rollup/plugins/issues/1425#issuecomment-1465626736).
This only regresses `eslint-plugin-react-hooks` bundle size by ~1.8% and
is safer (see
https://github.com/rollup/plugins/blob/master/packages/commonjs/README.md#strictrequires)

> The default value of true will wrap all CommonJS files in functions
which are executed when they are required for the first time, preserving
NodeJS semantics. This is the safest setting and should be used if the
generated code does not work correctly with "auto". Note that
strictRequires: true can have a small impact on the size and performance
of generated code, but less so if the code is minified.

(note that we're on an earlier version of `@rollup/commonjs` which does
not default to `strictRequires: true`)
2025-04-25 14:26:59 -04:00
..
externs Replay Client Actions After Hydration (#26716) 2023-04-25 10:22:20 -04:00
plugins Run Closure on non-minified prod builds, too (#28827) 2024-04-19 14:22:38 -04:00
shims Update React Native shims to use export syntax (#31426) 2024-11-07 14:53:44 +00:00
validate Rerender useSwipeTransition when direction changes (#32379) 2025-02-20 18:13:09 -05:00
build-all-release-channels.js [ci] Cleanup --ci flag 2024-07-29 19:18:03 -04:00
build.js [ci] Reduce non-deterministic builds for eslint-plugin-react-hooks (#33026) 2025-04-25 14:26:59 -04:00
bundles.js feat(eslint-plugin-react-hooks): merge rule from eslint-plugin-react-compiler into react-hooks plugin (#32416) 2025-03-12 21:43:06 -04:00
forks.js [flags] remove enableRemoveConsolePatches (#32425) 2025-02-24 10:00:22 -05:00
generate-inline-fizz-runtime.js [useFormState] Allow sync actions (#27571) 2023-10-31 23:32:31 -04:00
modules.js [Flight] Source Map Actions in Reference Node Loader Transforms (#30755) 2024-08-21 09:52:17 -04:00
packaging.js build: add support to the rollup build for building typescript packages (#32393) 2025-02-16 10:38:13 -05:00
stats.js [ci] Cleanup --ci flag 2024-07-29 19:18:03 -04:00
sync.js Fork React Native renderer into FB and OSS bundles (#12625) 2018-04-18 13:16:50 -07:00
utils.js Fixed broken build script --unsafe-partial flag (#22324) 2021-09-15 13:32:09 -04:00
wrappers.js build: add support to the rollup build for building typescript packages (#32393) 2025-02-16 10:38:13 -05:00