Closed nichoth closed 7 years ago
I would like to know, too.
@nichoth & @sotayamashita
I was building a web client for a project at work. My first choice was React+Redux, since that's what we already use, but I wanted something more lightweight and without the frameworkyness of React.
I made the first prototype using Elm, which I really like, but it was too difficult to integrate with 3rd party components, e.g. CodeMirror.
yo-yo is an abstraction on top of bel and morphodom (which mutates DOM nodes directly) whereas I preferred a virtual DOM approach like Snabbdom.
There's choo too, an abstraction on top of yo-yo with a much nicer API.
~1kb. It's almost vanilla. No deps, other than Hyperx (itself no deps) which is how we write HTML using JavaScript, but without breaking JavaScript. You can still use JSX if you want.
Hyperapp has Elm-like state management, a router and a tiny virtual dom implementation with SVG support, inline CSS, boolean HTML props and create, update and remove events for DOM nodes.
Integrating 3rd party components with Hyperapp is easy too. See this example with CodeMirror.
Let's see a input box + heading example.
Thanks for the awesome explanation @jorgebucaran. Did you end up using this library for your work project? How has that been? Do you have plans for the future direction of this repo?
I agree with your points, that's basically where I'm at too. yoyo and choo I think are very cool experiments, but some of the design decisions have created some extra complexity. The namespace/state pattern, and direct dom mutation have made some things difficult (not to say that I've made something nicer). Though also choo has grown a lot, which may have added more to the scope.
Can you elaborate on the use of MutationObserver and code smell?
hey @jorgebucaran I know you from snabbdom
:)
I'm amazed by the simplicity of the code, I really like it.
Some comments/questions in my head right now:
(1) are you planning to add tests to the library? I wouldn't feel comfortable using it in production without…
(2) since this is somewhat similar to choo
(I could recognize it before reading here) it'd be lovely if you included the above explanation in the README
(3) the only thing I would miss are "hooks" for elements (like in snabbdom
), (correct me if I'm wrong)
Yes I was thinking the same things @acstll :). Very nice experiment in finding the most minimal implementation of the elm pattern, and the code is so simple. Was also wondering about what tests would look like.
/cc @nichoth @acstll
Bonus: The virtual DOM approach is faster in most benchmarks compared to morphodom.
A lot has changed since you opened this issue @nichoth 👋.
The core values of the project still remain to be a small (or the smallest) JavaScript frontend framework that is useful out of the box and implements a sane subset of the Elm Architecture, supports Hyperx, JSX and it's easy to learn.
Hi. Cool repo. I was wondering if you have goals for the project and how they might differ from existing libraries (there are so many). For example,
choo
comes to mind as having a similar elm-like design.