Merge pull request #6890 from backstage/rugvip/sweet

cli: bump sucrase and disable ES transforms
This commit is contained in:
Patrik Oldsberg
2021-09-18 18:47:44 +02:00
committed by GitHub
5 changed files with 20 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Disabled ECMAScript transforms in app and backend builds in order to reduce bundle size and runtime performance. For the rationale and a full list of syntax that is no longer transformed, see https://github.com/alangpierce/sucrase#transforms. This also enables TypeScripts `useDefineForClassFields` flag by default, which in rare occasions could cause build failures. For instructions on how to mitigate issues due to the flag, see the [TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier).
+2 -1
View File
@@ -33,6 +33,7 @@
"strictPropertyInitialization": true,
"stripInternal": true,
"target": "ES2019",
"types": ["node", "jest", "webpack-env"]
"types": ["node", "jest", "webpack-env"],
"useDefineForClassFields": true
}
}
+2 -2
View File
@@ -44,7 +44,7 @@
"@spotify/eslint-config-base": "^9.0.0",
"@spotify/eslint-config-react": "^10.0.0",
"@spotify/eslint-config-typescript": "^10.0.0",
"@sucrase/jest-plugin": "^2.1.0",
"@sucrase/jest-plugin": "^2.1.1",
"@sucrase/webpack-loader": "^2.0.0",
"@svgr/plugin-jsx": "5.5.x",
"@svgr/plugin-svgo": "5.4.x",
@@ -103,7 +103,7 @@
"run-script-webpack-plugin": "^0.0.11",
"semver": "^7.3.2",
"style-loader": "^1.2.1",
"sucrase": "^3.18.2",
"sucrase": "^3.20.1",
"tar": "^6.1.2",
"terser-webpack-plugin": "^5.1.3",
"ts-loader": "^8.0.17",
@@ -39,6 +39,7 @@ export const transforms = (options: TransformOptions): Transforms => {
loader: require.resolve('@sucrase/webpack-loader'),
options: {
transforms: ['typescript', 'jsx', ...extraTransforms],
disableESTransforms: true,
production: !isDev,
},
},
@@ -48,6 +49,7 @@ export const transforms = (options: TransformOptions): Transforms => {
loader: require.resolve('@sucrase/webpack-loader'),
options: {
transforms: ['jsx', ...extraTransforms],
disableESTransforms: true,
production: !isDev,
},
},
@@ -64,6 +66,7 @@ export const transforms = (options: TransformOptions): Transforms => {
loader: require.resolve('@sucrase/webpack-loader'),
options: {
transforms: ['jsx', ...extraTransforms],
disableESTransforms: true,
production: !isDev,
},
},
+8 -8
View File
@@ -6080,10 +6080,10 @@
resolve-from "^5.0.0"
store2 "^2.12.0"
"@sucrase/jest-plugin@^2.1.0":
version "2.1.0"
resolved "https://registry.npmjs.org/@sucrase/jest-plugin/-/jest-plugin-2.1.0.tgz#ee4fbe7ac43d3766ff2182bd28f73517a9c74605"
integrity sha512-dWxoZYS//2deHTyVdiHUoZSW9BxtM+mp5vqkW2gUHe2rdCgdzFutmqb/W9Q0OzlIZEpegzVxKz2xEfQNVoINYw==
"@sucrase/jest-plugin@^2.1.1":
version "2.1.1"
resolved "https://registry.npmjs.org/@sucrase/jest-plugin/-/jest-plugin-2.1.1.tgz#b1e5192e7057fec159151b6aed96eb5b3c08d5c4"
integrity sha512-1j+exUcbLRgka2lq/i0IVOYcmrMW1wYPtxJY/+RvZkAQG9GD7lygj5OiHWFKWmynltAg9+x1d5NWQQYNdBTkpQ==
dependencies:
sucrase "^3.18.0"
@@ -25706,10 +25706,10 @@ subscriptions-transport-ws@^0.9.18, subscriptions-transport-ws@^0.9.19:
symbol-observable "^1.0.4"
ws "^5.2.0 || ^6.0.0 || ^7.0.0"
sucrase@^3.18.0, sucrase@^3.18.2:
version "3.18.2"
resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.18.2.tgz#d9f16f1dd4f91e0293ad6f692867772eda301e4b"
integrity sha512-xCFP35OA6uAtBUVB8jPSftiR2Udjh0d9JkQnUOYppILpN4rBSk0yxiy67GVzD3XsFGIB6LlyIfhCABtwlopMSw==
sucrase@^3.18.0, sucrase@^3.20.1:
version "3.20.1"
resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.20.1.tgz#1c055e97d0fab2f9857f02461364075b3a4ab226"
integrity sha512-BIG59HaJOxNct9Va6KvT5yzBA/rcMGetzvZyTx0ZdCcspIbpJTPS64zuAfYlJuOj+3WaI5JOdA+F0bJQQi8ZiQ==
dependencies:
commander "^4.0.0"
glob "7.1.6"