Releases: ipld/js-ipld-dag-pb
v0.18.3
v0.18.2
v0.18.1
v0.18.0
Bug Fixes
Features
- make addLink()/rmLink() instance methods (a9aa0a0)
- remove cloning (d5e1135)
- remove DAGNode.create() (029174d), closes #132
Performance Improvements
- remove manual enumerability modifications (37ffdd5), closes #152
- remove named links from object (4dbe00d)
BREAKING CHANGES
addLink()
andrmLink()
are now instance methods.
Prior to this change:
DAGNode.addLink(node, link)
DAGNode.rmLink(node, name)
Now:
node.addLink(link)
node.rmLink(name)
- It's no longer possible to pass a
DAGNode
intoaddLink()
.
Intead of passing in a DAGNode
into addLink()
, convert that node into
a DAGLink
via toDAGLink()
.
Example:
Prior to this change:
const node = new DAGNode('some data')
const node2 = new DAGNode('use that as link')
await DAGNode.addLink(node, node2)
Now:
const node = new DAGNode('some data')
const node2 = new DAGNode('use that as link')
DAGNode.addLink(node, await node2.toDAGLink())
- DAGNode.create() is removed
Instead of DAGNode.create()
, please use new DAGNode()
instead. It
takes the same parameters and is compatible to create()
.
Example:
Prior to this change:
const node = DAGNode.create('some data', links)
Now:
const node = new DAGNode('some data', links)
DAGNode.clone()
is removed from public API without any replacement.
Also the API for rmLink()
and addLink()
changed. They no longer
return a new node, but just remove/add the links to/from the current
node.
Prior to this change:
const lessLinks = DAGNode.rmLink(node1, 'Link1')
node1 = lessLinks
const moreLinks = await DAGNode.addLink(node2, link)
node2 = moreLinks
Now:
DAGNode.rmLink(node, 'Link1')
await DAGNode.addLink(node2, link)
- named links are no longer part of an object
Access to named links is only possible with calling resolve()
.
Hence they are also not part of tree()
anymore.
Named links are a feature of IPFS and only supported for
backwards compatibility, they are not really part of IPLD.
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.0
Bug Fixes
- package: update multihashing-async to version 0.6.0 (63b7986)
Features
- new IPLD Format API (1de1bcc)
BREAKING CHANGES
- The API is now async/await based
There are numerous changes, the most significant one is that the API
is no longer callback based, but it using async/await.
The properties of DAGNode and DAGLink are now in sync with the paths
that are used for resolving. This means that e.g. name
is now called
Name
and size
is Tsize
.
All return values from resolve()
now conform to the IPLD Data Model,
this means that e.g. links are no longer represented as
{'/': "baseecodedcid"}
, but as CID instances instead.
For the full new API please see the IPLD Formats spec.