From 1d1e362316b8e58200ea311c0a77f4b1ebdbd7c0 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Mon, 22 Feb 2021 10:48:53 +0000 Subject: [PATCH] Bug 1690742 - [devtools] - Remove flow plugin and stop running flow on try r=nchevobbe,bomsy Remove references to flow in build files. This effectively stop stipping flow from debugger modules. So any leftover would now start being kept in production file and do an error. Differential Revision: https://phabricator.services.mozilla.com/D105330 --- devtools/client/debugger/babel.config.js | 1 - devtools/client/debugger/bin/try-runner.js | 26 ------------------- devtools/client/debugger/package.json | 13 +++------- .../client/shared/build/build-debugger.js | 1 - devtools/client/shared/build/build.js | 6 +---- 5 files changed, 4 insertions(+), 43 deletions(-) diff --git a/devtools/client/debugger/babel.config.js b/devtools/client/debugger/babel.config.js index 0f42a288a972..8341a4194890 100644 --- a/devtools/client/debugger/babel.config.js +++ b/devtools/client/debugger/babel.config.js @@ -31,7 +31,6 @@ module.exports = { ], ], plugins: [ - "@babel/plugin-transform-flow-strip-types", "@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator", diff --git a/devtools/client/debugger/bin/try-runner.js b/devtools/client/debugger/bin/try-runner.js index 428340a56f6d..1bab722ad1e0 100644 --- a/devtools/client/debugger/bin/try-runner.js +++ b/devtools/client/debugger/bin/try-runner.js @@ -10,7 +10,6 @@ const { execFileSync } = require("child_process"); const { chdir } = require("process"); const path = require("path"); -const flow = require("flow-bin"); const dbgPath = path.join(__dirname, ".."); @@ -37,28 +36,6 @@ function logStart(name) { console.log(`TEST START | ${name}`); } -function runFlowJson() { - const { out } = execOut(flow, ["check", "--json"]); - const results = JSON.parse(out); - - if (!results.passed) { - for (const error of results.errors) { - for (const message of error.message) { - console.log(`TEST-UNEXPECTED-FAIL flow | ${message.descr}`); - } - } - } - - return results.passed; -} - -function runFlow() { - logStart("Flow"); - const { out } = execOut(flow, ["check"]); - console.log(out); - return runFlowJson(); -} - function jest() { logStart("Jest"); const { out } = execOut("yarn", ["test-ci"]); @@ -95,19 +72,16 @@ function lintMd() { } chdir(dbgPath); -const flowPassed = runFlow(); const jestPassed = jest(); const styleLintPassed = stylelint(); const remarkPassed = lintMd(); const success = - flowPassed && jestPassed && styleLintPassed && remarkPassed; console.log({ - flowPassed, jestPassed, styleLintPassed, remarkPassed, diff --git a/devtools/client/debugger/package.json b/devtools/client/debugger/package.json index 81ac145307af..e1e7fc3487d2 100644 --- a/devtools/client/debugger/package.json +++ b/devtools/client/debugger/package.json @@ -12,19 +12,14 @@ "homepage": "https://github.com/firefox-devtools/debugger#readme", "engineStrict": true, "scripts": { - "flow": "flow", "license-check": "devtools-license-check", "links": "ls -l node_modules/ | grep ^l || echo 'no linked packages'", "test": "TZ=Africa/Nairobi jest", "test-ci": "TZ=Africa/Nairobi jest --json", "test:watch": "jest --watch", "test:coverage": "yarn test --coverage", - "test:all": "yarn test; yarn flow", - "watch": "node bin/watch", - "flow-coverage": "flow-coverage-report --threshold 50 -i 'src/actions/*.js' -i 'src/reducers/*.js' -i 'src/utils/*.js' -i 'src/components/*.js' -i 'src/components/**/*.js' -t html -t text", - "flow-utils": "flow-coverage-report -i 'src/utils/*.js' -i 'src/utils/**/*.js' -t text", - "flow-redux": "flow-coverage-report -i 'src/reducers/*.js' -i 'src/actions/*.js' -t text", - "flow-react": "flow-coverage-report -i 'src/components/**/*.js' -t text" + "test:all": "yarn test", + "watch": "node bin/watch" }, "dependencies": { "codemirror": "^5.28.0", @@ -64,7 +59,6 @@ "@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-proposal-optional-chaining": "^7.8.3", - "@babel/plugin-transform-flow-strip-types": "^7.4.4", "@babel/plugin-transform-modules-commonjs": "^7.5.0", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", @@ -82,7 +76,6 @@ "enzyme-adapter-react-16": "^1.14.0", "enzyme-to-json": "3.3.5", "extract-text-webpack-plugin": "^3.0.2", - "flow-bin": "0.97.0", "immutable": "^3.8.2", "jest": "^23.0.0", "jest-environment-jsdom": "^23.0.0", @@ -94,4 +87,4 @@ "webpack": "^3.5.5", "workerjs": "github:jasonLaster/workerjs#1944c8b753cc9e84b6ed0cb2fbcaa25600706446" } -} \ No newline at end of file +} diff --git a/devtools/client/shared/build/build-debugger.js b/devtools/client/shared/build/build-debugger.js index 1866074e720f..3b5a557779b0 100644 --- a/devtools/client/shared/build/build-debugger.js +++ b/devtools/client/shared/build/build-debugger.js @@ -208,7 +208,6 @@ Babel.registerPlugin("transform-mc", transformMC); module.exports = function(filePath) { return [ - "transform-flow-strip-types", "proposal-optional-chaining", "proposal-class-properties", "transform-modules-commonjs", diff --git a/devtools/client/shared/build/build.js b/devtools/client/shared/build/build.js index 210c28c62586..c64c85481137 100644 --- a/devtools/client/shared/build/build.js +++ b/devtools/client/shared/build/build.js @@ -14,11 +14,7 @@ const Babel = require("./babel"); const fs = require("fs"); const _path = require("path"); -const defaultPlugins = [ - "transform-flow-strip-types", - "proposal-class-properties", - "transform-react-jsx", -]; +const defaultPlugins = ["proposal-class-properties", "transform-react-jsx"]; function transform(filePath) { // Use the extra plugins only for the debugger