mirror of
https://github.com/facebook/react.git
synced 2026-02-25 13:13:03 +00:00
* 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.
65 lines
1.4 KiB
JSON
65 lines
1.4 KiB
JSON
{
|
|
"name": "react-dom",
|
|
"version": "17.0.3",
|
|
"description": "React package for working with the DOM.",
|
|
"main": "index.js",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/facebook/react.git",
|
|
"directory": "packages/react-dom"
|
|
},
|
|
"keywords": [
|
|
"react"
|
|
],
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://github.com/facebook/react/issues"
|
|
},
|
|
"homepage": "https://reactjs.org/",
|
|
"dependencies": {
|
|
"loose-envify": "^1.1.0",
|
|
"object-assign": "^4.1.1",
|
|
"scheduler": "^0.20.1"
|
|
},
|
|
"peerDependencies": {
|
|
"react": "17.0.3"
|
|
},
|
|
"files": [
|
|
"LICENSE",
|
|
"README.md",
|
|
"index.js",
|
|
"profiling.js",
|
|
"server.js",
|
|
"server.browser.js",
|
|
"server.node.js",
|
|
"test-utils.js",
|
|
"unstable_testing.js",
|
|
"cjs/",
|
|
"umd/"
|
|
],
|
|
"exports": {
|
|
".": "./index.js",
|
|
"./server": {
|
|
"deno": "./server.browser.js",
|
|
"worker": "./server.browser.js",
|
|
"browser": "./server.browser.js",
|
|
"default": "./server.node.js"
|
|
},
|
|
"./server.browser": "./server.browser.js",
|
|
"./server.node": "./server.node.js",
|
|
"./profiling": "./profiling.js",
|
|
"./test-utils": "./test-utils.js",
|
|
"./unstable_testing": "./unstable_testing.js",
|
|
"./src/*": "./src/*",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"browser": {
|
|
"./server.js": "./server.browser.js"
|
|
},
|
|
"browserify": {
|
|
"transform": [
|
|
"loose-envify"
|
|
]
|
|
}
|
|
}
|