4 ms·
This is a neat trick, but I'm more interested in the little remark about how Svelte uses the $: label https://svelte.dev/docs#3_$_marks_a_statement_as_reactive
by philo23 5y ago
This is a neat trick, but I'm more interested in the little remark about how Svelte uses the $: label
https://svelte.dev/docs#3_$_marks_a_statement_as_reactive https://svelte.dev/docs#3_$_marks_a_statement_as_reactive
Is Svelte doing something clever with these labels at runtime, or is it just using the label to do some kind of transformation when the javascript is compiled, anyone know?
- nicoburns 5y agoI believe it's parsing the JavaScript and doing a transformation. That's kind of svelte's USP: better ergonomics because it goes beyonds what's possible in standard JS.
- paco3346 5y agoTransformation is the name of the game with Svelte. None of the Svelte syntax is run at runtime because it's all compiled down to vanilla JS (and therefore ships with 0 runtime libraries).
- deleted 5y ago[deleted]