-
Notifications
You must be signed in to change notification settings - Fork 20
BREAKING CHANGE: Remove .cid, .multihash and .serialized properties #99
Conversation
First quick comment (as gatekeeper of good/correct commit messages). This won't pass commit lint. According to our style it would be:
|
2d85ba9
to
64a0f21
Compare
It would be nice if we could discover these things before CI gets involved. I'd added commit linting to aegir, but you can only lint commits once they've been committed (I think), so it had to be part of a pre-push hook, which we removed from all of our repos a little while back. 🤷♂️ |
This repo (and all other IPLD repos) still have a pre-push hook :) |
Cool, well you can add |
We are way off topic. |
@achingbrain Is it OK if I wait for a merge until the new js-ipfs release is out? I think this change has a lot of implications (probably just as many as the dag-cbor change had). |
@vmx yes, please wait and do other releases in the meantime - if for nothing else other than I'm getting PRs ready for unixfs and mfs that will fix the breakage this will cause. |
Codecov Report
@@ Coverage Diff @@
## master #99 +/- ##
==========================================
+ Coverage 90.28% 91.35% +1.06%
==========================================
Files 13 13
Lines 278 266 -12
==========================================
- Hits 251 243 -8
+ Misses 27 23 -4
Continue to review full report at Codecov.
|
How about removing the |
This does make calculating the return values from Is that information actually useful to anyone though? I remember my surprise when the size returned from |
40fea4f
to
2e901bb
Compare
I'm going to back out the removal of |
I've opened ipfs-inactive/interface-js-ipfs-core#387 to talk about the |
@achingbrain ack on ipfs-inactive/interface-js-ipfs-core#387. Do you plan to block this PR on that issue? I recommend that we make that change as separate. |
@diasdavid - I agree, that issue should not block this PR, we can make the change later once we've got consensus on whether to make the API change or not. |
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also removes use of js-ipfs from this module breaking another circular dependency from the project.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also removes use of js-ipfs from this module breaking another circular dependency from the project.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also fixes #24 by removing use of js-ipfs from this module breaking another circular dependency from the project. License: MIT Signed-off-by: achingbrain <alex@achingbrain.net>
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also fixes #24 by removing use of js-ipfs from this module breaking another circular dependency from the project. License: MIT Signed-off-by: achingbrain <alex@achingbrain.net>
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also fixes #24 by removing use of js-ipfs from this module breaking another circular dependency from the project. License: MIT Signed-off-by: achingbrain <alex@achingbrain.net>
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also fixes #24 by removing use of js-ipfs from this module breaking another circular dependency from the project. License: MIT Signed-off-by: achingbrain <alex@achingbrain.net>
…operties BREAKING CHANGE: DAGNodes no longer have `.cid` or `.multihash` properties - see ipld/js-ipld-dag-pb#99 for more and and #173 for the performance win. Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Fixes the tests which could use a closer look at, for example they overwrite the value of `node3` twice.
BREAKING CHANGE: DAGNodes no longer have `.cid` or `.multihash` properties - see ipld/js-ipld-dag-pb#99 for more and and #173 for the performance win. Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Fixes the tests which could use a closer look at, for example they overwrite the value of `node3` twice.
BREAKING CHANGE: DAGNodes no longer have `.cid` or `.multihash` properties - see ipld/js-ipld-dag-pb#99 for more and and #173 for the performance win. Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Fixes the tests which could use a closer look at, for example they overwrite the value of `node3` twice.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also removes use of js-ipfs from this module breaking another circular dependency from the project.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also removes use of js-ipfs from this module breaking another circular dependency from the project.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also removes use of js-ipfs from this module breaking another circular dependency from the project.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs. Bonus: also fixes #24 by removing use of js-ipfs from this module breaking another circular dependency from the project. License: MIT Signed-off-by: achingbrain <alex@achingbrain.net>
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Just having a slight wobble about removing the `.multihash` property from the DAGLink class as part of #99. It's the right thing to do but it will cause a lot of disruption.
Just having a slight wobble about removing the `.multihash` property from the DAGLink class as part of #99. It's the right thing to do but it will cause a lot of disruption.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
BREAKING CHANGE: Object API refactor. Object API methods that write DAG nodes now return a CID instead of a DAG node. Affected methods: * `ipfs.object.new` * `ipfs.object.patch.addLink` * `ipfs.object.patch.appendData` * `ipfs.object.patch.rmLink` * `ipfs.object.patch.setData` * `ipfs.object.put` Example: ```js // Before const dagNode = await ipfs.object.new() ``` ```js // After const cid = await ipfs.object.new() // now returns a CID const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created ``` IMPORTANT: `DAGNode` instances, which are part of the IPLD dag-pb format have been refactored. These instances no longer have `multihash`, `cid` or `serialized` properties. This effects the following API methods that return these types of objects: * `ipfs.object.get` * `ipfs.dag.get` See ipld/js-ipld-dag-pb#99 for more information. License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
For the back story on this change, please see: ipfs-inactive/interface-js-ipfs-core#388 (review) BREAKING CHANGE: Object API refactor. Object API methods that write DAG nodes now return a [CID](https://www.npmjs.com/package/cids) instead of a DAG node. Affected methods: * `ipfs.object.new` * `ipfs.object.patch.addLink` * `ipfs.object.patch.appendData` * `ipfs.object.patch.rmLink` * `ipfs.object.patch.setData` * `ipfs.object.put` Example: ```js // Before const dagNode = await ipfs.object.new() ``` ```js // After const cid = await ipfs.object.new() // now returns a CID const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created ``` IMPORTANT: `DAGNode` instances, which are part of the IPLD dag-pb format have been refactored. These instances no longer have `multihash`, `cid` or `serialized` properties. This effects the following API methods that return these types of objects: * `ipfs.object.get` * `ipfs.dag.get` See ipld/js-ipld-dag-pb#99 for more information. License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
BREAKING CHANGE: Object API refactor. Object API methods that write DAG nodes now return a CID instead of a DAG node. Affected methods: * `ipfs.object.new` * `ipfs.object.patch.addLink` * `ipfs.object.patch.appendData` * `ipfs.object.patch.rmLink` * `ipfs.object.patch.setData` * `ipfs.object.put` Example: ```js // Before const dagNode = await ipfs.object.new() ``` ```js // After const cid = await ipfs.object.new() // now returns a CID const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created ``` IMPORTANT: `DAGNode` instances, which are part of the IPLD dag-pb format have been refactored. These instances no longer have `multihash`, `cid` or `serialized` properties. This effects the following API methods that return these types of objects: * `ipfs.object.get` * `ipfs.dag.get` See ipld/js-ipld-dag-pb#99 for more information. License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
For the back story on this change, please see: ipfs-inactive/interface-js-ipfs-core#388 (review) BREAKING CHANGE: Object API refactor. Object API methods that write DAG nodes now return a [CID](https://www.npmjs.com/package/cids) instead of a DAG node. Affected methods: * `ipfs.object.new` * `ipfs.object.patch.addLink` * `ipfs.object.patch.appendData` * `ipfs.object.patch.rmLink` * `ipfs.object.patch.setData` * `ipfs.object.put` Example: ```js // Before const dagNode = await ipfs.object.new() ``` ```js // After const cid = await ipfs.object.new() // now returns a CID const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created ``` IMPORTANT: `DAGNode` instances, which are part of the IPLD dag-pb format have been refactored. These instances no longer have `multihash`, `cid` or `serialized` properties. This effects the following API methods that return these types of objects: * `ipfs.object.get` * `ipfs.dag.get` See ipld/js-ipld-dag-pb#99 for more information. License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Follows on from ipld/js-ipld-dag-pb#99 and updates this module to not rely on DAGNodes having knowledge of their CIDs.
Follows on from ipld/js-ipld#173 (comment)
These properties are removed from the DAGNode class.
.multihash
is removed because they aren't multihashes any more.cid
is removed to bring dag-pb in line with other ipld types.serialized
is removed because storing data buffers and the serialized form uses too much memory - we can use the utils.serialize method to create the serialized form when we need it, which in this module is just during the tests.multihash
has also changed to.cid
in the output ofDAGLink.toJSON
andDAGNode.toJSON
because since CIDv1 they are not just multihashes any more; the multihash is contained within the CID.