From 3bda1b300c78b8158a92ca1d312143f43829e4cc Mon Sep 17 00:00:00 2001 From: Ben Scott Date: Tue, 12 May 2020 20:50:39 -0700 Subject: [PATCH] Update typescript to 3.9 and enable skipLibCheck TS 3.9 offers a few speed improvements. Nothing huuuuuge, but it shaves 3 seconds of our build and type-check commands. Enabling skipLibCheck (as set by our parent TS configs) meanwhile saves an additional 10 seconds as we don't bother checking TS declaration files that we don't use. Recently TS's init scripts were updated so now this is set to true in newly creacted configs so I'm now more confident in following suit. On Master: type-check took ~38s, build took ~52s This commit: type-check took ~24.5s, build took ~37s --- UNRELEASED.md | 4 ++++ package.json | 2 +- tsconfig.json | 3 +-- yarn.lock | 13 ++++--------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/UNRELEASED.md b/UNRELEASED.md index a2725494e60..f0789f06729 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -12,8 +12,12 @@ ### Development workflow +- Improved speed of type-check and build by enabling TypeScript's `skipLibCheck` option ([#2981](https://github.com/Shopify/polaris-react/pull/2981)) + ### Dependency upgrades +- Updated TypeScript to 3.9.2 ([#2981](https://github.com/Shopify/polaris-react/pull/2981)) + ### Code quality ### Deprecations diff --git a/package.json b/package.json index 868734c6af8..a225ba1c743 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "shx": "^0.3.2", "storybook-chromatic": "^3.4.1", "svgo": "^1.3.0", - "typescript": "~3.8.3" + "typescript": "~3.9.2" }, "peerDependencies": { "react": "^16.8.6", diff --git a/tsconfig.json b/tsconfig.json index 027d6ef6f6b..e026c671d7e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,7 @@ // strictFunctionTypes is implictly enabled by strict mode but // we're not yet compliant, so disable for now "strictFunctionTypes": false, - "importHelpers": true, - "skipLibCheck": false + "importHelpers": true }, "include": ["./config/typescript", "./src", "./tests", "./playground"] } diff --git a/yarn.lock b/yarn.lock index df1ad9cc089..2cb649aaa69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17846,15 +17846,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.7.2: - version "3.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69" - integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== - -typescript@^3.8.0-dev.20200111, typescript@~3.8.3: - version "3.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" - integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== +typescript@^3.7.2, typescript@^3.8.0-dev.20200111, typescript@~3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" + integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw== ua-parser-js@^0.7.18: version "0.7.19"