react/scripts/rollup
Andrew Clark 9b5e0517b4
Remove deprecated wildcard folder mapping (#23256)
* Remove deprecated folder mapping

Node v16 deprecated the use of trailing "/" to define subpath folder
mappings in the "exports" field of package.json.

The recommendation is to explicitly list all our exports. We already do
that for all our public modules. I believe the only reason we have a
wildcard pattern is because our package.json files are also used at
build time (by Rollup) to resolve internal source modules that don't
appear in the final npm artifact.

Changing trailing "/" to "/*" fixes the warnings. See
https://nodejs.org/api/packages.html#subpath-patterns for more info.

Since the wildcard pattern only exists so our build script has access to
internal at build time, I've scoped the wildcard to "/src/*". Because
our public modules are located outside the "src" directory, this means
deep imports of our modules will no longer work: only packages that are
listed in the "exports" field.

The only two affected packages are react-dom and react. We need to be
sure that all our public modules are still reachable. I audited the
exports by comparing the entries to the "files" field in package.json,
which represents a complete list of the files that are included in the
final release artifact.

At some point, we should add an e2e packaging test to prevent
regressions; for now, we should have decent coverage because in CI we
run our Jest test suite against the release artifacts.

* Remove umd from exports

Our expectation is that if you're using the UMD builds, you're not
loading them through a normal module system like require or import.
Instead you're probably copying the files directly or loading them from
a CDN like unpkg.
2022-02-09 11:37:17 -08:00
..
plugins Remove path resolution from internal forks plugin (#23255) 2022-02-09 08:44:02 -08:00
shims Remove unused react-internal/invariant-args ESLint rule. (#22778) 2021-11-16 20:11:20 +00:00
validate Add onRecoverableError option to hydrateRoot, createRoot (#23207) 2022-02-04 07:57:33 -08:00
wrappers Fix module-boundary wrappers (#22688) 2021-11-04 10:40:35 -04:00
build-all-release-channels.js Add --no-show-signature to "git show" commands (#23038) 2022-01-11 12:14:08 -05:00
build.js Follow-up improvements to error code extraction infra (#22516) 2021-10-31 15:37:32 -07:00
bundles.js Remove deprecated wildcard folder mapping (#23256) 2022-02-09 11:37:17 -08:00
forks.js Remove path resolution from internal forks plugin (#23255) 2022-02-09 08:44:02 -08:00
modules.js Re-add old Fabric Offscreen impl behind flag (#22018) 2021-08-03 19:30:20 -07:00
packaging.js Exclude react-dom/unstable_testing entry point from stable releases (#23258) 2022-02-08 23:12:31 -05:00
stats.js Fix sizebot (#15771) 2019-05-29 21:30:16 -07: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 #22988 - Fix Bug: @license header in React 18 bundles contains vundefined (#23004) 2021-12-21 12:27:59 -05:00