js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

Followup: Types

Open Gozala opened this issue 4 years ago • 8 comments

https://github.com/libp2p/js-libp2p/pull/802 has deliberately opt-ed out couple of modules from TS checking with an intent to address that in followups. This is an issue to track that effort.

What are we missing / What is next?

  • [ ] https://github.com/libp2p/js-libp2p/pull/831
  • [ ] Event Emitters
    • @Gozala created https://www.npmjs.com/package/typed-events.ts for the EventEmitter typedefs ❤️ . After syncing with him, we might want to get the declaration file from there in and use https://www.npmjs.com/package/proper-event-emitter per https://github.com/libp2p/js-libp2p/pull/761 (we also have emittery and some modules and we need to double check ig we should just use it).
  • [ ] Improve Circuit Message definitions
    • https://github.com/libp2p/js-libp2p/pull/831#issuecomment-742494373
  • [ ] DHT should have typedefs for its options
  • [ ] Metrics and Latency monitor needs to be finished (currently @ts-nocheck)
  • [ ] Keychain (currently @ts-nocheck)
    • Needs https://github.com/ipfs/interface-datastore/pull/56 + keychain types
  • [ ] Configuration Options
    • Probably together with https://github.com/libp2p/js-libp2p/issues/576

Gozala avatar Dec 09 '20 23:12 Gozala

Thanks @Gozala ! Just added a checklist of things that need to be done in follow up

vasco-santos avatar Dec 10 '20 14:12 vasco-santos

I found that the Libp2pModules type for the config is missing keys for peerDiscovery and dht.

ryanio avatar Jan 07 '21 21:01 ryanio

Yes, thanks for adding that! We still need to create interfaces for peerDiscovery, peerRouting and so on to add the types here. For now they should be accepted as any while we finish that

vasco-santos avatar Jan 08 '21 10:01 vasco-santos

Has anyone started working on the types for DHT etc? If not, I plan on creating a PR for these today.

peterbraden avatar Feb 09 '21 08:02 peterbraden

Hey @peterbraden

Thanks for reaching out. It is not released yet but we just got types for the DHT per https://github.com/libp2p/js-libp2p-kad-dht/pull/214 This does not include integration of the DHT config types in libp2p core as this issue is tracking.

You can see the broad state of types in https://github.com/libp2p/js-libp2p/issues/659 . If you would like to help out in any other module let me know

vasco-santos avatar Feb 09 '21 09:02 vasco-santos

Ah, awesome, thanks for getting back to me so quickly!

I'll try these out locally, and get back to you if there are any other modules we use that I can contribute to.

peterbraden avatar Feb 09 '21 10:02 peterbraden

I found that the Libp2pModules type for the config is missing keys for peerDiscovery and dht.

It is also missing the key for pubsub.

D4nte avatar Mar 04 '21 23:03 D4nte

If someone would like to help getting this to the finish line would be super helpful

vasco-santos avatar Mar 05 '21 13:03 vasco-santos

@achingbrain @wemeetagain @maschad is this related to https://github.com/multiformats/js-multiformats/issues/249 ?

SgtPooki avatar Sep 25 '23 16:09 SgtPooki

This can be closed

wemeetagain avatar Sep 28 '23 03:09 wemeetagain