4 ms·
As a recent adopter of Svelte, these changes are intriguing but I don't really have a grasp of how I feel about it quite yet. One thing that I am definitely ha
by mbStavola 3y ago
As a recent adopter of Svelte, these changes are intriguing but I don't really have a grasp of how I feel about it quite yet.
One thing that I am definitely happy to see is the removal of $: as it should help Typescript users. Personally, I was quite sick of writing:
let input = 'Hello';
// ...
let loudInput: string;
$: loudInput = `${input)!`;
Instead of:
let input = 'Hello';
// ...
$: loudInput: string = `${input)!`;
It's an incredibly minor thing, but when you do it 1000 times it becomes very frustrating. Having reactivity be rune-based should help TS avoid the syntactic confusion, bringing us to:
let input = $state('hello');
// ...
let loudInput: string = `${input)!`;
- rich_harris 3y agoHaving a great experience with TypeScript was very much one of our goals. Many design ideas failed to clear this hurdle
- aradalvand 3y agoThat specific TS issue has literally been fixed for ages. What version of Svelte were you on?!