News for hackers. Stuff that matters.
Re:Crank.js – Write JSX-driven components with functions, pr... by thebradbain on Friday April 17, 2020 @11:10PM (#22905040)
Fully on board with this newer trend (Svelte also comes to mind) of using only native JavaScript language features to accomplish what other frameworks do using abstractions. It seems like the natural next step as JS matures, as it’s my opinion that old frameworks that made up for JS’s shortcomings by abstracting them away and designing around the language’s limitations are intrinsically unable to natively and sensibly integrate new native language constructs after the fact without somehow changing the core framework itself (e.g. Suspense to integrate async/await in React).

Angular and Ember eventually gave way to Vue and React once dealing with the framework over the language became too cumbersome, and I would imagine Vue and React will eventually give way to “lighter” frameworks once they too become too bloated.

Re:Crank.js – Write JSX-driven components with functions, pr... by Vinnl on Saturday April 18, 2020 @10:24AM (#22907957)
> Fully on board with this newer trend (Svelte also comes to mind) of using only native JavaScript language features to accomplish what other frameworks do using abstractions.

Really weird to ascribe that to Svelte, given that it has its own compiler that introduces non-Javascript syntax...

Re:Crank.js – Write JSX-driven components with functions, pr... by thebradbain on Saturday April 18, 2020 @01:17PM (#22909224)
You’re right it’s not a pure example, but this quote from its website is what makes me differentiate from React/Vue:

> So we took a step back and asked ourselves what kind of API would work for us... and realised that the best API is no API at all. We can just use the language. Updating some count value — and all the things that depend on it — should be as simple as `count += 1` over `count.setState(count + 1)`

Re:Crank.js – Write JSX-driven components with functions, pr... by rajeev-k on Friday April 17, 2020 @11:49PM (#22905176)
I would like to demo a simpler alternative to Vue and React: manipulate DOM directly. I do it in this application:

https://github.com/Rajeev-K/eureka

I find myself more productive coding directly against DOM APIs, using these tiny libs:

MVC router (500 lines): https://github.com/Rajeev-K/mvc-router/

JSX templating (200 lines): https://github.com/wisercoder/uibuilder

Re:Crank.js – Write JSX-driven components with functions, pr... by NetOpWibby on Saturday April 18, 2020 @03:57AM (#22906078)
I’ve been passively looking for a better way to build the homepage for ChronVer and these links are right up my alley.

Thanks!

Re:Crank.js – Write JSX-driven components with functions, pr... by petilon on Friday April 17, 2020 @11:40PM (#22905147)
Agree. React started out simple, but now is over-complicated. Here's another tiny lib to use JSX in a native JavaScript application.

https://github.com/wisercoder/uibuilder

Uibuilder is "close to the metal", so there is no heavy library--especially one that completely changes the programming model of the web--sitting between your code and the browser

Re:Crank.js – Write JSX-driven components with functions, pr... by balls187 on Saturday April 18, 2020 @12:13AM (#22905266)
Can you elaborate on what makes React over-complicated?
Re:Crank.js – Write JSX-driven components with functions, pr... by steve_adams_86 on Saturday April 18, 2020 @01:14AM (#22905486)
In a way I feel it has become less complicated. I can do so much with hooks so easily using a dead simple API, for example. I write less code now than I ever did with react.

Admittedly, react now comes with that API and the previous ways of doing things, and that could be seen as over complication.

Re:Crank.js – Write JSX-driven components with functions, pr... by WiseWeasel on Friday April 17, 2020 @11:14PM (#22905060)
How are React and Vue grouped together in that regard? More specifically, how is Vue less of a framework abstraction than Ember or Angular?
Re:Crank.js – Write JSX-driven components with functions, pr... by thebradbain on Saturday April 18, 2020 @01:12PM (#22909179)
If I remember correctly, React and Vue started off as more view-layers than anything else, and popularized the idea of 1-way, isolated components. Angular and Ember had always been all-in-one-heavy frameworks with 2-way bindings by default, and “partials” similar to components but state was intrinsically shared in a MVC paradigm.
Re:Crank.js – Write JSX-driven components with functions, pr... by pier25 on Saturday April 18, 2020 @01:13PM (#22909193)
Vue in itself is just like React, a rendering library with reactivity.

Vue also provides official batteries like Vuex and VueRouter but you do not really need those to use Vue.

Re:Crank.js – Write JSX-driven components with functions, pr... by pjmlp on Saturday April 18, 2020 @02:58AM (#22905862)
From my enterprise seat, Angular is pretty much everywhere, including greenfield projects.
Re:Crank.js – Write JSX-driven components with functions, pr... by mpfundstein on Saturday April 18, 2020 @01:46PM (#22909519)
One more reason to stay away from enterprise seats..