Skip to content
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

Default import from one package #1353

Closed
3 of 4 tasks
fryorcraken opened this issue May 15, 2023 · 9 comments
Closed
3 of 4 tasks

Default import from one package #1353

fryorcraken opened this issue May 15, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@fryorcraken
Copy link
Collaborator

fryorcraken commented May 15, 2023

This is a feature request

Problem

Basic usage of js-waku involved importing for a couple of packages:

  • @waku/core
  • @waku/create
  • @waku/utils

See https://dev.waku.guide/browser/quick-start/

This kind be confusing for a developer.

More Context

The js-waku mono repo aims to be modular and to enable developer to limit their dependencies.
For more context, see #1159 for more context.

However, such characteristics are not desirable for a new comer, a developer trying out Waku or attempting to use it in a hackathon.

Hence, the @waku/create package was created to expose some API easy to use with good defaults.

Proposed Solutions

The proposal is for one js-waku package to be a proxy package for other packages that are expected to be used in most basic example.

@waku/create aimed to be said proxy package but fails at it as @waku/core and @waku/utils still need to be used.

Proposal:

  1. Rename/replace @waku/create by a more attractive/general name. e.g. @waku/sdk
  2. Proxy more function in new package from @waku/core so that all js-waku examples can be purely done by installing and importing from @waku/sdk (or whatever name we settle on).

Notes

Cc @hackyguru @LordGhostX

@fryorcraken fryorcraken added API enhancement New feature or request labels May 15, 2023
@LordGhostX
Copy link
Contributor

LordGhostX commented May 16, 2023

I agree with the proposal and would like to provide some additional considerations to support the transition:

  1. Naming: Renaming @waku/create to @waku/sdk is brilliant. It's intuitive, beginner-friendly, and establishes it as the go-to toolkit. I was confused by the multiple imports in code examples when I first used Waku.

  2. Proxying: To establish @waku/sdk as the primary package for basic examples, it should proxy important functions from @waku/core and @waku/utils. This simplifies the learning process and promotes its usage.

  3. Documentation: Clear and comprehensive documentation for @waku/sdk is essential. It needs a beginner's guide, step-by-step instructions, and a clear distinction between basic usage (through @waku/sdk) and advanced usage (using direct imports from @waku/core and @waku/utils).

  4. Examples: Practical examples using the @waku/sdk package will illustrate its use and capabilities, further encouraging adoption.

@weboko
Copy link
Collaborator

weboko commented Jun 5, 2023

Keeping issue open to remove forced version after next release.

@weboko weboko self-assigned this Jun 5, 2023
@fryorcraken
Copy link
Collaborator Author

fryorcraken commented Jun 15, 2023

FYI I defined next steps for this issue in the description. Moving back to "priority" column as no pending PR.

@fryorcraken
Copy link
Collaborator Author

Let's try to have remaining items done next week.

@weboko
Copy link
Collaborator

weboko commented Jun 16, 2023

@waku/sdk is released and I will complete the transition of a basic example to it early next week

@weboko
Copy link
Collaborator

weboko commented Jun 20, 2023

Basic examples are using @waku/sdk now. So we can start pointing it out in our docs. Meanwhile I started transitioning eth-pm and other React based examples.

cc: @LordGhostX

TODO of examples for me:

  • eth-pm;
  • light-chat;
  • relay-angular-chat;
  • relay-react-chat;
  • store-reactjs-chat;
  • web-chat;

@weboko
Copy link
Collaborator

weboko commented Jun 26, 2023

The last example to update is relay-angular-chat and it is not that straightforward because of the inconsistency of internal types.
Will be addressed here a bit later - waku-org/examples.waku.org#246

Proposing to resolve this issue and track upgrade to the last example in this issue waku-org/examples.waku.org#247

@danisharora099
Copy link
Collaborator

Proposing to resolve this issue and track upgrade to the last example in this issue waku-org/js-waku-examples#247

I agree with this proposal as it resolves and upgrades all examples, but one which is being tracked in a separate issue 👍

@weboko
Copy link
Collaborator

weboko commented Jun 27, 2023

Closing in favor of waku-org/examples.waku.org#247

@weboko weboko closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants