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

Add extension support #5

Merged
merged 4 commits into from
Apr 11, 2016
Merged

Add extension support #5

merged 4 commits into from
Apr 11, 2016

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire mentioned this pull request Apr 8, 2016
3 tasks
@daviddias
Copy link
Member

Can we make the 'extension' be transparent and have a type instead, as for 'ipld', and 'protobuf', from UX perspective, it will be easier to read that we want to read the block that is stored as protobuf or as ipld, rather than having to know the extension (which .data doesn't really mean anything).


```JavaScript
```js
Copy link
Member

Choose a reason for hiding this comment

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

master nicpicker :P

@dignifiedquire
Copy link
Member Author

Not sure I agree with that. If we go this route we have to encode the mapping of type to extension into the Block and need to change it everytime we might want to add a new type. If we just use extension we can pass any new thing through without ever having to touch the internals of Block again.

@daviddias
Copy link
Member

I understand, hopefully, we won't to change again though :). It does make an js-ipfs contributor have to have domain knowledge of how blocks are put in disk.

return this.type
}
}
})
Copy link
Member

Choose a reason for hiding this comment

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

nice way to do it :)

@daviddias daviddias merged commit 6245e66 into master Apr 11, 2016
@daviddias daviddias deleted the ipld branch April 11, 2016 10:57
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.

None yet

2 participants