AlexGalays / abyssa-js

Framework agnostic hierarchical router for single page applications
MIT License
71 stars 9 forks source link

Vdom and Abyssa #35

Closed Swizz closed 7 years ago

Swizz commented 7 years ago

Hi,

When I was reading your Readme, this note raise on me a little question.

Note: With the emergence of VDOM approaches, using abyssa as a stateful router has less of an impact, as VDOM diffing/patching will usually take care of good enough performances. Also, a component based view library can handle hierarchical data loading and caching.

Is this saying that using Abyssa with Vdom solution is pretty useless ?

I am considering to use Abyssa in a Snabbdom + MostJS project as Router with state capabilities. But more in the way to freeze the current state of the route and bring back later when the route would be active once again.

Thank you for your answer.

Cheers,

AlexGalays commented 7 years ago

Hello,

Funny you should say that, I've stumbled upon this README piece a few days ago and wondered why I wrote that :D

I think I wrote it at a time when people thought shoving every single concern in components was a good idea (data fetching, enter/exit side effects, etc)

Nowadays, I do just like you're thinking of doing. I use abyssa to fetch the data and distribute it to the proper components.

Hope that clears things up, I will try to update that paragraph soon.

Swizz commented 7 years ago

Got it !

So, to be safe of that :

Is this consonant to your thoughts ?

I made a gist as proof of concept : https://gist.github.com/Swizz/205abc3d4472d673097f0cc674f5058f

AlexGalays commented 7 years ago

That looks fine!

Routing events can be made into a Stream as well if you wish.

Swizz commented 7 years ago

Thank you ! I will try to go deeper and deeper in Abyssa 🐋 🎉

Cheers,

AlexGalays commented 7 years ago

By the way, I don't know if you saw, but I also have a lib using snabbdom. There is an example on how to integrate it with abyssa too. And there are Observables, if you're a Stream fan :)

The lib uses stateful components, so a bit more like React than Elm/cycle.

Swizz commented 7 years ago

I am aware of that ;) I truly inspired my stuff of Kaiju. But I am working on my own implementation as personal starter kit.

Using : Abyssa, Mostjs and Snabbdom