From 9d12edcae7b57483eef7be0ee51ffbc6ed8fc42f Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Thu, 4 Oct 2018 16:29:38 +0200 Subject: [PATCH] chore: remove ipld formats re-export 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. Now `ipld-dag-cbor` isn't a direct dependency of `jsipfs` anymore. 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. --- package.json | 1 - src/core/index.js | 6 +----- test/core/init.spec.js | 6 +----- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 3050a58937..107dddc597 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "ipfs-unixfs": "~0.1.15", "ipfs-unixfs-engine": "~0.32.3", "ipld": "~0.17.3", - "ipld-dag-cbor": "~0.12.1", "ipld-dag-pb": "~0.14.6", "ipns": "~0.2.0", "is-ipfs": "~0.4.2", diff --git a/src/core/index.js b/src/core/index.js index 0f49423f78..a0b59977cc 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -4,8 +4,6 @@ const BlockService = require('ipfs-block-service') const Ipld = require('ipld') const PeerId = require('peer-id') const PeerInfo = require('peer-info') -const dagCBOR = require('ipld-dag-cbor') -const dagPB = require('ipld-dag-pb') const crypto = require('libp2p-crypto') const isIPFS = require('is-ipfs') const multiaddr = require('multiaddr') @@ -74,9 +72,7 @@ class IPFS extends EventEmitter { multiaddr: multiaddr, multibase: multibase, multihash: multihash, - CID: CID, - dagPB: dagPB, - dagCBOR: dagCBOR + CID: CID } // IPFS Core Internals diff --git a/test/core/init.spec.js b/test/core/init.spec.js index b8b16c0f81..4db10e7181 100644 --- a/test/core/init.spec.js +++ b/test/core/init.spec.js @@ -10,8 +10,6 @@ const isNode = require('detect-node') const hat = require('hat') const PeerId = require('peer-id') const PeerInfo = require('peer-info') -const dagCBOR = require('ipld-dag-cbor') -const dagPB = require('ipld-dag-pb') const crypto = require('libp2p-crypto') const isIPFS = require('is-ipfs') const multiaddr = require('multiaddr') @@ -122,9 +120,7 @@ describe('init', () => { multiaddr: multiaddr, multibase: multibase, multihash: multihash, - CID: CID, - dagPB: dagPB, - dagCBOR: dagCBOR + CID: CID }) })