Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types & latest multiformats #6

Merged
merged 1 commit into from
Apr 26, 2021
Merged

Types & latest multiformats #6

merged 1 commit into from
Apr 26, 2021

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Apr 10, 2021

There's two commits here, the first one is the interesting one, the second is a temporary commit that includes dist/ in this branch for use with gitpkg and will be removed before merge. This also needs docs updated I think.

This mirrors work done in ipld/js-dag-cbor#18, introducing full type checking and generation to the process. Also builds on multiformats/js-multiformats#75 which has the CodecFeature type that I'm trying out.

Can be consumed as a dependency with gitpkg via: npm install 'https://gitpkg.now.sh/ipld/js-dag-pb/dist?rvagg/types'.

Another outstanding TODO is to loosen up the parsing rules to match the recent work done in go-codec-dagpb (ipld/go-codec-dagpb#26) and the spec (ipld/specs#360). There's a fixture block to test that too which should be pulled in.

@rvagg rvagg requested review from Gozala and vmx April 10, 2021 05:25
@rvagg rvagg mentioned this pull request Apr 10, 2021
77 tasks
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

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

I tried it a bit on my unixfs work. Though I didn't get far as my code currently expects the PBNode to have Data and Links as mandatory fields. Though this is correct. When I look at the decode() (

function _decode (bytes) {
) not even Links is mandatory. Which is fine (and I think correct), I just would need to adapt my code in unixfs, which I currently don't have the time to.

Though I think this PR is good and should be merged and released. Once that one, the js-dag-cbor one and the js-multiformats are merged and released, we can revisit my unixfs code.

@rvagg
Copy link
Member Author

rvagg commented Apr 22, 2021

updated to match latest, simplified form of the BlockCodec interface @ multiformats/js-multiformats#75

BREAKING CHANGE:

* use multiformats@7 and its non-default exports and updated types
* export types based on latest multiformats structure
* publish with "main"

Unlikely to be breaking in practice for anyone not using types, may not even
break for those using types.
@rvagg rvagg merged commit ad06ffe into master Apr 26, 2021
@rvagg rvagg deleted the rvagg/types branch April 26, 2021 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants