Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: remove unused deps (#880)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hugomrdias authored and daviddias committed Oct 30, 2018
1 parent a634915 commit 46bbef2
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,44 +28,44 @@
},
"dependencies": {
"async": "^2.6.1",
"big.js": "^5.1.2",
"bl": "^2.1.1",
"big.js": "^5.2.2",
"bl": "^2.1.2",
"bs58": "^4.0.1",
"cids": "~0.5.3",
"cids": "~0.5.5",
"concat-stream": "^1.6.2",
"debug": "^3.1.0",
"detect-node": "^2.0.3",
"debug": "^4.1.0",
"detect-node": "^2.0.4",
"end-of-stream": "^1.4.1",
"flatmap": "0.0.3",
"glob": "^7.1.2",
"ipfs-block": "~0.7.1",
"ipfs-unixfs": "~0.1.15",
"glob": "^7.1.3",
"ipfs-block": "~0.8.0",
"ipfs-unixfs": "~0.1.16",
"ipld-dag-cbor": "~0.13.0",
"ipld-dag-pb": "~0.14.6",
"is-ipfs": "~0.4.2",
"ipld-dag-pb": "~0.14.11",
"is-ipfs": "~0.4.7",
"is-pull-stream": "0.0.0",
"is-stream": "^1.1.0",
"libp2p-crypto": "~0.13.0",
"libp2p-crypto": "~0.14.0",
"lodash": "^4.17.11",
"lru-cache": "^4.1.3",
"multiaddr": "^5.0.0",
"multibase": "~0.4.0",
"multihashes": "~0.4.13",
"multibase": "~0.5.0",
"multihashes": "~0.4.14",
"ndjson": "^1.5.0",
"once": "^1.4.0",
"peer-id": "~0.11.0",
"peer-id": "~0.12.0",
"peer-info": "~0.14.1",
"promisify-es6": "^1.0.3",
"pull-defer": "~0.2.2",
"pull-defer": "~0.2.3",
"pull-pushable": "^2.2.0",
"pull-stream-to-stream": "^1.3.4",
"pump": "^3.0.0",
"qs": "^6.5.2",
"readable-stream": "^2.3.6",
"readable-stream": "^3.0.6",
"stream-http": "^3.0.0",
"stream-to-pull-stream": "^1.7.2",
"streamifier": "~0.1.1",
"tar-stream": "^1.6.1",
"tar-stream": "^1.6.2",
"through2": "^2.0.3"
},
"engines": {
Expand All @@ -77,19 +77,17 @@
"url": "https://github.com/ipfs/js-ipfs-api"
},
"devDependencies": {
"aegir": "^15.1.0",
"aegir": "^17.0.1",
"browser-process-platform": "~0.1.1",
"chai": "^4.1.2",
"chai": "^4.2.0",
"cross-env": "^5.2.0",
"dirty-chai": "^2.0.1",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-react": "^7.11.1",
"go-ipfs-dep": "~0.4.17",
"gulp": "^3.9.1",
"interface-ipfs-core": "~0.81.0",
"ipfsd-ctl": "~0.39.0",
"pull-stream": "^3.6.8",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
"ipfsd-ctl": "~0.39.5",
"pull-stream": "^3.6.9",
"stream-equal": "^1.1.1"
},
"keywords": [
Expand Down

0 comments on commit 46bbef2

Please sign in to comment.