You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@waku/create was created as a way to provide good easy default for new users of Waku.
A developer wanting to use js-waku can start with @waku/create to get an app running fast.
However, when it comes to bundle size and dependency optimisation, one may not want to rely on the good default of @waku/create and add few lines of code to end up with a smaller package.
Note: Maybe this example is not properly setup for the task as no bundler is used.
The point of this issue/example is to prove that @waku/create is a "good defaults" helpers but is not mandatory to use @waku/core when a developer wants to optimize for size and dependencies.
It may be more appropriate to move the store-js example to a package manager + bundler project form and review the bundle output and size once done.
Then, further decisions can be made to improve the @waku/create API.
This is a change request
Problem
@waku/create
was created as a way to provide good easy default for new users of Waku.A developer wanting to use js-waku can start with
@waku/create
to get an app running fast.However, when it comes to bundle size and dependency optimisation, one may not want to rely on the good default of
@waku/create
and add few lines of code to end up with a smaller package.This is what the store-js example https://github.com/waku-org/js-waku-examples/blob/master/examples/store-js/index.html attempt to demonstrate, by initializing a Waku with, and only with, the store protocol.
However, it currently rely on
@waku/create
to initiate libp2p with good defaults:https://github.com/waku-org/js-waku-examples/blob/671767400a64de886f47d90162ecb937dbe7f21b/examples/store-js/index.html#L17
If you check the network tab of your browser going to https://examples.waku.org/store-js you'll notice the following
index.js
files being downloaded:Enabling a developer to not use core would be a great gain (do not this include
libp2p
so the gain may mainly due to not downloading other deps).Proposed Solutions
Ideally, a user should be able to only depend on
@waku/core
andlibp2p
to build the js-store example with a bootstrap peer discovery mechanism.Not sure if the libp2p setup should be left to the developer (very verbose) or segregated within or outside the
@waku/create
package.Out of Scope
Optimising of bundle and size tracked with #579.
The text was updated successfully, but these errors were encountered: