orbit-db-types icon indicating copy to clipboard operation
orbit-db-types copied to clipboard

Replace dependency on community IPFS types with new ipfs-core-types

Open mboogerd opened this issue 3 years ago • 0 comments

hi! 👋

I encountered issue #29 and thought I would attempt to help.

Disclaimer:

  • I don't consider myself a Node / JS or TS developer
  • I have no more than a few hours of experience with IPFS and OrbitDB

The problem: IPFS type from git+https://github.com/lukas2005/types-ipfs.git don't match the types employed by the more recent ipfs-core-types package. This package seems to be the new way of working, at least for ipfs-http-client.

The fix:

  • [x] Replace references to @types/ipfs with ipfs-core-types
  • [x] Store.d.ts - TS error: Cannot find name 'IReplicationStatus'.. This seems to be fixed by adding a reference path. I don't understand the details of what it does, but I see a similar usage in OrbitDB.d.ts, so I guess it's okay? :)
  • [ ] Verify that this massive package.json diff is a desirable one <- Question to you :) (I was under the impression that we don't check in package.json for libraries)
  • [ ] OrbitDB.d.ts - TS error: Cannot find module 'orbit-db-cache' or its corresponding type declarations.. My intuition here is that we shouldn't use this git dependency on OrbitDB, but have a release cycle for the types that aligns with the releases of OrbitDB. I could be entirely wrong here though. Also not sure whether that should be fixed in this PR

Feedback much appreciated! :)

mboogerd avatar May 22 '21 09:05 mboogerd