bitsharesjs icon indicating copy to clipboard operation
bitsharesjs copied to clipboard

added packages (monorepo)

Open scientistnik opened this issue 6 years ago • 8 comments

What you think about monorepo with bitsharesjs-ws?

scientistnik avatar Feb 23 '19 10:02 scientistnik

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

sschiessl-bcp avatar Mar 07 '19 12:03 sschiessl-bcp

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 avatar Mar 07 '19 20:03 scientistnik

@sschiessl-bcp What do you think?

scientistnik avatar Mar 25 '19 16:03 scientistnik

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?

sschiessl-bcp avatar Mar 26 '19 08:03 sschiessl-bcp

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

clockworkgr avatar Mar 26 '19 10:03 clockworkgr

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.

scientistnik avatar Mar 27 '19 08:03 scientistnik

What is your experience nowadays with monorepo?

sschiessl-bcp avatar Jan 09 '22 19:01 sschiessl-bcp

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...

scientistnik avatar Jan 11 '22 20:01 scientistnik