News for hackers. Stuff that matters.
Re:How we built Hydrogen, a React framework for building cus... by civilitty on Friday June 24, 2022 @05:45PM (#31869815)
> JSX is 1,000% magic syntax, and anyone telling you otherwise is trying to sell you something.

> It looks, feels, and acts wrong in ways that Svelte or Vue templates (and most other templating systems) don’t, to me.

My biggest example of this (and it drives me crazy) is when mixing Typescript generics in TSX files: you often have to do ridiculous boilerplate like `<T extends any>` because otherwise `<T>` would be recognized as JSX and blow up the syntax tree. Hoorah for the context-sensitive grammar.

Typescript is what "No magic syntax" looks like: all it takes to get usable javascript is to parse the TS AST, remove the TS specific nodes, and serialize the tree back to text. There are a few exceptions like enums but they're not core features and you can go your entire career without needing them. Meanwhile the JSX ecosystem is full of crap like emotion and styled-components that need babel plugins to support features like component selectors. SMH

Re:How we built Hydrogen, a React framework for building cus... by j-krieger on Friday July 01, 2022 @07:15PM (#31954270)
You are mistaken. This is a fault on TypeScript. Using angle brackets for generics has been a mistake in an environment where XML is used.