News for hackers. Stuff that matters.
Re:Preact : a smaller, faster React alternative by awjr on Monday August 21, 2017 @05:52AM (#15063266)
I'm sorry, why would you be using React etc unless you wanted virtual DOM and JSX. Much of why I like React is precisely because it has those features. This really makes no sense to me.
Re:Preact : a smaller, faster React alternative by mateuszf on Monday August 21, 2017 @06:09AM (#15063344)
You can use React and virtual dom without JSX. Not that it's pleasant though.
Re:Preact : a smaller, faster React alternative by masklinn on Monday August 21, 2017 @06:42AM (#15063503)
> Not that it's pleasant though.

"Raw" react is perfectly OK, and react + hyperscript[0] is great.

[0] https://github.com/mlmorg/react-hyperscript

Re:Preact : a smaller, faster React alternative by yomly on Monday August 21, 2017 @06:25AM (#15063411)
I definitely preferred Mithril's m('div') over JSX <div></div>. The closing tags are overly verbose for me.
Re:Preact : a smaller, faster React alternative by mekkkkkk on Monday August 21, 2017 @07:52AM (#15063845)
As soon as the markup reaches a certain level, the verbosity (closing tags in particular) of JSX benefits you more than the terseness of hyperscript. Of course you can argue that you should split your components into smaller chunks, but that is, in my experience, rarely good just for the sake of readability.
Re:Preact : a smaller, faster React alternative by masklinn on Monday August 21, 2017 @06:43AM (#15063507)
FWIW the hyperscript helper is generally h rather than m, and there's a hyperscript helper available for react with the expected semantics[0]: https://github.com/mlmorg/react-hyperscript

[0] in the sense that it supports normal hyperscript semantics and replacing the selector with a React component

Re:Preact : a smaller, faster React alternative by brlewis on Monday August 21, 2017 @09:34AM (#15064447)
My group tried Mithril both with and without JSX. With JSX was more readable for the code we were writing.