-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: support 'create' constructor from ipfs-http-client #38
Conversation
hacdias
commented
Aug 24, 2021
•
edited by lidel
Loading
edited by lidel
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
src/providers/http-client.js
Outdated
@@ -61,7 +61,7 @@ async function tryHttpClient ({ loadHttpClientModule, apiAddress, root, connecti | |||
// Returns js-ipfs-http-client instance or null | |||
async function maybeApi ({ apiAddress, connectionTest, httpClient, ...options }) { | |||
try { | |||
const ipfs = httpClient({ ...options, ...clientOptions(apiAddress) }) | |||
const ipfs = httpClient.create({ ...options, ...clientOptions(apiAddress) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unfortunate that this will break old code in demos and hackpads that naively load the latest version:
<script src="https://cdn.jsdelivr.net/npm/ipfs-core/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ipfs-http-client/dist/index.min.js"></script>
Can we add the old version inside the catch block, as a fallback attempt?
(ipfs-provider aims to smooth out rough edges introduced by breaking changes in js-ipfs*)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It's now backwards compatible!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Will release soon.
Shipped in v2.1.0 |