2013-05-30 03:46:11 +08:00
|
|
|
{
|
2015-06-03 05:13:11 +08:00
|
|
|
"private": true,
|
2018-06-14 00:16:10 +08:00
|
|
|
"version": "16.4.1",
|
2017-10-19 07:22:21 +08:00
|
|
|
"workspaces": [
|
|
|
|
"packages/*"
|
|
|
|
],
|
2013-05-30 03:46:11 +08:00
|
|
|
"devDependencies": {
|
2016-05-15 06:30:08 +08:00
|
|
|
"art": "^0.10.1",
|
2015-12-22 04:05:03 +08:00
|
|
|
"async": "^1.5.0",
|
2016-03-08 02:37:06 +08:00
|
|
|
"babel-cli": "^6.6.5",
|
2017-11-19 22:23:33 +08:00
|
|
|
"babel-code-frame": "^6.26.0",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-core": "^6.0.0",
|
2018-01-10 02:55:51 +08:00
|
|
|
"babel-eslint": "^8.0.0",
|
2018-05-29 06:03:15 +08:00
|
|
|
"babel-jest": "^23.0.1",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-plugin-check-es2015-constants": "^6.5.0",
|
2017-04-05 23:47:29 +08:00
|
|
|
"babel-plugin-external-helpers": "^6.22.0",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",
|
2017-03-04 02:34:14 +08:00
|
|
|
"babel-plugin-transform-async-to-generator": "^6.22.0",
|
2016-07-24 05:53:59 +08:00
|
|
|
"babel-plugin-transform-class-properties": "^6.11.5",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-plugin-transform-es2015-arrow-functions": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-block-scoped-functions": "^6.5.0",
|
2017-02-15 03:24:01 +08:00
|
|
|
"babel-plugin-transform-es2015-block-scoping": "^6.23.0",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-plugin-transform-es2015-classes": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-computed-properties": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-destructuring": "^6.5.0",
|
|
|
|
"babel-plugin-transform-es2015-for-of": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-literals": "^6.5.0",
|
|
|
|
"babel-plugin-transform-es2015-modules-commonjs": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-object-super": "^6.5.0",
|
|
|
|
"babel-plugin-transform-es2015-parameters": "^6.5.0",
|
|
|
|
"babel-plugin-transform-es2015-shorthand-properties": "^6.5.0",
|
|
|
|
"babel-plugin-transform-es2015-spread": "^6.5.2",
|
|
|
|
"babel-plugin-transform-es2015-template-literals": "^6.5.2",
|
2016-03-25 07:26:34 +08:00
|
|
|
"babel-plugin-transform-object-rest-spread": "^6.6.5",
|
2016-05-04 14:50:27 +08:00
|
|
|
"babel-plugin-transform-react-jsx-source": "^6.8.0",
|
2017-11-24 01:44:58 +08:00
|
|
|
"babel-plugin-transform-regenerator": "^6.26.0",
|
2016-02-27 08:49:32 +08:00
|
|
|
"babel-preset-react": "^6.5.0",
|
2016-06-02 02:21:26 +08:00
|
|
|
"babel-traverse": "^6.9.0",
|
2018-05-15 17:38:50 +08:00
|
|
|
"babylon": "6.18.0",
|
2014-12-31 14:57:47 +08:00
|
|
|
"bundle-collapser": "^1.1.1",
|
2017-03-16 05:20:08 +08:00
|
|
|
"chalk": "^1.1.3",
|
2017-04-05 23:47:29 +08:00
|
|
|
"cli-table": "^0.3.1",
|
2015-01-26 18:19:35 +08:00
|
|
|
"coffee-script": "^1.8.0",
|
2016-04-02 20:26:35 +08:00
|
|
|
"core-js": "^2.2.1",
|
2015-12-22 04:05:03 +08:00
|
|
|
"coveralls": "^2.11.6",
|
2018-02-01 01:41:09 +08:00
|
|
|
"create-react-class": "^15.6.3",
|
Run Jest in production mode (#11616)
* Move Jest setup files to /dev/ subdirectory
* Clone Jest /dev/ files into /prod/
* Move shared code into scripts/jest
* Move Jest config into the scripts folder
* Fix the equivalence test
It fails because the config is now passed to Jest explicitly.
But the test doesn't know about the config.
To fix this, we just run it via `yarn test` (which includes the config).
We already depend on Yarn for development anyway.
* Add yarn test-prod to run Jest with production environment
* Actually flip the production tests to run in prod environment
This produces a bunch of errors:
Test Suites: 64 failed, 58 passed, 122 total
Tests: 740 failed, 26 skipped, 1809 passed, 2575 total
Snapshots: 16 failed, 4 passed, 20 total
* Ignore expectDev() calls in production
Down from 740 to 175 failed.
Test Suites: 44 failed, 78 passed, 122 total
Tests: 175 failed, 26 skipped, 2374 passed, 2575 total
Snapshots: 16 failed, 4 passed, 20 total
* Decode errors so tests can assert on their messages
Down from 175 to 129.
Test Suites: 33 failed, 89 passed, 122 total
Tests: 129 failed, 1029 skipped, 1417 passed, 2575 total
Snapshots: 16 failed, 4 passed, 20 total
* Remove ReactDOMProduction-test
There is no need for it now. The only test that was special is moved into ReactDOM-test.
* Remove production switches from ReactErrorUtils
The tests now run in production in a separate pass.
* Add and use spyOnDev() for warnings
This ensures that by default we expect no warnings in production bundles.
If the warning *is* expected, use the regular spyOn() method.
This currently breaks all expectDev() assertions without __DEV__ blocks so we go back to:
Test Suites: 56 failed, 65 passed, 121 total
Tests: 379 failed, 1029 skipped, 1148 passed, 2556 total
Snapshots: 16 failed, 4 passed, 20 total
* Replace expectDev() with expect() in __DEV__ blocks
We started using spyOnDev() for console warnings to ensure we don't *expect* them to occur in production. As a consequence, expectDev() assertions on console.error.calls fail because console.error.calls doesn't exist. This is actually good because it would help catch accidental warnings in production.
To solve this, we are getting rid of expectDev() altogether, and instead introduce explicit expectation branches. We'd need them anyway for testing intentional behavior differences.
This commit replaces all expectDev() calls with expect() calls in __DEV__ blocks. It also removes a few unnecessary expect() checks that no warnings were produced (by also removing the corresponding spyOnDev() calls).
Some DEV-only assertions used plain expect(). Those were also moved into __DEV__ blocks.
ReactFiberErrorLogger was special because it console.error()'s in production too. So in that case I intentionally used spyOn() instead of spyOnDev(), and added extra assertions.
This gets us down to:
Test Suites: 21 failed, 100 passed, 121 total
Tests: 72 failed, 26 skipped, 2458 passed, 2556 total
Snapshots: 16 failed, 4 passed, 20 total
* Enable User Timing API for production testing
We could've disabled it, but seems like a good idea to test since we use it at FB.
* Test for explicit Object.freeze() differences between PROD and DEV
This is one of the few places where DEV and PROD behavior differs for performance reasons.
Now we explicitly test both branches.
* Run Jest via "yarn test" on CI
* Remove unused variable
* Assert different error messages
* Fix error handling tests
This logic is really complicated because of the global ReactFiberErrorLogger mock.
I understand it now, so I added TODOs for later.
It can be much simpler if we change the rest of the tests that assert uncaught errors to also assert they are logged as warnings.
Which mirrors what happens in practice anyway.
* Fix more assertions
* Change tests to document the DEV/PROD difference for state invariant
It is very likely unintentional but I don't want to change behavior in this PR.
Filed a follow up as https://github.com/facebook/react/issues/11618.
* Remove unnecessary split between DEV/PROD ref tests
* Fix more test message assertions
* Make validateDOMNesting tests DEV-only
* Fix error message assertions
* Document existing DEV/PROD message difference (possible bug)
* Change mocking assertions to be DEV-only
* Fix the error code test
* Fix more error message assertions
* Fix the last failing test due to known issue
* Run production tests on CI
* Unify configuration
* Fix coverage script
* Remove expectDev from eslintrc
* Run everything in band
We used to before, too. I just forgot to add the arguments after deleting the script.
2017-11-22 21:02:26 +08:00
|
|
|
"cross-env": "^5.1.1",
|
2018-01-17 09:49:38 +08:00
|
|
|
"danger": "^3.0.4",
|
2015-11-12 21:02:45 +08:00
|
|
|
"del": "^2.0.2",
|
2015-10-27 06:15:00 +08:00
|
|
|
"derequire": "^2.0.3",
|
2017-04-05 23:47:29 +08:00
|
|
|
"escape-string-regexp": "^1.0.5",
|
2018-01-10 02:55:51 +08:00
|
|
|
"eslint": "^4.1.0",
|
2016-11-18 06:16:44 +08:00
|
|
|
"eslint-config-fbjs": "^1.1.1",
|
|
|
|
"eslint-plugin-babel": "^3.3.0",
|
|
|
|
"eslint-plugin-flowtype": "^2.25.0",
|
2018-01-10 02:55:51 +08:00
|
|
|
"eslint-plugin-jest": "^21.6.1",
|
2018-02-10 00:11:22 +08:00
|
|
|
"eslint-plugin-no-for-of-loops": "^1.0.0",
|
2016-11-18 06:16:44 +08:00
|
|
|
"eslint-plugin-react": "^6.7.1",
|
2018-01-10 02:55:51 +08:00
|
|
|
"eslint-plugin-react-internal": "link:./scripts/eslint-rules/",
|
2016-04-06 01:50:54 +08:00
|
|
|
"fbjs-scripts": "^0.6.0",
|
2017-04-05 23:47:29 +08:00
|
|
|
"filesize": "^3.5.6",
|
2018-05-22 00:54:48 +08:00
|
|
|
"flow-bin": "^0.72.0",
|
2018-01-10 03:14:56 +08:00
|
|
|
"flow-coverage-report": "^0.4.0",
|
2017-04-05 23:47:29 +08:00
|
|
|
"git-branch": "^0.3.0",
|
|
|
|
"glob": "^6.0.4",
|
2017-03-03 03:18:46 +08:00
|
|
|
"glob-stream": "^6.1.0",
|
2018-05-15 00:49:41 +08:00
|
|
|
"google-closure-compiler": "20180506.0.0",
|
2013-12-29 14:41:54 +08:00
|
|
|
"gzip-js": "~0.3.2",
|
2017-04-05 23:47:29 +08:00
|
|
|
"gzip-size": "^3.0.0",
|
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",
|
2018-06-13 19:41:23 +08:00
|
|
|
"jest": "^23.1.0",
|
2018-05-29 06:03:15 +08:00
|
|
|
"jest-diff": "^23.0.1",
|
2016-08-11 09:17:49 +08:00
|
|
|
"merge-stream": "^1.0.0",
|
2017-12-11 23:52:46 +08:00
|
|
|
"minimatch": "^3.0.4",
|
2017-04-05 23:47:29 +08:00
|
|
|
"minimist": "^1.2.0",
|
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",
|
2014-06-18 05:21:24 +08:00
|
|
|
"platform": "^1.1.0",
|
2018-04-17 08:43:55 +08:00
|
|
|
"prettier": "1.11.1",
|
2017-09-26 07:29:56 +08:00
|
|
|
"prop-types": "^15.6.0",
|
2018-01-25 11:36:22 +08:00
|
|
|
"random-seed": "^0.3.0",
|
2018-04-20 00:08:44 +08:00
|
|
|
"react-lifecycles-compat": "^3.0.2",
|
2017-04-05 23:47:29 +08:00
|
|
|
"rimraf": "^2.6.1",
|
2017-12-12 00:54:12 +08:00
|
|
|
"rollup": "^0.52.1",
|
|
|
|
"rollup-plugin-babel": "^3.0.1",
|
2017-11-03 00:56:12 +08:00
|
|
|
"rollup-plugin-commonjs": "^8.2.6",
|
2017-12-12 00:54:12 +08:00
|
|
|
"rollup-plugin-node-resolve": "^2.1.1",
|
2017-11-09 06:37:11 +08:00
|
|
|
"rollup-plugin-prettier": "^0.3.0",
|
2017-12-12 00:54:12 +08:00
|
|
|
"rollup-plugin-replace": "^2.0.0",
|
2017-11-09 06:37:11 +08:00
|
|
|
"rollup-plugin-strip-banner": "^0.2.0",
|
2015-10-27 06:15:00 +08:00
|
|
|
"run-sequence": "^1.1.4",
|
2018-03-24 03:31:16 +08:00
|
|
|
"semver": "^5.5.0",
|
2017-12-05 21:53:53 +08:00
|
|
|
"targz": "^1.0.1",
|
2015-07-18 09:20:38 +08:00
|
|
|
"through2": "^2.0.0",
|
2015-10-27 06:15:00 +08:00
|
|
|
"tmp": "~0.0.28",
|
2016-05-03 07:08:12 +08:00
|
|
|
"typescript": "~1.8.10",
|
2016-11-08 03:43:29 +08:00
|
|
|
"yargs": "^6.3.0"
|
2013-05-30 03:46:11 +08:00
|
|
|
},
|
2015-08-19 09:05:13 +08:00
|
|
|
"devEngines": {
|
2018-01-19 07:16:47 +08:00
|
|
|
"node": "8.x || 9.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": {
|
2017-11-30 01:32:47 +08:00
|
|
|
"build": "npm run version-check && node ./scripts/rollup/build.js",
|
2018-01-10 03:14:56 +08:00
|
|
|
"flow-coverage": "flow-coverage-report --config ./.flowcoverage",
|
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",
|
2018-05-18 09:05:19 +08:00
|
|
|
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js",
|
2017-12-07 19:05:39 +08:00
|
|
|
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand",
|
2017-11-24 01:44:58 +08:00
|
|
|
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
|
|
|
|
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
|
|
|
|
"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",
|
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",
|
2017-04-05 23:47:29 +08:00
|
|
|
"version-check": "node ./scripts/tasks/version-check.js"
|
2013-11-14 07:02:23 +08:00
|
|
|
}
|
2013-05-30 03:46:11 +08:00
|
|
|
}
|