2013-05-30 03:46:11 +08:00
|
|
|
{
|
2015-06-03 05:13:11 +08:00
|
|
|
"private": true,
|
2017-10-19 07:22:21 +08:00
|
|
|
"workspaces": [
|
|
|
|
"packages/*"
|
|
|
|
],
|
2013-05-30 03:46:11 +08: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",
|
2020-08-30 04:03:23 +08:00
|
|
|
"@babel/eslint-parser": "^7.11.4",
|
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-13 00:11:05 +08:00
|
|
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
2020-08-20 23:47:16 +08:00
|
|
|
"@babel/plugin-syntax-jsx": "^7.10.4",
|
|
|
|
"@babel/plugin-transform-arrow-functions": "^7.10.4",
|
|
|
|
"@babel/plugin-transform-async-to-generator": "^7.10.4",
|
|
|
|
"@babel/plugin-transform-block-scoped-functions": "^7.10.4",
|
|
|
|
"@babel/plugin-transform-block-scoping": "^7.11.1",
|
|
|
|
"@babel/plugin-transform-classes": "^7.10.4",
|
|
|
|
"@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",
|
|
|
|
"@babel/plugin-transform-react-jsx-source": "^7.10.5",
|
|
|
|
"@babel/plugin-transform-shorthand-properties": "^7.10.4",
|
|
|
|
"@babel/plugin-transform-spread": "^7.11.0",
|
|
|
|
"@babel/plugin-transform-template-literals": "^7.10.5",
|
|
|
|
"@babel/preset-flow": "^7.10.4",
|
|
|
|
"@babel/preset-react": "^7.10.4",
|
|
|
|
"@babel/traverse": "^7.11.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"@mattiasbuelens/web-streams-polyfill": "^0.3.2",
|
|
|
|
"art": "0.10.1",
|
2020-01-15 01:26:44 +08:00
|
|
|
"babel-eslint": "^10.0.3",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"chalk": "^3.0.0",
|
2017-04-05 23:47:29 +08:00
|
|
|
"cli-table": "^0.3.1",
|
2020-01-25 02:28:50 +08:00
|
|
|
"coffee-script": "^1.12.7",
|
2020-02-20 01:14:53 +08:00
|
|
|
"confusing-browser-globals": "^1.0.9",
|
2020-01-25 02:28:50 +08:00
|
|
|
"core-js": "^3.6.4",
|
|
|
|
"coveralls": "^3.0.9",
|
2018-02-01 01:41:09 +08:00
|
|
|
"create-react-class": "^15.6.3",
|
2020-01-25 02:28:50 +08:00
|
|
|
"danger": "^9.2.10",
|
|
|
|
"error-stack-parser": "^2.0.6",
|
2020-08-30 04:03:23 +08:00
|
|
|
"eslint": "^7.7.0",
|
2020-10-16 23:06:08 +08:00
|
|
|
"eslint-config-fbjs": "^3.1.1",
|
2020-01-15 01:26:44 +08:00
|
|
|
"eslint-config-prettier": "^6.9.0",
|
2019-08-16 00:53:22 +08:00
|
|
|
"eslint-plugin-babel": "^5.3.0",
|
2016-11-18 06:16:44 +08:00
|
|
|
"eslint-plugin-flowtype": "^2.25.0",
|
2019-08-14 18:51:01 +08:00
|
|
|
"eslint-plugin-jest": "^22.15.0",
|
2020-10-16 23:06:08 +08:00
|
|
|
"eslint-plugin-jsx-a11y": "^6.3.1",
|
2018-02-10 00:11:22 +08:00
|
|
|
"eslint-plugin-no-for-of-loops": "^1.0.0",
|
2020-09-01 20:55:10 +08:00
|
|
|
"eslint-plugin-no-function-declare-after-return": "^1.0.0",
|
2016-11-18 06:16:44 +08:00
|
|
|
"eslint-plugin-react": "^6.7.1",
|
2019-08-09 08:46:35 +08:00
|
|
|
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
|
2020-04-21 09:20:03 +08:00
|
|
|
"fbjs-scripts": "1.2.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"filesize": "^6.0.1",
|
2020-01-25 02:52:38 +08:00
|
|
|
"flow-bin": "0.97",
|
2020-01-25 02:28:50 +08:00
|
|
|
"glob": "^7.1.6",
|
2017-03-03 03:18:46 +08:00
|
|
|
"glob-stream": "^6.1.0",
|
2020-05-30 00:17:14 +08:00
|
|
|
"google-closure-compiler": "^20200517.0.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"gzip-size": "^5.1.1",
|
Deterministic updates (#10715)
* Deterministic updates
High priority updates typically require less work to render than
low priority ones. It's beneficial to flush those first, in their own
batch, before working on more expensive low priority ones. We do this
even if a high priority is scheduled after a low priority one.
However, we don't want this reordering of updates to affect the terminal
state. State should be deterministic: once all work has been flushed,
the final state should be the same regardless of how they were
scheduled.
To get both properties, we store updates on the queue in insertion
order instead of priority order (always append). Then, when processing
the queue, we skip over updates with insufficient priority. Instead of
removing updates from the queue right after processing them, we only
remove them if there are no unprocessed updates before it in the list.
This means that updates may be processed more than once.
As a bonus, the new implementation is simpler and requires less code.
* Fix ceiling function
Mixed up the operators.
* Remove addUpdate, addReplaceState, et al
These functions don't really do anything. Simpler to use a single
insertUpdateIntoFiber function.
Also splits scheduleUpdate into two functions:
- scheduleWork traverses a fiber's ancestor path and updates their
expiration times.
- scheduleUpdate inserts an update into a fiber's update queue, then
calls scheduleWork.
* Remove getExpirationTime
The last remaining use for getExpirationTime was for top-level async
updates. I moved that check to scheduleUpdate instead.
* Move UpdateQueue insertions back to class module
Moves UpdateQueue related functions out of the scheduler and back into
the class component module. It's a bit awkward that now we need to pass
around createUpdateExpirationForFiber, too. But we can still do without
addUpdate, replaceUpdate, et al.
* Store callbacks as an array of Updates
Simpler this way.
Also moves commitCallbacks back to UpdateQueue module.
* beginUpdateQueue -> processUpdateQueue
* Updates should never have an expiration of NoWork
* Rename expiration related functions
* Fix update queue Flow types
Gets rid of an unneccessary null check
2017-10-14 08:21:25 +08:00
|
|
|
"jasmine-check": "^1.0.0-rc.0",
|
2020-04-03 23:37:36 +08:00
|
|
|
"jest": "^25.2.7",
|
2020-06-26 08:39:50 +08:00
|
|
|
"jest-cli": "^25.2.7",
|
2020-04-03 23:37:36 +08:00
|
|
|
"jest-diff": "^25.2.6",
|
2020-07-16 22:17:31 +08:00
|
|
|
"jest-environment-jsdom-sixteen": "^1.0.3",
|
2019-06-04 03:46:34 +08:00
|
|
|
"jest-snapshot-serializer-raw": "^1.1.0",
|
2017-12-11 23:52:46 +08:00
|
|
|
"minimatch": "^3.0.4",
|
2020-04-07 02:28:56 +08:00
|
|
|
"minimist": "^1.2.3",
|
2017-12-07 04:11:32 +08:00
|
|
|
"mkdirp": "^0.5.1",
|
2017-04-05 23:47:29 +08:00
|
|
|
"ncp": "^2.0.0",
|
2017-01-20 09:29:06 +08:00
|
|
|
"object-assign": "^4.1.1",
|
2020-01-25 02:28:50 +08:00
|
|
|
"pacote": "^10.3.0",
|
2020-01-09 21:54:11 +08:00
|
|
|
"prettier": "1.19.1",
|
2018-06-20 00:52:37 +08:00
|
|
|
"prop-types": "^15.6.2",
|
2018-01-25 11:36:22 +08:00
|
|
|
"random-seed": "^0.3.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"react-lifecycles-compat": "^3.0.4",
|
|
|
|
"rimraf": "^3.0.0",
|
2020-02-21 06:09:30 +08:00
|
|
|
"rollup": "^1.19.4",
|
2019-08-09 08:46:35 +08:00
|
|
|
"rollup-plugin-babel": "^4.0.1",
|
2020-02-21 06:09:30 +08:00
|
|
|
"rollup-plugin-commonjs": "^9.3.4",
|
2017-12-12 00:54:12 +08:00
|
|
|
"rollup-plugin-node-resolve": "^2.1.1",
|
2020-02-21 06:09:30 +08:00
|
|
|
"rollup-plugin-prettier": "^0.6.0",
|
|
|
|
"rollup-plugin-replace": "^2.2.0",
|
2017-11-09 06:37:11 +08:00
|
|
|
"rollup-plugin-strip-banner": "^0.2.0",
|
2020-01-25 02:28:50 +08:00
|
|
|
"semver": "^7.1.1",
|
2017-12-05 21:53:53 +08:00
|
|
|
"targz": "^1.0.1",
|
2020-01-25 02:28:50 +08:00
|
|
|
"through2": "^3.0.1",
|
|
|
|
"tmp": "^0.1.0",
|
|
|
|
"typescript": "^3.7.5",
|
2020-06-26 08:39:50 +08:00
|
|
|
"webpack": "^4.41.2",
|
|
|
|
"yargs": "^15.3.1"
|
2013-05-30 03:46:11 +08:00
|
|
|
},
|
2015-08-19 09:05:13 +08:00
|
|
|
"devEngines": {
|
2020-10-27 23:16:16 +08:00
|
|
|
"node": "8.x || 9.x || 10.x || 11.x || 12.x || 13.x || 14.x || 15.x"
|
2013-06-28 04:09:29 +08:00
|
|
|
},
|
2018-05-02 03:46:17 +08:00
|
|
|
"jest": {
|
|
|
|
"testRegex": "/scripts/jest/dont-run-jest-directly\\.js$"
|
|
|
|
},
|
2014-02-21 05:10:05 +08:00
|
|
|
"scripts": {
|
2018-11-24 04:37:18 +08:00
|
|
|
"build": "node ./scripts/rollup/build.js",
|
2021-01-13 01:32:32 +08:00
|
|
|
"build-combined": "node ./scripts/rollup/build-all-release-channels.js",
|
Update DevTools to use getCacheForType API (#20548)
DevTools was built with a fork of an early idea for how Suspense cache might work. This idea is incompatible with newer APIs like `useTransition` which unfortunately prevented me from making certain UX improvements. This PR swaps out the primary usage of this cache (there are a few) in favor of the newer `unstable_getCacheForType` and `unstable_useCacheRefresh` APIs. We can go back and update the others in follow up PRs.
### Messaging changes
I've refactored the way the frontend loads component props/state/etc to hopefully make it better match the Suspense+cache model. Doing this gave up some of the small optimizations I'd added but hopefully the actual performance impact of that is minor and the overall ergonomic improvements of working with the cache API make this worth it.
The backend no longer remembers inspected paths. Instead, the frontend sends them every time and the backend sends a response with those paths. I've also added a new "force" parameter that the frontend can use to tell the backend to send a response even if the component hasn't rendered since the last time it asked. (This is used to get data for newly inspected paths.)
_Initial inspection..._
```
front | | back
| -- "inspect" (id:1, paths:[], force:true) ---------> |
| <------------------------ "inspected" (full-data) -- |
```
_1 second passes with no updates..._
```
| -- "inspect" (id:1, paths:[], force:false) --------> |
| <------------------------ "inspected" (no-change) -- |
```
_User clicks to expand a path, aka hydrate..._
```
| -- "inspect" (id:1, paths:['foo'], force:true) ----> |
| <------------------------ "inspected" (full-data) -- |
```
_1 second passes during which there is an update..._
```
| -- "inspect" (id:1, paths:['foo'], force:false) ---> |
| <----------------- "inspectedElement" (full-data) -- |
```
### Clear errors/warnings transition
Previously this meant there would be a delay after clicking the "clear" button. The UX after this change is much improved.
### Hydrating paths transition
I also added a transition to hydration (expanding "dehyrated" paths).
### Better error boundaries
I also added a lower-level error boundary in case the new suspense operation ever failed. It provides a better "retry" mechanism (select a new element) so DevTools doesn't become entirely useful. Here I'm intentionally causing an error every time I select an element.
### Improved snapshot tests
I also migrated several of the existing snapshot tests to use inline snapshots and added a new serializer for dehydrated props. Inline snapshots are easier to verify and maintain and the new serializer means dehydrated props will be formatted in a way that makes sense rather than being empty (in external snapshots) or super verbose (default inline snapshot format).
2021-01-19 22:51:32 +08:00
|
|
|
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build-combined react/index,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh",
|
2020-12-07 23:10:43 +08:00
|
|
|
"build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
|
|
|
|
"build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
|
2017-11-05 02:09:28 +08:00
|
|
|
"linc": "node ./scripts/tasks/linc.js",
|
2017-04-05 23:47:29 +08:00
|
|
|
"lint": "node ./scripts/tasks/eslint.js",
|
2017-11-27 00:47:20 +08:00
|
|
|
"lint-build": "node ./scripts/rollup/validate/index.js",
|
Lint rule for unminified errors (#15757)
* Lint rule for unminified errors
Add a lint rule that fails if an invariant message is not part of the
error code map.
The goal is to be more disciplined about adding and modifiying
production error codes. Error codes should be consistent across releases
even if their wording changes, for continuity in logs.
Currently, error codes are added to the error code map via an automated
script that runs right before release. The problem with this approach is
that if someone modifies an error message in the source, but neglects to
modify the corresponding message in the error code map, then the message
will be assigned a new error code, instead of reusing the existing one.
Because the error extraction script only runs before a release, people
rarely modify the error code map in practice. By moving the extraction
step to the PR stage, it forces the author to consider whether the
message should be assigned a new error code. It also allows the reviewer
to review the changes.
The trade off is that it requires more effort and context to land new
error messages, or to modify existing ones, particular for new
contributors who are not familiar with our processes.
Since we already expect users to lint their code, I would argue the
additional burden is marginal. Even if they forget to run the lint
command locally, they will get quick feedback from the CI lint job,
which typically finishes within 2-3 minutes.
* Add unreleased error messages to map
2019-05-30 02:29:04 +08:00
|
|
|
"extract-errors": "yarn build --type=dev --extract-errors",
|
2019-10-04 01:14:18 +08:00
|
|
|
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js && node ./scripts/yarn/downloadReactIsForPrettyFormat.js",
|
2020-10-14 20:54:34 +08:00
|
|
|
"debug-test": "yarn test --deprecated 'yarn test --debug'",
|
2020-06-26 08:39:50 +08:00
|
|
|
"test": "node ./scripts/jest/jest-cli.js",
|
2020-10-14 20:54:34 +08: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",
|
|
|
|
"test-www-variant": "yarn test --deprecated 'yarn test-www --variant'",
|
|
|
|
"test-prod-www": "yarn test --deprecated 'yarn test-www --prod'",
|
|
|
|
"test-prod-www-variant": "yarn test --deprecated 'yarn test-www --prod --variant'",
|
|
|
|
"test-persistent": "yarn test --deprecated 'yarn test --persistent'",
|
|
|
|
"debug-test-persistent": "yarn test --deprecated 'yarn test --debug --persistent'",
|
|
|
|
"test-prod": "yarn test --deprecated 'yarn test --prod'",
|
|
|
|
"debug-test-prod": "yarn test --deprecated 'yarn test --debug --prod'",
|
|
|
|
"test-prod-build": "yarn test --deprecated 'yarn test --prod --build'",
|
|
|
|
"test-build": "yarn test --deprecated 'yarn test --build'",
|
|
|
|
"test-build-prod": "yarn test --deprecated 'yarn test --build --prod'",
|
2020-06-26 08:39:50 +08:00
|
|
|
"test-build-devtools": "yarn test --build --project devtools",
|
2020-10-14 20:54:34 +08:00
|
|
|
"debug-test-build-devtools": "yarn test --deprecated 'yarn test-build-devtools --debug'",
|
2019-05-30 05:56:04 +08:00
|
|
|
"test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && yarn test",
|
2017-04-05 23:47:29 +08:00
|
|
|
"flow": "node ./scripts/tasks/flow.js",
|
2018-05-17 21:29:37 +08:00
|
|
|
"flow-ci": "node ./scripts/tasks/flow-ci.js",
|
2017-05-12 05:47:29 +08:00
|
|
|
"prettier": "node ./scripts/prettier/index.js write-changed",
|
|
|
|
"prettier-all": "node ./scripts/prettier/index.js write",
|
2020-04-10 02:37:13 +08:00
|
|
|
"version-check": "node ./scripts/tasks/version-check.js",
|
2020-06-12 11:05:15 +08:00
|
|
|
"merge-fork": "node ./scripts/merge-fork/merge-fork.js",
|
|
|
|
"replace-fork": "node ./scripts/merge-fork/replace-fork.js"
|
2013-11-14 07:02:23 +08:00
|
|
|
}
|
2013-05-30 03:46:11 +08:00
|
|
|
}
|