Skip to content

chore(replay): Align and clean up tsconfig.jsons #6308

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
merged 10 commits into from
Nov 29, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 25, 2022

This PR aligns and cleans up the tsconfig.json files in the replay package. In preparations to applying the monorepo's rollup and sucrase configs, we should first align the tsconfigs. This PR:

  • Decouples tsconfig.core.json and tsconfig.worker.json. For now we can first focus on the core build and later on revisit the worker build config.
  • Removes nesting of tsconfigs
  • Moves all tsconfigs to the package-level. Eventually, the config directory will be removed (after aligning the rollup configs)
  • Extends the core tsconfig from the monorepo's base tsconfig
  • Removes thereby redundant compiler options and entries
  • Tmp-fixes type errors after using the monorepo's base config
  • Modifies Jest configs to work with the monorepo's tsconfig layout (tsconfig.test.json)
  • Imortant: This changes the target from es5 to es6. I think this is fine as all Sentry JS SDKs are transpiled to ES6 by default. We can discuss providing ES5 CDN bundles like we do for our other CDN bundles.

ref: #6280

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.54 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.42 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.21 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 53.76 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.94 KB (0%)
@sentry/browser - Webpack (minified) 65.25 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.96 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.96 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.41 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.83 KB (+0.01% 🔺)
@sentry/replay index.js 62.13 KB (-1.99% 🔽)
@sentry/replay - Webpack (gzipped + minified) 62.13 KB (-1.99% 🔽)
@sentry/replay - Webpack (minified) 200.15 KB (-2.28% 🔽)

@Lms24 Lms24 changed the title ref(replay): Align and clean up tsconfig.jsons chore(replay): Align and clean up tsconfig.jsons Nov 25, 2022
@Lms24 Lms24 force-pushed the lms-replay-build-tsconfigs branch from 626244b to be5f26e Compare November 25, 2022 15:19
@mydea mydea force-pushed the lms-replay-build-tsconfigs branch from bc912c4 to 827d0ec Compare November 28, 2022 08:21
@Lms24 Lms24 force-pushed the lms-replay-build-tsconfigs branch from bf5ff2e to 9846e4c Compare November 29, 2022 14:35
@Lms24 Lms24 force-pushed the lms-replay-build-tsconfigs branch from 6114aac to fb6816e Compare November 29, 2022 15:12
test

more test

remove duplicated `globals` entry in jest.config after rebase

add `__DEBUG_BUILD__`
@Lms24 Lms24 force-pushed the lms-replay-build-tsconfigs branch from fb6816e to 12a90b6 Compare November 29, 2022 15:51
@Lms24 Lms24 marked this pull request as ready for review November 29, 2022 16:12
@Lms24 Lms24 requested a review from mydea November 29, 2022 16:13
@@ -7,7 +7,13 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"target": "es5"
"target": "es5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Is it on purpose that we keep es5 as target here? Just making sure :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we should probably change it to ES6

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! Great work!

@Lms24
Copy link
Member Author

Lms24 commented Nov 29, 2022

Well, just took me a day to fight tests 😅

@Lms24 Lms24 merged commit 5ba75c7 into master Nov 29, 2022
@Lms24 Lms24 deleted the lms-replay-build-tsconfigs branch November 29, 2022 16:54
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