okdistribute / hyperdrive-ui

Render a hyperdrive in the browser.
http://karissa.github.io/hyperdrive-ui/
40 stars 4 forks source link

Alternative api #48

Closed juliangruber closed 8 years ago

juliangruber commented 8 years ago

So I've been thinking about this a little, and yo-yo doesn't really have a concept of 1st class widgets (yet). So that means a widget function should only take state and return DOM, nothing else. If a widget starts performing asynchronous operations internally, there will need to be something to manage its lifetime, not always fully recreating it, etc.

This way we don't have those problems and it works...For now at least. In the future I can see problems arising where it does make a lot more sense for a widget to manage its persistent internal state itself, because otherwise would be too complicated.

this fixes https://github.com/juliangruber/dat-desktop/issues/16

implemented in dat-desktop here: https://github.com/juliangruber/dat-desktop/commit/030c3fb06f8e86a56f736518e54b2acaef79bd0d

cc @maxogden @mafintosh

okdistribute commented 8 years ago

does the explorer still need archive anymore if its just passing in entries? and does this just becomes a generic folder browser then if it only takes entries? Since we are iterating through the archive.list() outside of this module, each entry could have a readFileStream object that gets passed and yo-fs could handle rendering it.

laurengarcia commented 8 years ago

@juliangruber heads up i notice that you added bundle.js to .gitignore (which i also did) but apparently github pages needs it.

juliangruber commented 8 years ago

does the explorer still need archive anymore if its just passing in entries?

oh, i thought it was checking owner stuff as well...maybe that was in a different branch? it's currently only accessing archive.createFileReadStream(entry).

and does this just becomes a generic folder browser then if it only takes entries? Since we are iterating through the archive.list() outside of this module, each entry could have a readFileStream object that gets passed and yo-fs could handle rendering it.

I guess then it's only adding multi directory support to yo-fs, isn't that right?

I think it should still be coupled to hyperdrive, for showing more stuff like download stats etc.

juliangruber commented 8 years ago

@juliangruber heads up i notice that you added bundle.js to .gitignore (which i also did) but apparently github pages needs it.

gotcha, i'll undo that

okdistribute commented 8 years ago

I pushed down some of the logic that was file specific into yo-fs@3.0.0 after help from @maxogden . still haven't tested it in dat-desktop

okdistribute commented 8 years ago

sorry, yo-fs@2.0.1