Live data from Hacker News

Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

github.com

1–10 of 20 posts

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#3
The idea of React is good - declarative, stateful, reusable components, etc. While the bloat of React and it's toolchain (and npm plugins) has become a mess. When you have 2^100 different plugin combos to do something, you have 2^100 imperfect solutions and no experts in any of them, rather than one elegant and simple standard that can be optimized.

This repo is great proof that React is over engineered. Vanilla JS has WebComponents[1] and Templates, and a vDOM is easy to support (it existed long before React) and the DOM was the original place to store state in custom properties that you could manipulate internally with 'this'. What's missing is the ecosystem of Reusable WebComponents (primatives) based around this simple approach.

That's why this is so great to see. As more of a purist, I would try to make this a Vanilla JS lib instead of TS and remove one more build step. But the idea of 60 lines of code that use primatives (thus making this hyper extendable) is perfect.

[1] https://developer.mozilla.org/en-US/docs/Web/Web_Components

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#4
post #3

The idea of React is good - declarative, stateful, reusable components, etc. While the bloat of React and it's toolchain (and npm plugins) has become a mess. When you have 2^100 different plugin combos to do something, you have 2^100 imperfect solutions and no experts in any of them, rather than one elegant and simple standard that can be optimized. This repo is great proof that React is over engineered. Vanilla JS h…

This was exactly my thinking when I wrote ElemX[1]. It has more a VueJS feel with template bindings, but it is based entirely on WebComponents and there are essentially no "tricks" (although it does use MobX for observables/computeds). It's a super small library but easily extendable with custom bindings.

[1] https://github.com/agquick/elemx.js

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#7
post #5
post #2

The wheels on the bus go round and round To the author: check out Mercury (2014), Hyperapp (2017), Choo (2018)

Inferno... Preact... the list goes on and on.

htm and vhtml from @developit.

https://github.com/developit/htm

https://github.com/developit/vhtml

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#8
post #3

The idea of React is good - declarative, stateful, reusable components, etc. While the bloat of React and it's toolchain (and npm plugins) has become a mess. When you have 2^100 different plugin combos to do something, you have 2^100 imperfect solutions and no experts in any of them, rather than one elegant and simple standard that can be optimized. This repo is great proof that React is over engineered. Vanilla JS h…

These are react's dependencies:

https://www.npmjs.com/package/react

This repo is proof of nothing and I'm tired of reading those knee-jerk takes. You can't say "react's toolchain is a mess" and "prove" it with a repo that has zero toolchain, no JSX, etc. It's a bit saying "vlc is so bloated!" to someone showcasing "a video player in 30 lines of QML" with no play/pause button.

Not to detract from the rest of your post, the core concept and primitives are great. Would you like them served up in a NPM micro-dependency, maybe? You'll just … add JSX, babel etc separately, will be missing half of react's features like hooks etc and will still have as many dev dependencies as before.

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#9
post #3

The idea of React is good - declarative, stateful, reusable components, etc. While the bloat of React and it's toolchain (and npm plugins) has become a mess. When you have 2^100 different plugin combos to do something, you have 2^100 imperfect solutions and no experts in any of them, rather than one elegant and simple standard that can be optimized. This repo is great proof that React is over engineered. Vanilla JS h…

If you use Create React App[1] then you don't have to think about the toolchain.

I do sometimes wonder what the people complaining about npm packages and the React ecosystem/build process are developing? It would be interesting to hear. I've shipped complex web applications built using Create React App without needing to "eject", and without installing dozens of packages from npm.

[1] https://create-react-app.dev

Re: Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript

#10
post #3

The idea of React is good - declarative, stateful, reusable components, etc. While the bloat of React and it's toolchain (and npm plugins) has become a mess. When you have 2^100 different plugin combos to do something, you have 2^100 imperfect solutions and no experts in any of them, rather than one elegant and simple standard that can be optimized. This repo is great proof that React is over engineered. Vanilla JS h…

I think this is wrong. I think if it shows anything, it’s that in the real world, you have to address exceptional cases rather than ignore them.
Post reply on HN