Skip to content

Strip TS types ourselves #1376

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 1 commit into from
Jun 11, 2025
Merged

Strip TS types ourselves #1376

merged 1 commit into from
Jun 11, 2025

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Jun 11, 2025

Instead of using ts-blank-space we're using custom logic that closely follows that of https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/remove_typescript_nodes.js . That way we shrink the worker bundle by about 9x.

Tested by pasting https://github.com/sveltejs/svelte/blob/main/packages/svelte/tests/runtime-runes/samples/typescript/main.svelte (minus the script tags/template) into a .ts file

Instead of using `ts-blank-space` we're using custom logic that closely follows that of https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/remove_typescript_nodes.js . That way we shrink the worker bundle by about 9x.
Copy link

vercel bot commented Jun 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
svelte-dev ✅ Ready (Inspect) Visit Preview Jun 11, 2025 1:21pm

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's go!!

@Rich-Harris Rich-Harris merged commit 74eee76 into main Jun 11, 2025
4 checks passed
@Rich-Harris Rich-Harris deleted the strip-types-ourselves branch June 11, 2025 21:44
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.

3 participants