Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dat support through dat-js would be nice. #10

Open
Gozala opened this issue Feb 19, 2019 · 6 comments
Open

Dat support through dat-js would be nice. #10

Gozala opened this issue Feb 19, 2019 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@Gozala
Copy link
Owner

Gozala commented Feb 19, 2019

I think there is some interesting opportunities to bridge protocols like ipfs, dat, ssb instead competing. The way things are designed to work it does not matter what protocol has being used to deliver app or publish to. In fact app can be coming from one and data from another. While things are already complicated & there are obvious risks in making it even more complicated I still thing there is a huge opportunity to find synergy across protocols that currently lacks.

@Gozala Gozala added the help wanted Extra attention is needed label Feb 19, 2019
@Gozala
Copy link
Owner Author

Gozala commented Feb 19, 2019

@RangerMauve I'd love your feedback

@Gozala Gozala mentioned this issue Feb 19, 2019
@RangerMauve
Copy link

This would be so awesome. 😍

dat-js seems to be in a good place right now with regards to support.
I haven't tried to get it to work inside a worker context yet and you might run into some trouble since it expects WebRTC to be present.
But I think I could do something about it if you'd like to pursue it further. 😉
At the very least it'll work with a WS gateway inside workers.

@RangerMauve
Copy link

I'll talk to the dat folks to see if this is something I can do as part of my grant. If I was, it'd be after I got something running with React Native.

@Gozala
Copy link
Owner Author

Gozala commented Feb 19, 2019

dat-js seems to be in a good place right now with regards to support.
I haven't tried to get it to work inside a worker context yet and you might run into some trouble since it expects WebRTC to be present.
But I think I could do something about it if you'd like to pursue it further. 😉
At the very least it'll work with a WS gateway inside workers.

I'm actually not sure if running inside workers would need to be a goal for Dat case. Unlike IPFS there is not much value in sharing a node because each dat is pretty isolated from other dats so it might be totally reasonable to use it in window context.

@RangerMauve
Copy link

Only reasoning I have is that you might want to share storage across contexts. But you're right it can totally work inside a window.

@Gozala
Copy link
Owner Author

Gozala commented Feb 19, 2019

Only reasoning I have is that you might want to share storage across contexts. But you're right it can totally work inside a window.

That is a good point, but I think that would be a case either way though. The way things are setup is proxy SW forwards all requests to an iframe (or window.top in a new setup) which is always the same document (URL is the same). In case of IPFS that document also happens to forward messages to SharedWorker so that all the connections etc is shared.

In case of Dat even without SharedWorker storage (assuming indexedb) will be still shared due to same origin. However not the connections (which is unfortunate if you have say multiple tabs for the same thing), however storage will likely be shared, assuming indexedDB is used. With some effort likely web sockets connections could also probably move to SharedWorker but that's definitely an optimization that not worth making unless this proves to be useful in first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants