Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Benefits and Drawbacks #3

Open
alanshaw opened this issue Jul 29, 2019 · 0 comments
Open

Benefits and Drawbacks #3

alanshaw opened this issue Jul 29, 2019 · 0 comments

Comments

@alanshaw
Copy link
Member

Some notes hanging around on my desktop:

Benefits

  • Tiny bundle size
    • Import just the part you want to use:
    • const add = require('ipfs-http-client-lite/src/add')(); await add(...)
  • Uses window.fetch and node-fetch under the hood
  • Pass a custom fetch implementation
  • Cancelable requests with AbortSignal for all requests
  • Pubsub works in the browser

Drawbacks

  • No custom classes returned from API methods
    • No CIDs
    • No PeerInfos
    • No PeerIds
    • etc.
  • No support for passing CIDs as buffers to API methods
  • Not interface-ipfs-core compatible
    • Although a CoreAdapter exists to allow tests to run
  • No APIs that return Node.js style streams (big bundle size inflate if include readable-stream)
    • Hence, missing:
      • addReadableStream
      • catReadableStream
    • That said, APIs can consume Node.js streams because they are async iterable

Eventually:

ipfs-http-client could just export new CoreAdapter(ipfsLiteClient)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant