You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Svelte 5 supports TypeScript syntax natively, but it doesn't support TypeScript runtime features such as enums, using, decorators (related: #11397) and so on.
In general, a good piece of advice is 'don't use these features, they are a bad idea'. TypeScript isn't Babel — in 2024 it should be used for adding types, nothing more. But since not everyone is aware of this distinction or inclined to follow this advice, we need some way of handling these cases.
Describe the proposed solution
The compiler should error when encountering these features with a message that invites people to use the TypeScript preprocessor:
TypeScript decorators are a runtime feature that requires your code to be preprocessed before Svelte compiles it. See https://svelte.dev/docs/... for information on how to set up the preprocessor.
Not 100% sure what this would mean for TypeScript inside markup (or TypeScript that uses these features in .svelte.ts files, for that matter).
Importance
nice to have
The text was updated successfully, but these errors were encountered:
Describe the problem
Svelte 5 supports TypeScript syntax natively, but it doesn't support TypeScript runtime features such as enums,
using
, decorators (related: #11397) and so on.In general, a good piece of advice is 'don't use these features, they are a bad idea'. TypeScript isn't Babel — in 2024 it should be used for adding types, nothing more. But since not everyone is aware of this distinction or inclined to follow this advice, we need some way of handling these cases.
Describe the proposed solution
The compiler should error when encountering these features with a message that invites people to use the TypeScript preprocessor:
Not 100% sure what this would mean for TypeScript inside markup (or TypeScript that uses these features in
.svelte.ts
files, for that matter).Importance
nice to have
The text was updated successfully, but these errors were encountered: