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-01-24 18:49:24 +01:00
|
|
|
"@babel/cli": "^7.8.0",
|
|
|
|
|
"@babel/code-frame": "^7.8.0",
|
|
|
|
|
"@babel/core": "^7.8.0",
|
|
|
|
|
"@babel/helper-module-imports": "^7.8.0",
|
|
|
|
|
"@babel/parser": "^7.8.0",
|
|
|
|
|
"@babel/plugin-external-helpers": "^7.8.0",
|
|
|
|
|
"@babel/plugin-proposal-class-properties": "^7.8.0",
|
|
|
|
|
"@babel/plugin-proposal-object-rest-spread": "^7.8.0",
|
|
|
|
|
"@babel/plugin-syntax-dynamic-import": "^7.8.0",
|
|
|
|
|
"@babel/plugin-syntax-jsx": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-arrow-functions": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-async-to-generator": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-block-scoped-functions": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-block-scoping": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-classes": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-computed-properties": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-destructuring": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-for-of": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-literals": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-modules-commonjs": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-object-super": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-parameters": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-react-jsx-source": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-shorthand-properties": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-spread": "^7.8.0",
|
|
|
|
|
"@babel/plugin-transform-template-literals": "^7.8.0",
|
|
|
|
|
"@babel/preset-flow": "^7.8.0",
|
|
|
|
|
"@babel/preset-react": "^7.8.0",
|
|
|
|
|
"@babel/traverse": "^7.8.0",
|
2020-01-24 10:28:50 -08:00
|
|
|
"@mattiasbuelens/web-streams-polyfill": "^0.3.2",
|
|
|
|
|
"art": "0.10.1",
|
2020-01-14 09:26:44 -08:00
|
|
|
"babel-eslint": "^10.0.3",
|
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",
|
|
|
|
|
"coveralls": "^3.0.9",
|
2018-01-31 09:41:09 -08:00
|
|
|
"create-react-class": "^15.6.3",
|
2020-01-24 10:28:50 -08:00
|
|
|
"cross-env": "^6.0.3",
|
|
|
|
|
"danger": "^9.2.10",
|
|
|
|
|
"error-stack-parser": "^2.0.6",
|
2020-01-14 09:26:44 -08:00
|
|
|
"eslint": "^6.8.0",
|
2016-11-17 22:16:44 +00:00
|
|
|
"eslint-config-fbjs": "^1.1.1",
|
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",
|
2016-11-17 22:16:44 +00:00
|
|
|
"eslint-plugin-flowtype": "^2.25.0",
|
2019-08-14 12:51:01 +02:00
|
|
|
"eslint-plugin-jest": "^22.15.0",
|
2018-02-09 16:11:22 +00:00
|
|
|
"eslint-plugin-no-for-of-loops": "^1.0.0",
|
2016-11-17 22:16:44 +00:00
|
|
|
"eslint-plugin-react": "^6.7.1",
|
2019-08-08 17:46:35 -07:00
|
|
|
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
|
2020-01-24 10:28:50 -08:00
|
|
|
"fbjs-scripts": "0.8.3",
|
|
|
|
|
"filesize": "^6.0.1",
|
2020-01-24 10:52:38 -08:00
|
|
|
"flow-bin": "0.97",
|
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",
|
2020-04-01 12:08:37 -07:00
|
|
|
"google-closure-compiler": "^20200224.0.0",
|
2020-01-24 10: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-13 17:21:25 -07:00
|
|
|
"jasmine-check": "^1.0.0-rc.0",
|
2020-04-03 16:37:36 +01:00
|
|
|
"jest": "^25.2.7",
|
|
|
|
|
"jest-diff": "^25.2.6",
|
2019-06-03 21:46:34 +02:00
|
|
|
"jest-snapshot-serializer-raw": "^1.1.0",
|
2017-12-11 23:52:46 +08:00
|
|
|
"minimatch": "^3.0.4",
|
2017-04-05 16:47:29 +01:00
|
|
|
"minimist": "^1.2.0",
|
2017-12-06 20:11:32 +00:00
|
|
|
"mkdirp": "^0.5.1",
|
2017-04-05 16:47:29 +01:00
|
|
|
"ncp": "^2.0.0",
|
2017-01-20 02:29:06 +01:00
|
|
|
"object-assign": "^4.1.1",
|
2020-01-24 10:28:50 -08:00
|
|
|
"pacote": "^10.3.0",
|
2020-01-09 13:54:11 +00:00
|
|
|
"prettier": "1.19.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",
|
2020-02-20 23:09:30 +01:00
|
|
|
"rollup": "^1.19.4",
|
2019-08-08 17:46:35 -07:00
|
|
|
"rollup-plugin-babel": "^4.0.1",
|
2020-02-20 23:09:30 +01:00
|
|
|
"rollup-plugin-commonjs": "^9.3.4",
|
2017-12-11 16:54:12 +00:00
|
|
|
"rollup-plugin-node-resolve": "^2.1.1",
|
2020-02-20 23:09:30 +01:00
|
|
|
"rollup-plugin-prettier": "^0.6.0",
|
|
|
|
|
"rollup-plugin-replace": "^2.2.0",
|
2017-11-08 22:37:11 +00:00
|
|
|
"rollup-plugin-strip-banner": "^0.2.0",
|
2020-01-24 10:28:50 -08:00
|
|
|
"semver": "^7.1.1",
|
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",
|
|
|
|
|
"typescript": "^3.7.5",
|
2019-11-15 14:02:59 -08:00
|
|
|
"webpack": "^4.41.2"
|
2013-05-29 12:46:11 -07:00
|
|
|
},
|
2015-08-18 18:05:13 -07:00
|
|
|
"devEngines": {
|
2020-01-14 23:20:42 +00:00
|
|
|
"node": "8.x || 9.x || 10.x || 11.x || 12.x || 13.x"
|
2013-06-27 13:09:29 -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": {
|
2018-11-23 12:37:18 -08:00
|
|
|
"build": "node ./scripts/rollup/build.js",
|
2020-03-10 17:37:02 +02:00
|
|
|
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer --type=NODE",
|
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",
|
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-29 11:29:04 -07:00
|
|
|
"extract-errors": "yarn build --type=dev --extract-errors",
|
2019-10-03 19:14:18 +02: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-01-17 21:20:09 +03:00
|
|
|
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source.js --runInBand",
|
2017-11-23 17:44:58 +00:00
|
|
|
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
|
Add test run that uses www feature flags (#18234)
In CI, we run our test suite against multiple build configurations. For
example, we run our tests in both dev and prod, and in both the
experimental and stable release channels. This is to prevent accidental
deviations in behavior between the different builds. If there's an
intentional deviation in behavior, the test author must account
for them.
However, we currently don't run tests against the www builds. That's
a problem, because it's common for features to land in www before they
land anywhere else, including the experimental release channel.
Typically we do this so we can gradually roll out the feature behind
a flag before deciding to enable it.
The way we test those features today is by mutating the
`shared/ReactFeatureFlags` module. There are a few downsides to this
approach, though. The flag is only overridden for the specific tests or
test suites where you apply the override. But usually what you want is
to run *all* tests with the flag enabled, to protect against unexpected
regressions.
Also, mutating the feature flags module only works when running the
tests against source, not against the final build artifacts, because the
ReactFeatureFlags module is inlined by the build script.
Instead, we should run the test suite against the www configuration,
just like we do for prod, experimental, and so on. I've added a new
command, `yarn test-www`. It automatically runs in CI.
Some of the www feature flags are dynamic; that is, they depend on
a runtime condition (i.e. a GK). These flags are imported from an
external module that lives in www. Those flags will be enabled for some
clients and disabled for others, so we should run the tests against
*both* modes.
So I've added a new global `__VARIANT__`, and a new test command `yarn
test-www-variant`. `__VARIANT__` is set to false by default; when
running `test-www-variant`, it's set to true.
If we were going for *really* comprehensive coverage, we would run the
tests against every possible configuration of feature flags: 2 ^
numberOfFlags total combinations. That's not practical, though, so
instead we only run against two combinations: once with `__VARIANT__`
set to `true`, and once with it set to `false`. We generally assume that
flags can be toggled independently, so in practice this should
be enough.
You can also refer to `__VARIANT__` in tests to detect which mode you're
running in. Or, you can import `shared/ReactFeatureFlags` and read the
specific flag you can about. However, we should stop mutating that
module going forward. Treat it as read-only.
In this commit, I have only setup the www tests to run against source.
I'll leave running against build for a follow up.
Many of our tests currently assume they run only in the default
configuration, and break when certain flags are toggled. Rather than fix
these all up front, I've hard-coded the relevant flags to the default
values. We can incrementally migrate those tests later.
2020-03-06 09:29:05 -08:00
|
|
|
"test-www": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-www.js",
|
|
|
|
|
"test-www-variant": "cross-env NODE_ENV=development VARIANT=true jest --config ./scripts/jest/config.source-www.js",
|
2019-03-11 10:56:34 -07:00
|
|
|
"test-persistent": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-persistent.js",
|
2020-01-17 21:20:09 +03:00
|
|
|
"debug-test-persistent": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source-persistent.js --runInBand",
|
2017-11-23 17:44:58 +00:00
|
|
|
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
|
2020-03-24 16:14:55 +00:00
|
|
|
"debug-test-prod": "cross-env NODE_ENV=production node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source.js --runInBand",
|
2017-11-23 17:44:58 +00:00
|
|
|
"test-prod-build": "yarn test-build-prod",
|
|
|
|
|
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
|
|
|
|
|
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
|
2019-08-26 13:43:09 -07:00
|
|
|
"test-build-devtools": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build-devtools.js",
|
2020-01-17 21:20:09 +03:00
|
|
|
"debug-test-build-devtools": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.build-devtools.js",
|
2019-05-29 22:56:04 +01:00
|
|
|
"test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && 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",
|
2017-04-05 16:47:29 +01:00
|
|
|
"version-check": "node ./scripts/tasks/version-check.js"
|
2013-11-13 18:02:23 -05:00
|
|
|
}
|
2013-05-29 12:46:11 -07:00
|
|
|
}
|