News for hackers. Stuff that matters.
Re:Preact : a smaller, faster React alternative by amelius on Monday August 21, 2017 @05:21AM (#15063120)
To all people who write React-alternatives: please modularize as much as possible. For example, JSX-like syntax is not necessary and some developers might not want to use it; therefore, it should be in a separate module that is completely optional. Also, the virtual-DOM part may be useful in itself, therefore it should also be a separate module. React offers some tools to more easily manage state, but please acknowledge that there are developers out there that have even smarter ways to deal with state.
Re:Preact : a smaller, faster React alternative by demarq on Monday August 21, 2017 @05:32AM (#15063162)
I disagree, and prefer monolithic frameworks than modular ones.

Catering for a common configuration of modules allows the maintainer and contributors to make more assumptions. These assumptions allow them greater freedom to optimize performance and simplify interfaces.

Lego like frameworks have to be uber generic thus catering to theoretical computer science aesthetics rather than real world practical use cases.

if a developer wants to stray from the "recommended" path, they should do so at their own cost. The community should not belabor themselves to accommodate outliers.

maintaining these projects is really hard work.

Re:Preact : a smaller, faster React alternative by git-pull on Monday August 21, 2017 @06:04AM (#15063318)
Echoing this. Some personal anecdotes:

Back in 2012, I remember when Backbone Marionette broke into pieces. It made "logical" sense, but the instances you'd actually want to pull in the event library without taking in Marionette is rare.

There's a certain sense you have to be tactical with decoupling stuff. I decouple front ends from libraries because I don't want my users to be forced to use my CLI front end when they just want an abstraction with minimal requirements.

I get away with it because there's 1 library and 1 frontend.

In JS, there's a front end, a library, and an extension marketplace that make you wonder what they were thinking when they were decoupled. Stuff like extract-text-webpack-plugin.

Guess what that plugin does: It allows you have your CSS show up as CSS files instead of JS. But the title denote that, (forget that fact you'd expect webpack to have such simple stuff in webpack itself.) It instead is "extracts text", despite the fact the convention of "text extraction" means nothing to web developers.

Re:Preact : a smaller, faster React alternative by skratlo on Monday August 21, 2017 @07:00AM (#15063573)
Can you prove that the demand for "monolithic frameworks" and that "the community" of such frameworks is bigger than what you call the "outliers"? Composing software from small reusable libraries can hardly be called "theoretical computer science aesthetics".
Re:Preact : a smaller, faster React alternative by chrisweekly on Monday August 21, 2017 @07:41AM (#15063789)
Here's where the distinction between "framework" and "library" is meaningful, yes? There are valid (and pragmatic) reasons to prefer one over the other.
Re:Preact : a smaller, faster React alternative by danpalmer on Monday August 21, 2017 @08:28AM (#15064039)
Agreed, I use Django for backend development and one of the main reasons is the consistent set of interfaces and architectural decisions, that all work well together.

I could probably get something faster or smarter with Flask + sqlalchemy, etc, but it's going to require much more thought and overhead on my part, and ultimately take longer to maintain.

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.
Re:Preact : a smaller, faster React alternative by rtpg on Monday August 21, 2017 @05:31AM (#15063160)
JSX is purely a transpiler thing, so you don't have any code in the final package to handle that aspect
Re:Preact : a smaller, faster React alternative by amelius on Monday August 21, 2017 @05:41AM (#15063209)
Yes, but why install it if you don't need it? From the perspective of the developer who might have to dig into the sources of his libraries, it is just clutter.
Re:Preact : a smaller, faster React alternative by tym0 on Monday August 21, 2017 @05:46AM (#15063235)
There is zero lines of code that relates to JSX, it all happens in webpack (or equivalent).