-
Notifications
You must be signed in to change notification settings - Fork 20
Migrate to a pure Data Model API #173
Comments
Aside from the breaking changes to IPFS, I would say "yes please" to this proposal! Already most consumers of this module need to handle the 'Node' special-case to do the right thing, so it would be really nice to shed some of that cognitive overhead. We're already using the Block API in our internal (Textile) work, so less of a 'breaking' issue and more of a 'fixing' thing for us TBH. |
@mikeal can you clarify what's backwards incompatible about this change ? Talking to @rvagg I'm under impression that that this can be in fact backwards compatible change. As I understand it it's merely treating anything shaped as {
Data?: Uint8Array,
Links?: Array<{ Hash: Uint8Array, Name?:string, Tsize?: number }>
} If that is indeed the case, most of the utils already work under than assumption. So it would be just matter of making corresponding getters an actual fields. That way If that is indeed this is all about, I'm happy to take it as that would unblock my work described in ipld/js-ipld#283 |
As a side note I've just noticed that this implementation does seem to expect |
+1, all of our newest code is trying to be |
^ I'd be fine with both of those things if you want to take it on and maintain backward compatibility. I'm a tiny bit concerned about the performance overhead of handling duck-typed |
You may run into problems trying to switch from It’s a substantial breaking change to move to a new binary representation. IMO, it would be better to just wait until you can take the new It’s also worth noting that if the binary type being returned from the top level API changes, that’s a breaking change in |
I'm +1 on switching away from We're coming to the end of an endeavour to replace the global node Buffer polyfill with the buffer module across our stack as webpack is going to stop including the polyfill in a future release, so we've got a rough handle on how big a task it would be. Big, is the answer, there are a lot of modules to change: ipfs/js-ipfs#2924 |
I have made changes to this library that
I also went ahead and wrote a patch for js-ipfs ipfs/js-ipfs#3070 to verify that these changes do not introduce regressions. Finally I have incorporated these changes into my work on ipfs-message-port-* libraries and I'm glad to report that many tests are starting to pass (need to verify but I think some encountering different problems) without giving dag-pb any special treatment and despite the fact that nodes passed over message channel get their This give me some confidence in claiming that:
There for I would like to make case for landing #184. Once it makes it's way to NPM I'll update ipfs/js-ipfs#3070 to swap dag-pb dependencies to point to released version instead of my forks. |
Fixed by #184 |
I accidentally yak shaved my way to a new dag-pb implementation @ https://github.com/ipld/js-dag-pb, for use with the new |
This would be a breaking change.
I’d like to use the new IPLD Schema for
dag-pb
for this codec.This would be a major API break, but we probably need to do it because it would:
Node
instancesdag-pb
However, this would be a pretty big break for
js-ipfs
. We’d want to time this along with a larger migration to theBlock
API./cc @achingbrain @vmx @alanshaw @carsonfarmer
The text was updated successfully, but these errors were encountered: