mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Currently, `babel-plugin-react-compiler` is bundled with (almost) all external dependencies. This is because babel traversal and ast logic is not forward-compatible. Since `babel-plugin-react-compiler` needs to be compatible with babel pipelines across a wide semvar range, we (1) set this package's babel dependency to an early version and (2) inline babel libraries into our bundle. A few other packages in `react/compiler` depend on the compiler. This PR moves `snap`, our test fixture compiler and evaluator, to use the bundled version of `babel-plugin-react-compiler`. This decouples the babel version used by `snap` with the version used by `babel-plugin-react-compiler`, which means that `snap` now can test features from newer babel versions (see https://github.com/facebook/react/pull/32742). --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32758). * #32759 * __->__ #32758
62 lines
2.1 KiB
JSON
62 lines
2.1 KiB
JSON
{
|
|
"name": "snap",
|
|
"version": "0.0.1",
|
|
"public": false,
|
|
"description": "Snapshot testing CLI tool",
|
|
"main": "dist/main.js",
|
|
"license": "MIT",
|
|
"files": [
|
|
"src"
|
|
],
|
|
"scripts": {
|
|
"postinstall": "./scripts/link-react-compiler-runtime.sh && perl -p -i -e 's/react\\.element/react.transitional.element/' ../../node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' ../../node_modules/react-dom/cjs/react-dom-test-utils.development.js",
|
|
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build\"",
|
|
"snap": "node dist/main.js",
|
|
"test": "echo 'no tests'",
|
|
"prettier": "prettier --write 'src/**/*.ts'"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/facebook/react.git",
|
|
"directory": "compiler/packages/snap"
|
|
},
|
|
"dependencies": {
|
|
"@babel/code-frame": "^7.22.5",
|
|
"@babel/plugin-syntax-jsx": "^7.18.6",
|
|
"@babel/preset-flow": "^7.7.4",
|
|
"@babel/preset-typescript": "^7.26.0",
|
|
"@parcel/watcher": "^2.1.0",
|
|
"@testing-library/react": "^13.4.0",
|
|
"babel-plugin-idx": "^3.0.3",
|
|
"babel-plugin-syntax-hermes-parser": "^0.25.1",
|
|
"chalk": "4",
|
|
"fbt": "^1.0.2",
|
|
"glob": "^10.3.10",
|
|
"hermes-parser": "^0.25.1",
|
|
"jsdom": "^22.1.0",
|
|
"react": "0.0.0-experimental-4beb1fd8-20241118",
|
|
"react-dom": "0.0.0-experimental-4beb1fd8-20241118",
|
|
"readline": "^1.3.0",
|
|
"yargs": "^17.7.1"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.19.1",
|
|
"@babel/parser": "^7.20.15",
|
|
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
|
"@babel/preset-react": "^7.18.6",
|
|
"@babel/traverse": "^7.19.1",
|
|
"@types/babel__code-frame": "^7.0.6",
|
|
"@types/fbt": "^1.0.4",
|
|
"@types/glob": "^8.1.0",
|
|
"@types/node": "^18.7.18",
|
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
"@typescript-eslint/parser": "^7.4.0",
|
|
"object-assign": "^4.1.1"
|
|
},
|
|
"resolutions": {
|
|
"./**/@babel/parser": "7.7.4",
|
|
"./**/@babel/types": "7.7.4",
|
|
"@babel/preset-flow": "7.22.5"
|
|
}
|
|
}
|