-
Notifications
You must be signed in to change notification settings - Fork 42
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!: @waku/discovery #1876
feat!: @waku/discovery #1876
Conversation
e8f43b4
to
a02e6d9
Compare
size-limit report 📦
|
4907079
to
961ce83
Compare
961ce83
to
a1d9e34
Compare
|
||
// Peer Exchange Discovery | ||
export { | ||
wakuPeerExchange, |
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.
Wondering if we need these waku*
. To me it seems we can avoid and just be straight - peerExchangeDiscovery
, peerCacheDiscovery
, etc
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.
Removed two exports, but we use reft of them somewhere or the other (mostly for different types of tests)
Please feel free to take a look and suggest if there's an unnecessary export remaining
// dynamically importing the local storage polyfill for node | ||
if (typeof window === "undefined") { | ||
try { | ||
const { LocalStorage } = await import("node-localstorage"); |
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.
it's only needed for tests
so another check can be used too, for example
js-waku/packages/sdk/src/utils/libp2p.ts
Line 40 in fb41f4c
if (!options?.hideWebSocketInfo && process.env.NODE_ENV !== "test") { |
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.
typeof window
check feels more robust for karma compilation purposes: karma can't compile node packges, thus this acts as a good safe guard.
Is this a nit? can also try with the NODE_ENV
flag
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.
left some comments
Thanks for the comments! Addressed :) |
0fad331
to
c2e3a8e
Compare
@@ -6,5 +6,5 @@ | |||
"tsBuildInfoFile": "dist/.tsbuildinfo" | |||
}, | |||
"include": ["src"], | |||
"exclude": ["src/**/*.spec.ts", "src/test_utils"] |
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.
why is it removed?
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.
src/test_utils
isn't actually any directory in this package. seems to have come in during a copy. spec.ts
files are still excluded
56956d4
to
4e6dca7
Compare
Problem
We currently have 3 discovery options available within Waku:
For this, we have 3 separate packages, which might only increase with time.
Solution
Create a generalised package
@waku/discovery
to encapsulate all the available discovery mechanisms.Notes
@waku/discovery
to encapsulate all discovery mechanisms available within Waku #1862