2019-11-16 03:46:07 +08:00
{
2020-12-08 21:08:57 +08:00
"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." ,
2022-10-24 11:20:52 +08:00
"version" : "18.2.0" ,
2019-11-16 03:46:07 +08:00
"keywords" : [
"react"
] ,
"homepage" : "https://reactjs.org/" ,
"bugs" : "https://github.com/facebook/react/issues" ,
"license" : "MIT" ,
"files" : [
"LICENSE" ,
"README.md" ,
"index.js" ,
2020-04-04 05:04:56 +08:00
"plugin.js" ,
2022-10-18 22:15:52 +08:00
"client.js" ,
2023-02-17 00:01:52 +08:00
"client.browser.js" ,
"client.edge.js" ,
"client.node.js" ,
"client.node.unbundled.js" ,
2022-10-18 22:15:52 +08:00
"server.js" ,
"server.browser.js" ,
2023-02-08 04:10:01 +08:00
"server.edge.js" ,
2022-10-18 22:15:52 +08:00
"server.node.js" ,
2023-02-17 00:01:52 +08:00
"server.node.unbundled.js" ,
2020-11-17 12:46:27 +08:00
"node-register.js" ,
2019-11-16 03:46:07 +08:00
"cjs/" ,
2020-11-17 12:46:27 +08:00
"umd/" ,
"esm/"
2019-11-16 03:46:07 +08:00
] ,
2020-11-17 12:46:27 +08:00
"exports" : {
"." : "./index.js" ,
"./plugin" : "./plugin.js" ,
2023-02-17 00:01:52 +08:00
"./client" : {
"workerd" : "./client.edge.js" ,
"edge-light" : "./client.edge.js" ,
"deno" : "./client.edge.js" ,
"worker" : "./client.edge.js" ,
"node" : {
"webpack" : "./client.node.js" ,
"default" : "./client.node.unbundled.js"
} ,
"browser" : "./client.browser.js" ,
"default" : "./client.browser.js"
} ,
"./client.browser" : "./client.browser.js" ,
"./client.edge" : "./client.edge.js" ,
"./client.node" : "./client.node.js" ,
"./client.node.unbundled" : "./client.node.unbundled.js" ,
2022-10-18 22:15:52 +08:00
"./server" : {
2020-12-08 21:08:57 +08:00
"react-server" : {
2023-02-08 04:10:01 +08:00
"workerd" : "./server.edge.js" ,
2023-02-17 00:01:52 +08:00
"edge-light" : "./server.edge.js" ,
2023-02-08 04:10:01 +08:00
"deno" : "./server.browser.js" ,
2023-02-17 00:01:52 +08:00
"node" : {
"webpack" : "./server.node.js" ,
"default" : "./server.node.unbundled.js"
} ,
2022-10-18 22:15:52 +08:00
"browser" : "./server.browser.js"
2020-12-08 21:08:57 +08:00
} ,
2022-10-18 22:15:52 +08:00
"default" : "./server.js"
2020-12-08 21:08:57 +08:00
} ,
2022-10-18 22:15:52 +08:00
"./server.browser" : "./server.browser.js" ,
2023-02-08 04:10:01 +08:00
"./server.edge" : "./server.edge.js" ,
"./server.node" : "./server.node.js" ,
2023-02-17 00:01:52 +08:00
"./server.node.unbundled" : "./server.node.unbundled.js" ,
2023-02-22 02:18:24 +08:00
"./node-loader" : "./esm/react-server-dom-webpack-node-loader.production.min.js" ,
2020-11-17 12:46:27 +08:00
"./node-register" : "./node-register.js" ,
Update Rollup to 3.x (#26442)
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.
Before submitting a pull request, please make sure the following is
done:
1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
10. If you haven't already, complete the CLA.
Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->
## Summary
This PR:
- Updates Rollup from 2.x to latest 3.x, and updates associated plugins
- Updates deprecated / altered config settings in the Rollup plugin
pipeline
- Fixes some file extension and import issues related to use of ESM in
`react-dom-webpack-server`
- Removes a now-obsolete `strip-unused-imports` Rollup plugin
- <s>Fixes an _existing_ bug with the Rollup 2.x plugin pipeline on
`main` that was causing parts of `DOMProperty.js` to get left out of the
`react-dom-webpack-server` JS bundles, by adding a new plugin to tell
Rollup to treat that file as if it as side effects</s>
This PR should be functionally identical to the other existing "Rollup 3
upgrade" PR at #26078 . I'm filing this as a near-duplicate because I'm
ready to push this change through ASAP so that I can follow it up with a
PR that adds sourcemap support, that PR's artifact diffing seems like
it's possibly stuck and I want to compare the build results, and I've
got this set up against latest `main`.
<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->
This gets React's build setup updated to the latest Rollup version,
which is generally a good practice, but also ensures that any further
Rollup config tweaks can be done using the current Rollup docs as a
reference.
## How did you test this change?
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
If you leave this empty, your PR will very likely be closed.
-->
- Made builds from the latest `main`
- Updated Rollup package versions and cross-compared the changes I
needed to make locally to get successful builds vs #26078
- Diffed the output folders between `main` and this PR, and confirmed
that the bundle contents are identical (with the exception of version
strings and the `react-dom-webpack-server` bundle fix re-adding missing
`DOMProperty.js` content)
2023-03-25 02:08:41 +08:00
"./src/*" : "./src/*.js" ,
2020-11-17 12:46:27 +08:00
"./package.json" : "./package.json"
} ,
2019-11-16 03:46:07 +08:00
"main" : "index.js" ,
"repository" : {
"type" : "git" ,
"url" : "https://github.com/facebook/react.git" ,
2020-12-08 21:08:57 +08:00
"directory" : "packages/react-server-dom-webpack"
2019-11-16 03:46:07 +08:00
} ,
"engines" : {
"node" : ">=0.10.0"
} ,
"peerDependencies" : {
2022-10-24 11:20:52 +08:00
"react" : "^18.2.0" ,
"react-dom" : "^18.2.0" ,
2021-11-26 06:43:22 +08:00
"webpack" : "^5.59.0"
2019-11-16 03:46:07 +08:00
} ,
"dependencies" : {
[Flight Plugin] Scan for "use client" (#26474)
## Summary
Our toy webpack plugin for Server Components is pretty broken right now
because, now that `.client.js` convention is gone, it ends up adding
every single JS file it can find (including `node_modules`) as a
potential async dependency. Instead, it should only look for files with
the `'use client'` directive.
The ideal way is to implement this by bundling the RSC graph first.
Then, we would know which `'use client'` files were actually discovered
— and so there would be no point to scanning the disk for them. That's
how Next.js bundler does it.
We're not doing that here.
This toy plugin is very simple, and I'm not planning to do heavy
lifting. I'm just bringing it up to date with the convention. The change
is that we now read every file we discover (alas), bail if it has no
`'use client'`, and parse it if it does (to verify it's actually used as
a directive). I've changed to use `acorn-loose` because it's forgiving
of JSX (and likely TypeScript/Flow). Otherwise, this wouldn't work on
uncompiled source.
## Test plan
Verified I can get our initial Server Components Demo running after this
change. Previously, it would get stuck compiling and then emit thousands
of errors.
Also confirmed the fixture still works. (It doesn’t work correctly on
the first load after dev server starts, but that’s already the case on
main so seems unrelated.)
2023-03-31 05:05:03 +08:00
"acorn-loose" : "^8.3.0" ,
2020-12-08 01:10:18 +08:00
"neo-async" : "^2.6.1" ,
2022-02-24 08:34:24 +08:00
"loose-envify" : "^1.1.0"
2019-11-16 03:46:07 +08:00
} ,
"browserify" : {
"transform" : [
"loose-envify"
]
}
}