2013-05-29 12:46:11 -07:00
{
2015-06-02 14:13:11 -07:00
"private" : true ,
2017-10-19 00:22:21 +01:00
"workspaces" : [
"packages/*"
] ,
2013-05-29 12:46:11 -07:00
"devDependencies" : {
2020-08-20 23:47:16 +08:00
"@babel/cli" : "^7.10.5" ,
"@babel/code-frame" : "^7.10.4" ,
"@babel/core" : "^7.11.1" ,
2025-03-12 20:43:06 -05:00
"@babel/helper-define-map" : "^7.18.6" ,
2020-08-20 23:47:16 +08:00
"@babel/helper-module-imports" : "^7.10.4" ,
"@babel/parser" : "^7.11.3" ,
"@babel/plugin-external-helpers" : "^7.10.4" ,
"@babel/plugin-proposal-class-properties" : "^7.10.4" ,
"@babel/plugin-proposal-object-rest-spread" : "^7.11.0" ,
"@babel/plugin-syntax-dynamic-import" : "^7.8.3" ,
2020-11-12 11:11:05 -05:00
"@babel/plugin-syntax-import-meta" : "^7.10.4" ,
2024-02-05 23:07:41 -05:00
"@babel/plugin-syntax-jsx" : "^7.23.3" ,
2021-11-10 04:22:19 +08:00
"@babel/plugin-syntax-typescript" : "^7.14.5" ,
2020-08-20 23:47:16 +08:00
"@babel/plugin-transform-arrow-functions" : "^7.10.4" ,
"@babel/plugin-transform-block-scoped-functions" : "^7.10.4" ,
"@babel/plugin-transform-block-scoping" : "^7.11.1" ,
2025-03-12 19:07:39 -04:00
"@babel/plugin-transform-class-properties" : "^7.25.9" ,
2025-03-15 15:21:57 -04:00
"@babel/plugin-transform-classes" : "^7.10.4" ,
2020-08-20 23:47:16 +08:00
"@babel/plugin-transform-computed-properties" : "^7.10.4" ,
"@babel/plugin-transform-destructuring" : "^7.10.4" ,
"@babel/plugin-transform-for-of" : "^7.10.4" ,
"@babel/plugin-transform-literals" : "^7.10.4" ,
"@babel/plugin-transform-modules-commonjs" : "^7.10.4" ,
"@babel/plugin-transform-object-super" : "^7.10.4" ,
"@babel/plugin-transform-parameters" : "^7.10.5" ,
[compiler] Aggregate error reporting, separate eslint rules (#34176)
NOTE: this is a merged version of @mofeiZ's original PR along with my
edits per offline discussion. The description is updated to reflect the
latest approach.
The key problem we're trying to solve with this PR is to allow
developers more control over the compiler's various validations. The
idea is to have a number of rules targeting a specific category of
issues, such as enforcing immutability of props/state/etc or disallowing
access to refs during render. We don't want to have to run the compiler
again for every single rule, though, so @mofeiZ added an LRU cache that
caches the full compilation output of N most recent files. The first
rule to run on a given file will cause it to get cached, and then
subsequent rules can pull from the cache, with each rule filtering down
to its specific category of errors.
For the categories, I went through and assigned a category roughly 1:1
to existing validations, and then used my judgement on some places that
felt distinct enough to warrant a separate error. Every error in the
compiler now has to supply both a severity (for legacy reasons) and a
category (for ESLint). Each category corresponds 1:1 to a ESLint rule
definition, so that the set of rules is automatically populated based on
the defined categories.
Categories include a flag for whether they should be in the recommended
set or not.
Note that as with the original version of this PR, only
eslint-plugin-react-compiler is changed. We still have to update the
main lint rule.
## Test Plan
* Created a sample project using ESLint v9 and verified that the plugin
can be configured correctly and detects errors
* Edited `fixtures/eslint-v9` and introduced errors, verified that the w
latest config changes in that fixture it correctly detects the errors
* In the sample project, confirmed that the LRU caching is correctly
caching compiler output, ie compiling files just once.
Co-authored-by: Mofei Zhang <feifei0@meta.com>
2025-08-21 14:53:34 -07:00
"@babel/plugin-transform-private-methods" : "^7.10.4" ,
2024-02-05 23:07:41 -05:00
"@babel/plugin-transform-react-jsx" : "^7.23.4" ,
"@babel/plugin-transform-react-jsx-development" : "^7.22.5" ,
2024-02-09 11:17:00 -05:00
"@babel/plugin-transform-react-jsx-source" : "^7.10.5" ,
2020-08-20 23:47:16 +08:00
"@babel/plugin-transform-shorthand-properties" : "^7.10.4" ,
"@babel/plugin-transform-spread" : "^7.11.0" ,
"@babel/plugin-transform-template-literals" : "^7.10.5" ,
2025-03-12 20:43:06 -05:00
"@babel/preset-env" : "^7.26.9" ,
2020-08-20 23:47:16 +08:00
"@babel/preset-flow" : "^7.10.4" ,
2024-02-05 23:07:41 -05:00
"@babel/preset-react" : "^7.23.3" ,
2025-02-16 09:38:13 -06:00
"@babel/preset-typescript" : "^7.26.0" ,
2020-08-20 23:47:16 +08:00
"@babel/traverse" : "^7.11.0" ,
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-24 14:08:41 -04:00
"@rollup/plugin-babel" : "^6.0.3" ,
"@rollup/plugin-commonjs" : "^24.0.1" ,
"@rollup/plugin-node-resolve" : "^15.0.1" ,
"@rollup/plugin-replace" : "^5.0.2" ,
2025-02-16 09:38:13 -06:00
"@rollup/plugin-typescript" : "^12.1.2" ,
2025-03-12 20:43:06 -05:00
"@types/invariant" : "^2.2.35" ,
2025-02-16 19:28:12 -06:00
"@typescript-eslint/eslint-plugin" : "^6.21.0" ,
"@typescript-eslint/parser" : "^6.21.0" ,
2023-02-10 00:07:49 +08:00
"abortcontroller-polyfill" : "^1.7.5" ,
2020-01-24 10:28:50 -08:00
"art" : "0.10.1" ,
2025-08-21 11:15:34 -04:00
"babel-plugin-syntax-hermes-parser" : "^0.32.0" ,
2016-02-26 16:49:32 -08:00
"babel-plugin-syntax-trailing-function-commas" : "^6.5.0" ,
2020-01-24 10:28:50 -08:00
"chalk" : "^3.0.0" ,
2017-04-05 16:47:29 +01:00
"cli-table" : "^0.3.1" ,
2020-01-24 10:28:50 -08:00
"coffee-script" : "^1.12.7" ,
2020-02-19 17:14:53 +00:00
"confusing-browser-globals" : "^1.0.9" ,
2020-01-24 10:28:50 -08:00
"core-js" : "^3.6.4" ,
2018-01-31 09:41:09 -08:00
"create-react-class" : "^15.6.3" ,
2023-01-27 14:05:08 -05:00
"danger" : "^11.2.3" ,
2020-01-24 10:28:50 -08:00
"error-stack-parser" : "^2.0.6" ,
2020-08-29 22:03:23 +02:00
"eslint" : "^7.7.0" ,
2020-01-14 09:26:44 -08:00
"eslint-config-prettier" : "^6.9.0" ,
2019-08-15 09:53:22 -07:00
"eslint-plugin-babel" : "^5.3.0" ,
2024-09-19 13:42:49 -04:00
"eslint-plugin-es" : "^4.1.0" ,
2021-09-06 21:17:51 +02:00
"eslint-plugin-eslint-plugin" : "^3.5.3" ,
2022-12-20 14:27:01 -05:00
"eslint-plugin-ft-flow" : "^2.0.3" ,
2024-06-10 14:31:37 -04:00
"eslint-plugin-jest" : "28.4.0" ,
2018-02-09 16:11:22 +00:00
"eslint-plugin-no-for-of-loops" : "^1.0.0" ,
2020-09-01 18:25:10 +05:30
"eslint-plugin-no-function-declare-after-return" : "^1.0.0" ,
2016-11-17 22:16:44 +00:00
"eslint-plugin-react" : "^6.7.1" ,
2025-09-29 15:31:06 +02:00
"eslint-plugin-react-hooks-published" : "npm:eslint-plugin-react-hooks@^5.2.0" ,
2019-08-08 17:46:35 -07:00
"eslint-plugin-react-internal" : "link:./scripts/eslint-rules" ,
2023-02-10 00:07:49 +08:00
"fbjs-scripts" : "^3.0.1" ,
2020-01-24 10:28:50 -08:00
"filesize" : "^6.0.1" ,
2025-08-25 11:02:56 -04:00
"flow-bin" : "^0.279.0" ,
"flow-remove-types" : "^2.279.0" ,
2025-08-22 12:10:13 -04:00
"flow-typed" : "^4.1.1" ,
2020-01-24 10:28:50 -08:00
"glob" : "^7.1.6" ,
2017-03-02 11:18:46 -08:00
"glob-stream" : "^6.1.0" ,
2023-02-20 13:27:13 -05:00
"google-closure-compiler" : "^20230206.0.0" ,
2020-01-24 10:28:50 -08:00
"gzip-size" : "^5.1.1" ,
2025-08-25 11:02:56 -04:00
"hermes-eslint" : "^0.32.0" ,
"hermes-parser" : "^0.32.0" ,
2023-02-10 14:06:14 -05:00
"jest" : "^29.4.2" ,
"jest-cli" : "^29.4.2" ,
"jest-diff" : "^29.4.2" ,
"jest-environment-jsdom" : "^29.4.2" ,
"jest-snapshot-serializer-raw" : "^1.2.0" ,
2017-12-11 23:52:46 +08:00
"minimatch" : "^3.0.4" ,
2020-04-06 19:28:56 +01:00
"minimist" : "^1.2.3" ,
2017-12-06 20:11:32 +00:00
"mkdirp" : "^0.5.1" ,
2017-04-05 16:47:29 +01:00
"ncp" : "^2.0.0" ,
2024-07-22 16:09:01 -04:00
"prettier" : "^3.3.3" ,
2024-02-12 22:03:50 -05:00
"prettier-2" : "npm:prettier@^2" ,
2023-02-10 00:07:49 +08:00
"pretty-format" : "^29.4.1" ,
2018-06-19 17:52:37 +01:00
"prop-types" : "^15.6.2" ,
2018-01-24 19:36:22 -08:00
"random-seed" : "^0.3.0" ,
2020-01-24 10:28:50 -08:00
"react-lifecycles-compat" : "^3.0.4" ,
"rimraf" : "^3.0.0" ,
2024-09-26 09:56:33 -04:00
"rollup" : "^3.29.5" ,
2025-02-16 09:38:13 -06:00
"rollup-plugin-dts" : "^6.1.1" ,
2023-10-31 23:32:31 -04:00
"rollup-plugin-prettier" : "^4.1.1" ,
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-24 14:08:41 -04:00
"rollup-plugin-strip-banner" : "^3.0.0" ,
2020-01-24 10:28:50 -08:00
"semver" : "^7.1.1" ,
2023-12-04 11:35:27 -05:00
"shelljs" : "^0.8.5" ,
2023-04-14 11:42:48 +02:00
"signedsource" : "^2.0.0" ,
2017-12-06 00:53:53 +11:00
"targz" : "^1.0.1" ,
2020-01-24 10:28:50 -08:00
"through2" : "^3.0.1" ,
"tmp" : "^0.1.0" ,
2025-03-12 20:43:06 -05:00
"to-fast-properties" : "^2.0.0" ,
"tsup" : "^8.4.0" ,
2025-02-16 09:38:13 -06:00
"typescript" : "^5.4.3" ,
2024-05-03 22:29:09 +02:00
"undici" : "^5.28.4" ,
2021-11-10 04:22:19 +08:00
"web-streams-polyfill" : "^3.1.1" ,
2020-06-25 20:39:50 -04:00
"yargs" : "^15.3.1"
2013-05-29 12:46:11 -07:00
} ,
2018-05-01 12:46:17 -07:00
"jest" : {
"testRegex" : "/scripts/jest/dont-run-jest-directly\\.js$"
} ,
2014-02-20 13:10:05 -08:00
"scripts" : {
2025-03-13 22:21:35 -04:00
"prebuild" : "./scripts/react-compiler/link-compiler.sh" ,
2023-02-17 16:00:18 -05:00
"build" : "node ./scripts/rollup/build-all-release-channels.js" ,
2025-12-02 22:05:10 +01:00
"build-for-devtools" : "cross-env yarn build react/index,react/jsx,react/compiler-runtime,react-dom/index,react-dom/client,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE --release-channel=experimental" ,
2020-12-07 10:10:43 -05:00
"build-for-devtools-dev" : "yarn build-for-devtools --type=NODE_DEV" ,
"build-for-devtools-prod" : "yarn build-for-devtools --type=NODE_PROD" ,
2025-12-05 03:59:21 +01:00
"build-for-flight-dev" : "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react.react-server,react-dom/index,react-dom/client,react-dom/server,react-dom.react-server,react-dom-server.node,react-dom-server-legacy.node,scheduler,react-server-dom-webpack/,react-server-dom-unbundled/ --type=NODE_DEV,ESM_PROD,NODE_ES2015 && mv ./build/node_modules ./build/oss-experimental" ,
2025-03-01 18:26:48 -05:00
"build-for-vt-dev" : "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react-dom/index,react-dom/client,react-dom/server,react-dom-server.node,react-dom-server-legacy.node,scheduler --type=NODE_DEV && mv ./build/node_modules ./build/oss-experimental" ,
2025-08-22 12:10:13 -04:00
"flow-typed-install" : "yarn flow-typed install --skip --skipFlowRestart --ignore-deps=dev" ,
2017-11-04 11:09:28 -07:00
"linc" : "node ./scripts/tasks/linc.js" ,
2017-04-05 16:47:29 +01:00
"lint" : "node ./scripts/tasks/eslint.js" ,
2017-11-26 11:47:20 -05:00
"lint-build" : "node ./scripts/rollup/validate/index.js" ,
2021-10-31 18:37:32 -04:00
"extract-errors" : "node scripts/error-codes/extract-errors.js" ,
2025-02-16 15:14:43 -06:00
"postinstall" : "node ./scripts/flow/createFlowConfigs.js" ,
2020-06-25 20:39:50 -04:00
"test" : "node ./scripts/jest/jest-cli.js" ,
2020-10-14 08:54:34 -04:00
"test-stable" : "node ./scripts/jest/jest-cli.js --release-channel=stable" ,
"test-www" : "node ./scripts/jest/jest-cli.js --release-channel=www-modern" ,
"test-classic" : "node ./scripts/jest/jest-cli.js --release-channel=www-classic" ,
2022-03-23 14:51:59 +01:00
"test-build-devtools" : "node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental" ,
2024-04-17 11:15:27 -07:00
"test-dom-fixture" : "cd fixtures/dom && yarn && yarn test" ,
2017-04-05 16:47:29 +01:00
"flow" : "node ./scripts/tasks/flow.js" ,
2018-05-17 14:29:37 +01:00
"flow-ci" : "node ./scripts/tasks/flow-ci.js" ,
2017-05-11 14:47:29 -07:00
"prettier" : "node ./scripts/prettier/index.js write-changed" ,
"prettier-all" : "node ./scripts/prettier/index.js write" ,
2024-06-21 11:41:25 -04:00
"prettier-check" : "node ./scripts/prettier/index.js" ,
2020-04-09 11:37:13 -07:00
"version-check" : "node ./scripts/tasks/version-check.js" ,
2024-07-29 18:51:22 -04:00
"publish-prereleases" : "echo 'This command has been deprecated. Please refer to https://github.com/facebook/react/tree/main/scripts/release#trigger-an-automated-prerelease'" ,
2021-09-22 14:35:56 -04:00
"download-build" : "node ./scripts/release/download-experimental-build.js" ,
"download-build-for-head" : "node ./scripts/release/download-experimental-build.js --commit=$(git rev-parse HEAD)" ,
2025-04-22 22:20:21 +02:00
"download-build-in-codesandbox-ci" : "yarn build --type=node react/index react.react-server react-dom/index react-dom/client react-dom/src/server react-dom/test-utils react-dom.react-server scheduler/index react/jsx-runtime react/jsx-dev-runtime react-server-dom-webpack" ,
2022-10-14 21:00:14 -04:00
"check-release-dependencies" : "node ./scripts/release/check-release-dependencies" ,
2024-01-30 23:15:50 -05:00
"generate-inline-fizz-runtime" : "node ./scripts/rollup/generate-inline-fizz-runtime.js" ,
2025-10-27 18:04:48 -04:00
"generate-changelog" : "node ./scripts/tasks/generate-changelog/index.js" ,
2024-01-30 23:15:50 -05:00
"flags" : "node ./scripts/flags/flags.js"
2021-11-19 15:18:02 +00:00
} ,
"resolutions" : {
2024-05-08 11:57:25 -06:00
"react-is" : "npm:react-is" ,
"jsdom" : "22.1.0"
2024-05-18 07:21:41 -07:00
} ,
"packageManager" : "yarn@1.22.22"
2013-05-29 12:46:11 -07:00
}