-
Notifications
You must be signed in to change notification settings - Fork 37
feat!: accept pre-configured import components as options instead of options for components #283
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Converts this module to typescript Since there were existing types this should be minimally disruptive but releasing this as a major just in case. BREAKING CHANGE: the types on this module may have changed
github-actions bot
pushed a commit
that referenced
this pull request
Feb 16, 2023
## [ipfs-unixfs-v11.0.0](ipfs-unixfs-v10.0.0...ipfs-unixfs-v11.0.0) (2023-02-16) ### ⚠ BREAKING CHANGES * The options object now accepts preconfigured instances of chunkers and file layouts - these can be imported from this module - see #283 for more ### Features * accept pre-configured import components as options instead of options for components ([#283](#283)) ([5a38d01](5a38d01))
🎉 This PR is included in version ipfs-unixfs-v11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
github-actions bot
pushed a commit
that referenced
this pull request
Feb 16, 2023
## [ipfs-unixfs-importer-v14.0.0](ipfs-unixfs-importer-v13.0.0...ipfs-unixfs-importer-v14.0.0) (2023-02-16) ### ⚠ BREAKING CHANGES * The options object now accepts preconfigured instances of chunkers and file layouts - these can be imported from this module - see #283 for more ### Features * accept pre-configured import components as options instead of options for components ([#283](#283)) ([5a38d01](5a38d01)) ### Dependencies * update sibling dependencies ([b4f6fc8](b4f6fc8))
🎉 This PR is included in version ipfs-unixfs-importer-v14.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
github-actions bot
pushed a commit
that referenced
this pull request
Feb 16, 2023
## [ipfs-unixfs-exporter-v12.0.0](ipfs-unixfs-exporter-v11.0.0...ipfs-unixfs-exporter-v12.0.0) (2023-02-16) ### ⚠ BREAKING CHANGES * The options object now accepts preconfigured instances of chunkers and file layouts - these can be imported from this module - see #283 for more ### Features * accept pre-configured import components as options instead of options for components ([#283](#283)) ([5a38d01](5a38d01)) ### Dependencies * update sibling dependencies ([c59954c](c59954c)) * update sibling dependencies ([b4f6fc8](b4f6fc8))
🎉 This PR is included in version ipfs-unixfs-exporter-v12.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing importer takes one big options object that contains options for every subsystem. This leads to situations where different components use the same option keys - for example both the rabin and fixed-size chunkers use the
maxChunkSize
key.This PR reduces the number of options by accepting preconfigured instances of internal components - e.g. instead of passing
'"rabin"
for the chunker argument, you pass an instance of the rabin chunker instead. This greatly simplifies the config and also allows a simple way for users to pass custom chunkers in. The same thing applies to file layouts, dag builders etc.Before:
After:
Other breaking changes:
onlyHash
option has been removed - just pass aMemoryBlockstore
or other blockstore implementation that doesn't store the blocks anywherestrategy
config key is nowlayout
and accepts an instance of a file layout instead of a stringchunker
config key now accepts an instance of a file chunker instead of a stringimportFile
,importDirectory
,importBytes
andimportByteStream
functions are also now exported along sideimporter
to make dealing with simple imports that only import one thing easier.BREAKING CHANGE: The options object now accepts preconfigured instances of chunkers and file layouts - these can be imported from this module - see #283 for more