Earlier quoted context omitted.
I don’t follow… in what sense is this JavaScript? Specifically, what is on:click? It doesn’t look like JavaScript, and it doesn’t look like the DOM. It looks like a new language which is specific to Svelte. Or what about this… is this JavaScript? $: doubled = count * 2; Or… {#if user.loggedIn} Log out {/if} Or… Click me I am willing to believe that all of that is ergonomic in some way, but it doesn’t appear to me at…
> I don’t follow… in what sense is this JavaScript? > it's not. it's html. incrementCount is a pointer to a javascript function. > Or what about this… is this JavaScript? > $: doubled = count * 2; Yes. $: is a javascript label. We use it to indicate that a function should be reactive - if the count variable changes, the right hand will be rerun and double updated. > Click me html again. the |once is a modifier to cli…
I think this is the crux of the gp's question. The browser doesn't support explicit behaviours for "on:click" or "|once" (the "$" label is a cool trick I'd forgive the gp for not recognising as native JS) - it may be "valid" HTML but it's not "just HTML" (nor just JS), it's a DSL.