-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: update event type to extend { [s: string]: any }
#336
Conversation
The `Events` type has to extend `{ [s: string]: any }`. Hopefully one day TS will ship a typed `EventEmitter` and this won't be necessary any more.
Build is failing with
This looks related to the removal of |
it also breaks for me |
@achingbrain now it's failing with another error
I think we need to change the way to import from protobuf, will revisit this issue after we fix the above |
@tuyennhv you can merge #339 to fix the multiaddr error. |
@achingbrain I merged the PR for multiaddr type. Regarding this error, root cause is
somehow
do you know why that line is added during the build process? |
Not off the top of my head, no. TBH I've got rid of mixed CJS/ESM/TS files and only use protobuf.js via protons everywhere else in the stack because debugging these sorts of tooling clashes is a frequent and painful activity otherwise. |
Isn't protons now some in speed as protobuf.js? |
@mpetrunic it's quite comparable to protobuf but not stable enough from the last time I tried, there's a draft PR for it #327 |
The weird thing in all that is that it uses protobuf.js internally for all serialization/deserialization now so it should be comparable. It basically just outputs a nice easily-compilable ts interface to the data object created from a It does use a more recent version of protobuf.js than this module, so that might be a thing. |
I'd test protons version of gossipsub in lodestar before merging that PR as performance is very important to lodestar, right now it's blocked by ChainSafe/lodestar#4114 cc @wemeetagain |
merging the PR as it happens in https://github.com/ChainSafe/js-libp2p-gossipsub/actions/runs/3103234285/jobs/5026341160 there should be another build issue regarding |
The
Events
type has to extend{ [s: string]: any }
. Hopefully one day TS will ship a typedEventEmitter
and this won't be necessary any more.Fixes a type error: