News for hackers. Stuff that matters.
Re:Svelte 5: Runes by mbStavola on Wednesday September 20, 2023 @11:04AM (#37585114)
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)!`;
Re:Svelte 5: Runes by rich_harris on Wednesday September 20, 2023 @11:37AM (#37585555)
Having a great experience with TypeScript was very much one of our goals. Many design ideas failed to clear this hurdle
Re:Svelte 5: Runes by aradalvand on Wednesday September 20, 2023 @06:19PM (#37590930)
That specific TS issue has literally been fixed for ages. What version of Svelte were you on?!