Skip to content

ref(build): Update to TypeScript 3.8.3 #4491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Feb 2, 2022

This updates the SDK to use Typescript 3.8.3, in order to be able to use type-only imports and exports. (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, 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.

Ultimately we may end up upgrading all the way to 4.x, but that can be left for a future PR if so. [UPDATE] 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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2022

size-limit report

Path Base Size (9ca911b) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 19.68 KB 19.69 KB +0.03% 🔺
@sentry/browser - CDN Bundle (minified) 62.89 KB 62.91 KB +0.03% 🔺
@sentry/browser - Webpack 22.21 KB 22.21 KB +0.02% 🔺
@sentry/browser - Webpack - gzip = false 76.02 KB 76.03 KB +0.02% 🔺
@sentry/react - Webpack 22.24 KB 22.25 KB +0.02% 🔺
@sentry/nextjs Client - Webpack 46.24 KB 46.26 KB +0.06% 🔺
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.22 KB 28.24 KB +0.06% 🔺

@lobsterkatie lobsterkatie force-pushed the kmclb-upgrade-to-typescript-3.8.3 branch from 707436f to 4146840 Compare February 3, 2022 16:17
@lobsterkatie lobsterkatie force-pushed the kmclb-upgrade-to-typescript-3.8.3 branch from 4146840 to 8bdd1c4 Compare February 3, 2022 18:27
@lobsterkatie lobsterkatie merged commit ab2c8c6 into kmclb-new-bundling-process Feb 3, 2022
@lobsterkatie lobsterkatie deleted the kmclb-upgrade-to-typescript-3.8.3 branch February 3, 2022 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants