mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
Summary: Since I'm adding a new experiment I figured I'd delete an equivalent sized one. Last year I added an option that runs the Prepack program by invoking Node.js JS runtime which lets us prepack the whole module system and initialization. It's essentially a packager with perfect Node.js module resolution semantics. It did this by modeling Node's native environment as Prepack bindings. This PR removes that whole option. There's a few reasons why I don't think that worked out as a good idea. - It's not solving a real need. It is hard to keep different module systems in tact. There is always something in the ecosystem that breaks down and using the canonical one solves that. However, in practice, if there is a need for bundling the ecosystem itself adapts to the toolchain. So it's not actually that hard to bundle up a CLI even with Webpack, even if it's strictly not 100% compatible, by tweaking a few downstream depenencies. - Running the resulting bundle is tricky. The resulting bundle includes the JS parts of Node. This overlaps with what Node.js adds at runtime so it runs it twice. The ideal is actually to build a custom distribution of Node.js but this is generally overkill for what people want. - Bindings change a lot. While Node.js's API notoriously doesn't change much. The internals do change a lot. By picking the API boundary in the middle of the internals of Node.js, it risks changing with any version. While technically observable changes, nobody else relies on these details. If this option was worth its weight, someone could probably maintain it but so far that has not been the case so we had to disable this option in CI to upgrade Node. However, going forward I think there are alternative approaches we can explore. - First class module system. This is something we really need at some point. A first class module system would be able to load Node.js module files from disk and package them up while excluding others. It doesn't have to be literally Node.js's module system. Close enough is ok. Especially as standards compliant ECMAScript modules get more popular. This lets us target compiling output that runs after Node's initialization. - By introducing havocing and membranes in the boundaries, it becomes possible to initialize Node.js modules without actually knowing the internal of the boundaries. - We've started optimizing residual functions which is much more interesting. However, this requires that code puts some constraints on how it works with its environment. It's not designed to be fully backwards compatible. That's probably a good thing but that also means that we can put constraints on the modules being Prepacked. This removes the ability to prepack Prepack itself which is unfortunate but already wasn't being tested. To speed up Prepack itself, the [LLVM backend](https://github.com/facebook/prepack/pull/2264) seems much more useful if it can ever work on Prepack itself. Pull Request resolved: https://github.com/facebook/prepack/pull/2267 Differential Revision: D8863788 Pulled By: sebmarkbage fbshipit-source-id: d777ec9a95c8523b3386cfad553d9f691ec59074
159 lines
7.3 KiB
JSON
159 lines
7.3 KiB
JSON
{
|
|
"name": "prepack",
|
|
"version": "0.2.44-alpha.0",
|
|
"description": "Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.",
|
|
"homepage": "https://github.com/facebook/prepack",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git://github.com/facebook/prepack.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/facebook/prepack/issues"
|
|
},
|
|
"files": [
|
|
"LICENSE",
|
|
"PATENTS",
|
|
"/bin/",
|
|
"/lib/"
|
|
],
|
|
"bin": {
|
|
"prepack": "bin/prepack.js",
|
|
"prepack-repl": "bin/prepack-repl.js"
|
|
},
|
|
"main": "lib/prepack-node.js",
|
|
"browser": "lib/prepack-standalone.js",
|
|
"scripts": {
|
|
"build": "yarn build-prepack && yarn build-bundle",
|
|
"build-scripts": "babel scripts --out-dir lib --source-maps",
|
|
"build-bundle": "webpack-cli",
|
|
"build-prepack": "babel src --out-dir lib --source-maps",
|
|
"watch": "babel src scripts --out-dir lib --watch --source-maps --verbose",
|
|
"lint": "eslint src scripts",
|
|
"flow": "flow version; flow check --merge-timeout 0",
|
|
"test-residual": "babel-node scripts/test-residual.js",
|
|
"test-residual-with-coverage": "./node_modules/.bin/istanbul cover ./lib/test-residual.js --dir coverage.residual && ./node_modules/.bin/remap-istanbul -i coverage.residual/coverage.json -o coverage-sourcemapped.residual -t html",
|
|
"test-serializer": "babel-node --stack_trace_limit=200 --stack_size=10000 scripts/test-runner.js",
|
|
"test-serializer-with-coverage": "./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && ./node_modules/.bin/istanbul cover ./lib/test-runner.js && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -i coverage/coverage.json -o coverage-sourcemapped -t html",
|
|
"test-sourcemaps": "babel-node scripts/generate-sourcemaps-test.js && bash < scripts/test-sourcemaps.sh",
|
|
"test-test262": "babel-node scripts/test262-runner.js",
|
|
"test-test262-nightly": "NIGHTLY_BUILD=true babel-node scripts/test262-runner.js",
|
|
"test-test262-new": "babel-node scripts/test262.js",
|
|
"test-internal": "babel-node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=16384 scripts/test-internal.js",
|
|
"test-internal-react": "babel-node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=16384 scripts/test-internal-react.js",
|
|
"test-error-handler": "babel-node scripts/test-error-handler.js",
|
|
"test-error-handler-with-coverage": "./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -o coverage-sourcemapped.error -t html",
|
|
"test-std-in": "bash < scripts/test-std-in.sh",
|
|
"test-react": "jest",
|
|
"test-react-fast": "SKIP_REACT_JSX_TESTS=true jest",
|
|
"test": "yarn test-residual && yarn test-serializer && yarn test-sourcemaps && yarn test-error-handler && yarn test-std-in && yarn test-test262 && yarn test-internal && yarn test-internal-react && yarn test-react",
|
|
"test-coverage-most": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/remap-istanbul -i coverage.most/coverage.json -o coverage-sourcemapped -t html",
|
|
"test-all-coverage": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/test262-runner.js --timeout 50 --singleThreaded && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -i coverage.most/coverage.json -o coverage-sourcemapped -t html",
|
|
"repl": "node lib/repl-cli.js",
|
|
"precheck": "yarn prepack-cli --check",
|
|
"prepack-cli": "node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=16384 lib/prepack-cli.js --accelerateUnsupportedRequires --compatibility jsc-600-1-4-17 --delayUnsupportedRequires --mathRandomSeed 0",
|
|
"validate": "yarn install --frozen-lockfile && yarn build && yarn build-scripts && yarn lint && yarn depcheck && yarn flow && yarn test",
|
|
"prepublishOnly": "yarn build",
|
|
"depcheck": "babel-node scripts/detect_bad_deps.js",
|
|
"prettier": "node ./scripts/prettier.js write-changed",
|
|
"prettier-all": "node ./scripts/prettier.js write",
|
|
"prettier-ci": "node ./scripts/prettier.js",
|
|
"debug-fb-www": "node --stack_trace_limit=200 --stack_size=10000 --max_old_space_size=16384 ./scripts/debug-fb-www.js"
|
|
},
|
|
"dependencies": {
|
|
"@babel/core": "^7.0.0-beta.53",
|
|
"@babel/generator": "^7.0.0-beta.53",
|
|
"@babel/node": "^7.0.0-beta.53",
|
|
"@babel/parser": "^7.0.0-beta.53",
|
|
"@babel/preset-flow": "7.0.0-beta.53",
|
|
"@babel/template": "^7.0.0-beta.53",
|
|
"@babel/traverse": "^7.0.0-beta.53",
|
|
"@babel/types": "^7.0.0-beta.53",
|
|
"fbjs": "^0.8.16",
|
|
"node-zip": "^1.1.1",
|
|
"queue-fifo": "^0.2.3",
|
|
"seedrandom": "^2.4.2",
|
|
"source-map": "^0.5.6",
|
|
"vscode-debugadapter": "^1.24.0",
|
|
"vscode-debugprotocol": "^1.24.0"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/cli": "^7.0.0-beta.53",
|
|
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.53",
|
|
"@babel/plugin-proposal-export-default-from": "^7.0.0-beta.53",
|
|
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.53",
|
|
"@babel/plugin-syntax-flow": "^7.0.0-beta.53",
|
|
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.53",
|
|
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.53",
|
|
"@babel/plugin-transform-react-display-name": "^7.0.0-beta.53",
|
|
"@babel/plugin-transform-react-jsx": "^7.0.0-beta.53",
|
|
"@babel/preset-env": "^7.0.0-beta.53",
|
|
"@babel/preset-flow": "7.0.0-beta.53",
|
|
"@babel/preset-react": "^7.0.0-beta.53",
|
|
"@babel/register": "^7.0.0-beta.53",
|
|
"babel-core": "7.0.0-bridge.0",
|
|
"babel-eslint": "^8.2.6",
|
|
"babel-jest": "^23.4.0",
|
|
"babel-loader": "^8.0.0-beta",
|
|
"babel-plugin-jest-hoist": "^23.2.0",
|
|
"chalk": "^1.1.3",
|
|
"eslint": "^4.18.2",
|
|
"eslint-plugin-babel": "^3.3.0",
|
|
"eslint-plugin-flow-header": "^0.1.1",
|
|
"eslint-plugin-flowtype": "^2.40.0",
|
|
"eslint-plugin-header": "^1.0.0",
|
|
"eslint-plugin-prettier": "^2.1.2",
|
|
"flow-bin": "^0.76.0",
|
|
"flow-typed": "^2.3.0",
|
|
"graceful-fs": "^4.1.11",
|
|
"invariant": "^2.2.0",
|
|
"istanbul": "^0.4.5",
|
|
"jest": "^23.4.1",
|
|
"js-beautify": "^1.7.5",
|
|
"js-yaml": "^3.6.1",
|
|
"jsdom": "^9.2.1",
|
|
"madge": "^1.6.0",
|
|
"minimist": "^1.2.0",
|
|
"prettier": "1.13.6",
|
|
"prop-types": "^15.6.0",
|
|
"react": "16.3.1",
|
|
"react-dom": "16.3.1",
|
|
"react-native": "^0.55.4",
|
|
"react-relay": "^1.4.1",
|
|
"react-test-renderer": "16.3.1",
|
|
"regenerator-runtime": "^0.12.0",
|
|
"remap-istanbul": "^0.9.1",
|
|
"source-map-support": "^0.4.6",
|
|
"test262-integrator": "^1.2.0",
|
|
"webpack": "^4.16.0",
|
|
"webpack-cli": "^3.0.8"
|
|
},
|
|
"optionalDependencies": {
|
|
"v8-profiler": "^5.7.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=6.1.0"
|
|
},
|
|
"keywords": [
|
|
"prepack"
|
|
],
|
|
"license": "BSD-3-Clause",
|
|
"author": "Facebook",
|
|
"jest": {
|
|
"preset": "react-native",
|
|
"roots": [
|
|
"<rootDir>/node_modules/react-native/",
|
|
"<rootDir>/lib/",
|
|
"<rootDir>/test/react/",
|
|
"<rootDir>/fb-www/"
|
|
],
|
|
"testEnvironment": "jsdom",
|
|
"testMatch": [
|
|
"**/test/react/*-test.js",
|
|
"**/fb-www/**/*-test.js"
|
|
],
|
|
"transformIgnorePatterns": [
|
|
"/node_modules/(?!react-native).+\\.js$"
|
|
]
|
|
}
|
|
}
|