React-instantsearch: [dev env] convert to a proper monorepo structure

Created on 2 Aug 2017  Â·  6Comments  Â·  Source: algolia/react-instantsearch

Today we're using the traditional Lerna file structure, where we have a packages folder, in which multiple package.jsons are used. We have our own proprietary yarn boot script, which links up these dependencies manually.

We want to switch to a library to handle this for us, so we don't have issues with that anymore (see https://github.com/algolia/react-instantsearch/commit/a80dcd5db3a4c9d595a83c63aa6b190927084b3d).

There are two ways to go now:

  • switch to Lerna now

    • maybe have the problems we had earlier combining it with Yarn (cc @rayrutjes)

  • switch to Yarn workspaces soon

    • not yet released, should definitely work with Yarn 😂

cc @rarkins

✨ Chore

Most helpful comment

Why we don't combine both Lerna + Yarn? It seems that the problems have disappeared since the release of Yarn in 1.x & Lerna in 2.x. It can be interesting for:

  • release: we can avoid to walk on each packages in order to bump the version, build the package, test the package, etc...
  • examples: we have the examples scoped inside the react-instantsearch package. We could extract it on the root folder and control them with Lerna & Yarn wokspaces. It will simplify the update since we don't to walk on each recipe to update it (same for the tests). The development workflow will be better, we will don't have to link manually the dependency for testing purpose.

IMO it will remove a lot of complexity (we could remove most of our custom scripts) for handle this "monorepos" structure.

WDYT?

All 6 comments

Yarn workspaces work great for client and crawler, we should do this here.

cc @vvo

Answer is YES. This is a great chore to do but yarn workspaces + renovate is awesome. We could then remove a lot of custom and brittle setup code.

Why we don't combine both Lerna + Yarn? It seems that the problems have disappeared since the release of Yarn in 1.x & Lerna in 2.x. It can be interesting for:

  • release: we can avoid to walk on each packages in order to bump the version, build the package, test the package, etc...
  • examples: we have the examples scoped inside the react-instantsearch package. We could extract it on the root folder and control them with Lerna & Yarn wokspaces. It will simplify the update since we don't to walk on each recipe to update it (same for the tests). The development workflow will be better, we will don't have to link manually the dependency for testing purpose.

IMO it will remove a lot of complexity (we could remove most of our custom scripts) for handle this "monorepos" structure.

WDYT?

I think all this is waiting for is someone to do the change @samouss 👌

WDYT?

Yes for removing code and reusing tools instead

Aww yeah!

Was this page helpful?
0 / 5 - 0 ratings