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

added packages (monorepo) #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scientistnik
Copy link

What you think about monorepo with bitsharesjs-ws?

@sschiessl-bcp
Copy link
Contributor

Can you please describe what the changes are that you are proposing?

@scientistnik
Copy link
Author

We have two repo: bitsharesjs-ws and bitsharesjs.

I suggest create directory like packages in bitsharesjs repo with related bitsharesjs-ws package.

Why is it better:

  • easy to coordinate changes across modules. If we change bitsharesjs-ws, we may test it on bitsharesjs lib;
  • single place to report issues. One place for bugs, improvements and questions
  • easier to setup a development environment. JS is changing, and development environment is changing too

This approach is called monorepo. Many projects use this approach (for example Vue or Babel)

Another thing what I suggest is create package bitshares-ecc. It is often necessary to work only with private keys. But use for that bitsharesjs impractical, because bitsharesjs too heavy package.

@scientistnik
Copy link
Author

@sschiessl-bcp What do you think?

@sschiessl-bcp
Copy link
Contributor

I've did some digging and found many projects building on -ws directly due to overhead of the full library.

How would that be handled in a mono-repo?

@clockworkgr
Copy link
Member

Guess we could add bitsharesjs-ws as a submodule repo ? so keep it separate but reference it in bitsharesjs as a subpart of it?

@scientistnik
Copy link
Author

I've did some digging and found many projects building on -ws directly due to overhead of the full library.

How would that be handled in a mono-repo?

Do you mean fork or package dependence?

Monorepo is about source code, but in npmjs.com we will steel have two packages (bitsharesjs and bitsharesjs-ws)

If some project want to modify bitsharesjs-ws package they need fork all mono-repo. I think isn't big problem. Mostly forks bitsharesjs-ws repo is Graphene-based blockchain projects. They need fork bitsharesjs-ws and bitsharesjs repos. Old repo bitsharesjs-ws won't delete. Only will mark obsolete.

About submodule. It will not change anything. If people will want to create issue they won't understand where need to create.

I try to do monorepo in my btsdex library. You can see how it looks. We have 4 packages in npmjs.com: btsdex, btsdex-api, btsdex-ecc, btsdex-serializer. All this packages in one repo.

What packages do I suggest to make:

  • api is for manage connection and call node methods.
  • ecc is for work with encryption, work with keys. It need when you want to create simple SPA for work with private keys, but you don't want to add fat bitsharesjs package. Or in your project you have backend who send transaction (because you need do some off-chain work), but users will sign this transaction.

@sschiessl-bcp
Copy link
Contributor

What is your experience nowadays with monorepo?

@sschiessl-bcp sschiessl-bcp changed the title added packages added packages (monorepo) Jan 9, 2022
@scientistnik
Copy link
Author

What is your experience nowadays with monorepo?

very comfortable)

But today usually use lerna.js for that.

I would also divide this repository into several packages: chain, ecc, serializer, ws, and so on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants