-
Notifications
You must be signed in to change notification settings - Fork 299
Conversation
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.
LGTM
Those three commits should be merged together: |
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.
LGTM
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.
Could you expand on:
they are kind of implementation details of IPLD
object.put
can receive instances of DagNode
and there are static properties e.g. isDagNode
that might be useful to users.
Is it in some way damaging to leave this as is? Does it impact bundle size - should users really not be allowed to access these two IPLD formats?
@alanshaw This change was motivated by removing And while I was at it, I also removed |
Prior to this change the `ipld-dag-cbor` and `ipld-dag-pb` modules are re-exported so that can be accessed within the Browser bundle. Those modules normally don't need to be used directly, they are kind of implementation details of IPLD. Hence remove them. BREAKING CHANGE: remove `types.dagCBOR` and `dag.dagPB` from public API If you need the `ipld-dag-cbor` or `ipld-dag-pb` module in the Browser, you need to bundle them yourself.
5e35c42
to
62b00be
Compare
See ipfs-inactive/interface-js-ipfs-core#374 (review) for further rationale |
@alanshaw CI passed, so I think it's ready to go :) |
Sorry I didn’t notice before but “chore:” commits don’t make it into the changelog. Should this be “refactor:” instead? Also please could you make sure the breaking change message is in the commit body. |
@alanshaw The breaking change is in the commit message and it will also show up in the changelog as it is a breaking change (i've tested that locally). You can see the output if you run |
Perfect, thanks. I was looking at this on mobile before and it didn't let me drill down into the commit message. |
Ci is finally green! :) |
Merging as this is failing due to unrelated ping test failures. |
* chore: remove ipld formats re-export (#872) Prior to this change the `ipld-dag-cbor` and `ipld-dag-pb` modules are re-exported so that can be accessed within the Browser bundle. Those modules normally don't need to be used directly, they are kind of implementation details of IPLD. Hence remove them. BREAKING CHANGE: remove `types.dagCBOR` and `types.dagPB` from public API If you need the `ipld-dag-cbor` or `ipld-dag-pb` module in the Browser, you need to bundle them yourself. * chore: update to ipld-dag-cbor 0.13 No further changes are needed as js-ipfs-api is getting the raw blocks from IPFS and does the whole parsing client-sided in JavaScript. BREAKING CHANGE: dag-cbor nodes now represent links as CID objects The API for [dag-cbor](https://github.com/ipld/js-ipld-dag-cbor) changed. Links are no longer represented as JSON objects (`{"/": "base-encoded-cid"}`, but as [CID objects](https://github.com/ipld/js-cid). `ipfs.dag.get()` and now always return links as CID objects. `ipfs.dag.put()` also expects links to be represented as CID objects. The old-style JSON objects representation is still supported, but deprecated. Prior to this change: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as JSON object representation const putCid = await ipfs.dag.put({link: {'/': cid.toBaseEncodedString()}}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: { '/': <Buffer 12 20 8a…> } } ``` Now: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as CID object const putCid = await ipfs.dag.put({link: cid}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: CID { codec: 'dag-pb', version: 0, multihash: <Buffer 12 20 8a…> } } ``` See ipld/ipld#44 for more information on why this change was made. * chore: update deps * fix: remove unused deps * chore: remove socket.io, not used anymore
* chore: remove ipld formats re-export (#872) Prior to this change the `ipld-dag-cbor` and `ipld-dag-pb` modules are re-exported so that can be accessed within the Browser bundle. Those modules normally don't need to be used directly, they are kind of implementation details of IPLD. Hence remove them. BREAKING CHANGE: remove `types.dagCBOR` and `types.dagPB` from public API If you need the `ipld-dag-cbor` or `ipld-dag-pb` module in the Browser, you need to bundle them yourself. * chore: update to ipld-dag-cbor 0.13 No further changes are needed as js-ipfs-api is getting the raw blocks from IPFS and does the whole parsing client-sided in JavaScript. BREAKING CHANGE: dag-cbor nodes now represent links as CID objects The API for [dag-cbor](https://github.com/ipld/js-ipld-dag-cbor) changed. Links are no longer represented as JSON objects (`{"/": "base-encoded-cid"}`, but as [CID objects](https://github.com/ipld/js-cid). `ipfs.dag.get()` and now always return links as CID objects. `ipfs.dag.put()` also expects links to be represented as CID objects. The old-style JSON objects representation is still supported, but deprecated. Prior to this change: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as JSON object representation const putCid = await ipfs.dag.put({link: {'/': cid.toBaseEncodedString()}}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: { '/': <Buffer 12 20 8a…> } } ``` Now: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as CID object const putCid = await ipfs.dag.put({link: cid}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: CID { codec: 'dag-pb', version: 0, multihash: <Buffer 12 20 8a…> } } ``` See ipld/ipld#44 for more information on why this change was made. * chore: update deps * fix: remove unused deps * chore: remove socket.io, not used anymore
Prior to this change the
ipld-dag-cbor
andipld-dag-pb
modulesare re-exported so that can be accessed within the Browser bundle.
Those modules normally don't need to be used directly, they are
kind of implementation details of IPLD. Hence remove them.
BREAKING CHANGE: remove
types.dagCBOR
anddag.dagPB
from public API