Skip to content

Reconsidering TypeScript for Svelte Compiler Internals #16647

@rebasecase

Description

@rebasecase

Describe the problem

I would like to respectfully open a discussion regarding the possibility of moving the compiler and internal codebase back to TypeScript. I fully appreciate the rationale behind the initial decision to use JavaScript with JSDoc annotations, as articulated by Rich Harris: “We also eliminate an entire class of annoying papercuts that will be familiar to anyone who has worked with the uneven landscape of TypeScript tooling” (reddit.com). The concerns about tooling friction, dual compilation, and iteration speed were entirely valid at the time.

However, the development landscape has evolved significantly. Node 23.6 now allows TypeScript files to run natively, substantially reducing the historical overhead of compilation. Tooling has also improved, with solutions such as tsx providing near-instant feedback loops. Many of the previous bottlenecks around compile-then-run workflows are now largely obsolete.

At the same time, the developer ecosystem has shifted. More contributors today are TypeScript-native rather than relying on JavaScript with TypeScript adaptations. Reintroducing TypeScript internally could broaden the pool of potential maintainers, reduce onboarding friction, and enable the team to take advantage of modern TypeScript features and stricter typing guarantees without compromising speed or simplicity.

I raise this suggestion not out of criticism but from a place of genuine concern for the project’s long-term sustainability. JavaScript with JSDoc has served Svelte well, but revisiting TypeScript could provide stronger alignment with the wider TypeScript-first ecosystem, enhance maintainability, and potentially accelerate development velocity over time.

Would it be possible to have a careful and open discussion regarding the pros and cons of reconsidering TypeScript internally? A genuine debate could allow the team to weigh historical trade-offs against modern tooling and contributor trends, ultimately supporting the project’s longevity.

Thank you for considering this perspective and for your ongoing dedication to the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions