react/scripts
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
..
babel Add comment support to `@gate` pragma (#21881) 2021-07-14 10:36:24 -07:00
bench Bump ecstatic from 2.2.1 to 2.2.2 in /scripts/bench (#20468) 2021-06-29 16:53:31 -04:00
circleci Console message fixed for devtools (#23067) 2022-01-05 11:45:45 -05:00
devtools Console message fixed for devtools (#23067) 2022-01-05 11:45:45 -05:00
error-codes Throw on hydration mismatch and force client rendering if boundary hasn't suspended within concurrent root (#22629) 2021-11-09 13:40:50 -05:00
eslint Migrate from CLIEngine to the new ESLint class. (#22756) 2021-11-18 21:12:18 +00:00
eslint-rules Remove unused react-internal/invariant-args ESLint rule. (#22778) 2021-11-16 20:11:20 +00:00
flow React Native raw event EventEmitter - intended for app-specific perf listeners and debugging (#23232) 2022-02-07 18:34:01 -08:00
git Remove leftover env variable logic in pre-commit hook 2015-09-01 14:35:47 -07:00
jest DevTools: Timeline profiler refactor 2022-01-28 13:09:28 -05:00
merge-fork Improve DEV errors if string coercion throws (Temporal.*, Symbol, etc.) (#22064) 2021-09-27 10:05:07 -07:00
perf-counters Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
prettier DevTools: Update named hooks match to use column number also (#21833) 2021-07-08 16:12:22 -04:00
print-warnings Add onRecoverableError option to hydrateRoot, createRoot (#23207) 2022-02-04 07:57:33 -08:00
release Add --no-show-signature to "git show" commands (#23038) 2022-01-11 12:14:08 -05:00
rollup Remove deprecated wildcard folder mapping (#23256) 2022-02-09 11:37:17 -08:00
shared Remove deprecated wildcard folder mapping (#23256) 2022-02-09 11:37:17 -08:00
tasks Migrate from CLIEngine to the new ESLint class. (#22756) 2021-11-18 21:12:18 +00:00
yarn chore: upgrade to jest 24 (#15778) 2019-10-03 22:44:18 +05:30
authors AUTHORS 2013-09-09 23:42:54 -07:00