News for hackers. Stuff that matters.
Re:Learn React by building a web app by babaganoosh89 on Tuesday April 10, 2018 @03:28PM (#16804377)
Probably next big thing will be straight web components or UI libraries like react or angular converting to web components. So everything should be nicely interoperable in the future, it'd just be a matter of how your modeling your data.
Re:Learn React by building a web app by mlsarecmg on Wednesday April 11, 2018 @03:00AM (#16808710)
Web components are a regression, though. There's nothing in the slightest that would make interop possible. They just wrap a shadow root, and within you are greeted with a naked dom again, which calls for a framework to drive it.

Imagine for every 10 components you pull you'd load 10 separate frameworks - unless they all come from the same source. These "components" wouldn't be able to know one another or work together at all. The only thing web components are good for are encapsulated styles, but that hasn't been a problem for many years now.

Since they've come up with the idea the web has moved on. React has progressed to such an extent that javascript has effectively left the browser, drives full-native applications, renders on the server, makes interop possible that no piece of technology has been able to pull off before, where you can share code and semantics on pretty much every platform while being able to re-use eco system components: https://news.ycombinator.com/item?id=16198843 and https://github.com/gaearon/react-blessed-hot-motion

Throwing all this away, we'd be back in a browser-tied web driven by dumb-components, and for no reason at all.

Re:Learn React by building a web app by RobertRoberts on Tuesday April 10, 2018 @05:46PM (#16805802)
I agree, the libraries will get lighter, just like jQuery has been doing for some time. I tried Vue again recently, and it was a 30 second copy/paste and it just worked instantly. 2 minutes later I had an example working inline with a project I am working on. (how long does it take to build your first React app?)

Web components are the dream of sharing code widely across many different systems, just like HTML, CSS and JS do. This is why it will beat React in the long term, wrapped in a lighter weight set of frameworks.

Just the other day there was an article discussing how the virtual dom could be improved with a static dom, and then only partially updated at the edges, something React isn't even designed to do. (ie, it does a complete diff of the dom and manages the entire view, correct me if I am wrong here)

Finally, if performance is your game, browser optimized code, whether it's web assembly or simple improvements to components, it will always beat a virtualized layer on top of it. Again, React will lose on this point too.

The question is, how long will it take before there truly is something better widely available? Or is it here already and we can't see it's value yet?

Re:Learn React by building a web app by tropshop on Tuesday April 10, 2018 @05:59PM (#16805922)
I recently found https://svelte.technology and looking forward to trying it out. It has no run-time like React or any other virtual DOM engine, but instead does compile-time static analysis.

It is a Rich Harris project (authored Rollup, Ractive, Bublé) so might be worth paying attention to.

Re:Learn React by building a web app by murukesh_s on Tuesday April 10, 2018 @06:19PM (#16806083)
Ractive was a neat little library which was under appreciated. React took over the world with all the immutable - one way binding and virtual Dom thing.. otherwise ractive was far lighter and better than Angular
Re:Learn React by building a web app by egeozcan on Wednesday April 11, 2018 @03:32AM (#16808844)
I still use Ractive in some of my side projects. The API is simply brilliant.
Re:Learn React by building a web app by TomMarius on Tuesday April 10, 2018 @03:43PM (#16804548)
I personally think that it will be React(-like), but in Rust, using Wasm.
Re:Learn React by building a web app by veeti on Tuesday April 10, 2018 @03:48PM (#16804602)