Skip to content

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

Merged
Lms24 merged 10 commits into
masterfrom
lms-replay-build-tsconfigs
Nov 29, 2022
Merged

chore(replay): Align and clean up tsconfig.jsons#6308
Lms24 merged 10 commits into
masterfrom
lms-replay-build-tsconfigs

Conversation

@Lms24

@Lms24Lms24 commented Nov 25, 2022

Copy link
Copy Markdown
Member

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

github-actionsBot commented Nov 25, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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.js62.13 KB (-1.99% 🔽)
@sentry/replay - Webpack (gzipped + minified)62.13 KB (-1.99% 🔽)
@sentry/replay - Webpack (minified)200.15 KB (-2.28% 🔽)

@Lms24Lms24 changed the title ref(replay): Align and clean up tsconfig.jsonschore(replay): Align and clean up tsconfig.jsonsNov 25, 2022
@Lms24
Lms24force-pushed the lms-replay-build-tsconfigs branch from 626244b to be5f26eCompareNovember 25, 2022 15:19
@mydea
mydeaforce-pushed the lms-replay-build-tsconfigs branch from bc912c4 to 827d0ecCompareNovember 28, 2022 08:21
@Lms24
Lms24force-pushed the lms-replay-build-tsconfigs branch from bf5ff2e to 9846e4cCompareNovember 29, 2022 14:35
@Lms24
Lms24force-pushed the lms-replay-build-tsconfigs branch from 6114aac to fb6816eCompareNovember 29, 2022 15:12
test
more test
remove duplicated `globals` entry in jest.config after rebase
add `__DEBUG_BUILD__`
@Lms24
Lms24force-pushed the lms-replay-build-tsconfigs branch from fb6816e to 12a90b6CompareNovember 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 mydeaNovember 29, 2022 16:13
Comment threadpackages/replay/tsconfig.worker.json Outdated
"resolveJsonModule": true,
"skipLibCheck": true,
"target": "es5"
"target": "es5",

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@mydeamydea left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

Well, just took me a day to fight tests 😅

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

@Lms24@mydea