Skip to content

Commit 4a5bdec

Browse files
lobsterkatieAbhiPrasad
authored andcommitted
ref(build): Update to TypeScript 3.8.3 (#4895)
This updates the SDK to use Typescript 3.8.3, in order to be able to use type-only imports and exports[1]. (These are needed for us to turn on `isolatedModules`, which is in turn is needed for us to switch our build tool away from `tsc`[2], since no other tool understands the relationship between files.) As a result of this change, a few of the browser integration tests needed to be fixed so that all promises were explicitly awaited, a point about which the linter in 3.8 complains. This is a breaking change for anyone using TS 3.7.x (there's no one using TS < 3.7.x, since that's our current minimum). That said, though there are plenty of public projects on GH using TS 3.7 and `@sentry/xyz`, if you restrict it to projects using TS 3.7 and `@sentry/xyz` 6.x, all you get are forks of this very repo. Granted, this isn't every project ever, but it's likely decently representative of the fact that if you've upgraded our SDK, you've almost certainly upgraded TS as well. We're going to wait until v7 to release this change in any case, but that's an indication that it won't affect many people when we do. (See this commit's PR for links to searches demonstrating the points.) Note: Originally there was some thought of going farther, into TS 4.x, but we decided that for the foreseeable future, we're going to stick with 3.8.3. Though moving up to 4.x doesn't seem like it would affect many customers (repeating the same TS/sentry 6.x crossover search with TS 3.8 and 3.9 reveals a total of 5 projects), it does have the known side effect of replacing export statements which, after compilation, currently look like `exports.SdkInfo = types_1.SdkInfo;` with ones that look like `Object.defineProperty(exports, "SdkInfo", { enumerable: true, get: function () { return types_1.SdkInfo; } });`. (For those of you following along at home, that's a 3x character increase.) Though we might be able to engineer around this in order to avoid the inevitable substantial bundle size hit, attempting to do so is only worth it if there are features from 4.x that we desperately need. Given that we've agreed that right now there aren't, we'll stick with 3.8.3. [1] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export [2] https://www.typescriptlang.org/tsconfig#isolatedModules
1 parent c3ffa2a commit 4a5bdec

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"ts-node": "^8.10.2",
9090
"tslib": "^2.3.1",
9191
"typedoc": "^0.18.0",
92-
"typescript": "3.7.5"
92+
"typescript": "3.8.3"
9393
},
9494
"resolutions": {
9595
"**/agent-base": "5",

packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sentryTest('should finish pageload transaction when the page goes background', a
99

1010
await page.goto(url);
1111

12-
page.click('#go-background');
12+
void page.click('#go-background');
1313

1414
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);
1515

packages/integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
1212

1313
const url = await getLocalTestPath({ testDir: __dirname });
1414

15-
page.goto(url);
15+
await page.goto(url);
1616
// To trigger FID
17-
page.click('#fid-btn');
17+
await page.click('#fid-btn');
1818

1919
const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
2020

packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ sentryTest('should capture a LCP vital with element details.', async ({ browserN
1414
);
1515

1616
const url = await getLocalTestPath({ testDir: __dirname });
17-
page.goto(url);
17+
await page.goto(url);
1818

1919
// Force closure of LCP listener.
20-
page.click('body');
20+
await page.click('body');
2121
const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
2222

2323
expect(eventData.measurements).toBeDefined();

packages/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"peerDependencies": {
1818
"tslint": "5.16.0",
19-
"typescript": "3.7.5"
19+
"typescript": "3.8.3"
2020
},
2121
"scripts": {
2222
"link:yarn": "yarn link",

scripts/verify-packages-versions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const pkg = require('../package.json');
22

3-
const TYPESCRIPT_VERSION = '3.7.5';
3+
const TYPESCRIPT_VERSION = '3.8.3';
44

55
if (pkg.devDependencies.typescript !== TYPESCRIPT_VERSION) {
66
console.error(`

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -21523,10 +21523,10 @@ typescript-memoize@^1.0.1:
2152321523
resolved "https://registry.yarnpkg.com/typescript-memoize/-/typescript-memoize-1.0.1.tgz#0a8199aa28f6fe18517f6e9308ef7bfbe9a98d59"
2152421524
integrity sha512-oJNge1qUrOK37d5Y6Ly2txKeuelYVsFtNF6U9kXIN7juudcQaHJQg2MxLOy0CqtkW65rVDYuTCOjnSIVPd8z3w==
2152521525

21526-
typescript@3.7.5:
21527-
version "3.7.5"
21528-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
21529-
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
21526+
typescript@3.8.3:
21527+
version "3.8.3"
21528+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
21529+
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
2153021530

2153121531
typescript@^3.9.5, typescript@^3.9.7:
2153221532
version "3.9.9"

0 commit comments

Comments
 (0)