This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: share IPFS node between browser tabs #3081
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bug in aegir ipfs/aegir#587 causes race conditions
achingbrain
suggested changes
Jul 24, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work. Comments are inline but I think this is really close.
@@ -113,7 +113,7 @@ module.exports = (common, options) => { | |||
const cid = await ipfs.object.put(node1b) | |||
const node = await ipfs.object.get(cid) | |||
expect(node1b.Data).to.deep.equal(node.Data) | |||
expect(node1b.Links).to.deep.equal(node.Links) | |||
expect(node1b.Links).to.containSubset(node.Links) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3070 (comment)
Since the data over [message channel][] is copied via | ||
[structured cloning algorithm][] it may lead to suboptimal | ||
results (espacially with large binary data). In order to avoid unecessary | ||
copying server will transfer all the [Transferable][] which will be emptied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
copying server will transfer all the [Transferable][] which will be emptied | |
copying the server will transfer all passed [Transferable][]s which will be emptied |
Can you please:
|
achingbrain
approved these changes
Jul 27, 2020
SgtPooki
referenced
this pull request
in ipfs/js-kubo-rpc-client
Aug 18, 2022
This pull request adds 3 (sub)packages: 1. `ipfs-message-port-client` - Provides an API to an IPFS node over the [message channel][MessageChannel]. 2. `ipfs-message-port-server` - Provides an IPFS node over [message channel][MessageChannel]. 3. `ipfs-message-port-protocol` - Shared code between client / server mostly related to wire protocol encoding / decoding. Fixes #3022 [MessageChannel]:https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel Co-authored-by: Marcin Rataj <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
High level overview
This pull request adds 3 (sub)packages:
ipfs-message-port-client
- Provides an API to an IPFS node over the message channel.ipfs-message-port-server
- Provides an IPFS node over message channel.ipfs-message-port-protocol
- Shared code between client / server mostly related to wire protocol encoding / decoding.Status
I consider implementation mostly complete, with some caveats (see below). I think it is ready
ipfs.dag
API docs missmatch implementation. #3062 (comment))ipfs.object.*
that were falling out of scope.Uint8Array
support in dag-pb Backwards compatible pure data model API ipld/js-ipld-dag-pb#184Uint8Array
support in protons feat: support Uint8Array input in place of Buffer protons#13TextEncoder
from ipfs-utils Text encoder decoder js-ipfs-utils#44Uint8Array
support in dag-cbor Serialize Uint8Array as binary (like Buffer) ipld/js-ipld-dag-cbor#129Uint8Array
support in ipld-block feat: Aadd Uint8Array support ipld/js-ipld-block#53Structure clonable CID representation CIDs across the message channels multiformats/js-cid#109Fixes #3022