I can understand that this syntax is not a preference for JavaScript/TypeScript developers who opt to JSX and want to write everything (logic, layout, styling) in JavaScript.
<p :if="desc">{ desc }</h3>
That </h3> should be a </p>, I think.Using print statements or deleting code in a binary-search manner takes an order of magnitude more time and imo is just an excuse to pad billable hours.
https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelEl...
I'm not sure that the compilation aspect is relevant - pretty much all modern frameworks using a template language have a compilation step. ngFor doesn't exist in the browser after all! ;)
The goals of this project and Svelte seem very similar, so I'd be interested to see a more in-depth comparison.
Its name should always start with `use` so that you can tell at a glance that the rules of Hooks apply to it.
And it is required and enforced if you use the ESLint react-hooks plugin (which I'm guessing most large projects do).
I just looked at some Svelte examples and it's a mix of magic keywords (on, bind) with magic symbols (: | @) and new, completely unrelated syntax to both JS and HTML (#each, #if, :else). I guess it looks way more idiomatic if you have an IDE that highlights and lints it correctly. React with its few rules of hooks seems way closer to vanilla JS.
``` <div @name="media-object" class="{ type }"> <img src="{ img }"> <aside> <h3>{ title }</h3> <p :if="desc">{ desc }</h3> <slot/> </aside> </div>
<div class="art-gallery"> <media-object :for="item in items" :bind="item"/> </div ```
I really don't like the opinionated, magical/weird syntax (like vue's :@v-for-OnClick="fn()"), I prefer how close and true to vanilla html/js react is, rather than stuff like this.