Hacker News new | ask | show | jobs
by guscost 3291 days ago
Ah yeah I think, I read a bit more and the idea of using pure functions to generate the mostly-JSON spec is actually really neat. But how can you handle many events and complex custom side-effects without adding bigger and bigger functions to the mix? And then DOM elements will need a way to communicate with the other elements and share data. I suppose you could always add a message bus architecture like Redux or whatever, but [oh yeah I forgot I made this flux module thing for ES5! https://github.com/guscost/simple-flux/blob/master/sf.js]
1 comments

Yes, cell itself has a decentralized architecture but that doesn't mean you need to do everything in a decentralized manner.

Just like you can build spaceships, police station, cars, and all kinds of complex things using lego blocks, you can build complex architecture using the simple building block that is cell.

I myself have been experimenting with different approaches of structuring apps using cell, and there are really a lot of different ways since we become free from having to inherit classes and instantiate objects from them. I don't want to be constraining about how one uses cell so I don't talk much about what a "best practice" is (yet)

But maybe sooner or later people can share some nice approaches for structuring "traditional apps" using cell

> Just like you can build spaceships, police station, cars, and all kinds of complex things using lego blocks, you can build complex architecture using the simple building block that is cell

Except you cannot have a hierarchy of cells without the top level cell having responsibility of the whole world below in its own scope: that doesn't scale well and limits complexity to maybe a couple of levels.

I think a message bus plus a bunch of autonomous mini-DOM element trees could be pretty cool. It might lead you to flatten the DOM too much for big apps though, not sure.

EDIT: Whoops, it's pretty trivial to nest components and describe a tree of HTML.