Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

feat: new IPLD Format API #107

Merged
merged 1 commit into from
May 6, 2019
Merged

feat: new IPLD Format API #107

merged 1 commit into from
May 6, 2019

Conversation

vmx
Copy link
Member

@vmx vmx commented Apr 21, 2019

BREAKING CHANGE: 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.

For the full new API please see the IPLD Formats spec.

@vmx vmx requested a review from rvagg April 21, 2019 23:43
@ghost ghost assigned vmx Apr 21, 2019
@ghost ghost added the status/in-progress In progress label Apr 21, 2019
@codecov
Copy link

codecov bot commented Apr 21, 2019

Codecov Report

Merging #107 into master will increase coverage by 2.82%.
The diff coverage is 97.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   93.28%   96.11%   +2.82%     
==========================================
  Files           3        3              
  Lines         149      103      -46     
==========================================
- Hits          139       99      -40     
+ Misses         10        4       -6
Impacted Files Coverage Δ
src/util.js 96.05% <100%> (-1.63%) ⬇️
src/index.js 100% <100%> (ø) ⬆️
src/resolver.js 95.65% <95.45%> (+8.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba28199...63c6613. Read the comment docs.

src/resolver.js Outdated Show resolved Hide resolved
src/resolver.js Outdated
options = undefined
const traverse = function * (node, path) {
// Traverse only objects and arrays
if (Buffer.isBuffer(node) || CID.isCID(node) || typeof node === 'string') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might need node == null even more than the other formats since it's much more freeform, right?

src/util.js Outdated Show resolved Hide resolved
src/util.js Show resolved Hide resolved
test/resolver.spec.js Outdated Show resolved Hide resolved
test/util.spec.js Outdated Show resolved Hide resolved
src/resolver.js Show resolved Hide resolved
src/util.js Show resolved Hide resolved
src/util.js Show resolved Hide resolved
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that fuzz test needs to be skipped still for browser tests to pass

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels almost too simple given the complexity that's been blown away

BREAKING CHANGE: 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.

For the full new API please see the [IPLD Formats spec].

[IPLD Formats spec]: https://github.com/ipld/interface-ipld-format
@vmx vmx merged commit cfc8519 into master May 6, 2019
@vmx vmx deleted the ipld-format-cleanup branch May 6, 2019 17:35
@ghost ghost removed the status/in-progress In progress label May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants