Files
react/packages/react-server-dom-webpack/package.json

68 lines
1.6 KiB
JSON
Raw Normal View History

{
"name": "react-server-dom-webpack",
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
"version": "0.1.0",
"keywords": [
"react"
],
"homepage": "https://reactjs.org/",
"bugs": "https://github.com/facebook/react/issues",
"license": "MIT",
"files": [
"LICENSE",
"README.md",
"index.js",
"plugin.js",
"client.js",
"server.js",
"server.browser.js",
"server.node.js",
"node-register.js",
"cjs/",
"umd/",
"esm/"
],
"exports": {
".": "./index.js",
"./plugin": "./plugin.js",
"./client": "./client.js",
"./server": {
"react-server": {
"node": "./server.node.js",
"browser": "./server.browser.js"
},
"default": "./server.js"
},
"./server.node": "./server.node.js",
"./server.browser": "./server.browser.js",
"./node-loader": "./esm/react-server-dom-webpack-node-loader.js",
"./node-register": "./node-register.js",
"./src/*": "./src/*",
"./package.json": "./package.json"
},
"main": "index.js",
"repository": {
"type" : "git",
"url" : "https://github.com/facebook/react.git",
"directory": "packages/react-server-dom-webpack"
},
"engines": {
"node": ">=0.10.0"
},
"peerDependencies": {
2020-10-20 21:41:18 +01:00
"react": "^17.0.0",
"react-dom": "^17.0.0",
"webpack": "^5.59.0"
},
"dependencies": {
Support named exports from client references (#20312) * Rename "name"->"filepath" field on Webpack module references This field name will get confused with the imported name or the module id. * Switch back to transformSource instead of getSource getSource would be more efficient in the cases where we don't need to read the original file but we'll need to most of the time. Even then, we can't return a JS file if we're trying to support non-JS loader because it'll end up being transformed. Similarly, we'll need to parse the file and we can't parse it before it's transformed. So we need to chain with other loaders that know how. * Add acorn dependency This should be the version used by Webpack since we have a dependency on Webpack anyway. * Parse exported names of ESM modules We need to statically resolve the names that a client component will export so that we can export a module reference for each of the names. For export * from, this gets tricky because we need to also load the source of the next file to parse that. We don't know exactly how the client is built so we guess it's somewhat default. * Handle imported names one level deep in CommonJS using a Proxy We use a proxy to see what property the server access and that will tell us which property we'll want to import on the client. * Add export name to module reference and Webpack map To support named exports each name needs to be encoded as a separate reference. It's possible with module splitting that different exports end up in different chunks. It's also possible that the export is renamed as part of minification. So the map also includes a map from the original to the bundled name. * Special case plain CJS requires and conditional imports using __esModule This models if the server tries to import .default or a plain require. We should replicate the same thing on the client when we load that module reference. * Dedupe acorn-related deps Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
2020-11-30 17:37:27 -05:00
"acorn": "^6.2.1",
"neo-async": "^2.6.1",
"loose-envify": "^1.1.0"
},
"browserify": {
"transform": [
"loose-envify"
]
}
}