3 ms·
> What about Svelte? Svelte apps aren't written in JS but in Svelte's own component syntax files. It's "HTML" but all the parts are extended (JS -> reactive, H
by grayrest 5y ago
> What about Svelte?
Svelte apps aren't written in JS but in Svelte's own component syntax files. It's "HTML" but all the parts are extended (JS -> reactive, HTML -> directives, CSS -> scoping) and it needs its own compiler to transform the source to something everything else understands.
- akvadrako 5y agoThat's also true of JSX. The default output of both compilers is just a javascript module.
- lf-non 5y agoYes, but JSX is much more conservative in what it introduces to the language. Other than the XML syntax rest of js is mostly left untouched. In a svelte file, a lot of usual js constructs like labels, additions, assignments etc. have different semantics making it more work for another language to support it.