5 ms·
The React library requires no custom file types, and doesn't have templates. Just import the React package into your pure JS project, and get crackin'. Just lik
by a_wild_dandan 3y ago
The React library requires no custom file types, and doesn't have templates. Just import the React package into your pure JS project, and get crackin'. Just like jQuery.
JSX is an optional extension of JavaScript which adds a few syntactic sugar features, e.g. writing `<FooComponent ...` instead of `const FooComponent = () => createElement(...`. It's completely distinct from templates in Vue or Svelte. This is crucial, because templates are a bad idea. As Steven Wittens[1] put it:
> Many competing frameworks acted like this wasn't so, and stuck to the old practice of using templates. They missed the obvious lesson here: every templating language inevitably turns into a very poor programming language over time. It will grow to add conditionals, loops, scopes, macros, and other things that are much nicer in actual code. A templating language is mainly an inner platform effect. It targets a weird imagined archetype of someone who isn't allergic to code, but somehow isn't smart enough to work in a genuine programming language. In my experience, this archetype doesn't actually exist. Designers don't want to code at all, while coders want native expressiveness. It's just that simple.
[1] https://acko.net/blog/get-in-zoomer-we-re-saving-react/ https://acko.net/blog/get-in-zoomer-we-re-saving-react/
- FireInsight 3y agoWell, not everything works or needs to work like that. Astro is not unique in using templates and it is rather justified in using them being a sort of next-gen SSG.