Closed kirlat closed 4 years ago
I think this makes a lot of sense. I do have a couple of questions:
Would we keep the webextension and embed-lib as separate repositories? What are the pros and cons of this?
What about service level libraries, like lexis-cs, and the user word and setting apis? I presume these will still remain separate codebases?
What is the most sensible way to merge the repositories without losing commit history?
I think we will have to be a to build separate packages within the monorepo. Components is already almost too big for jsdelivr to serve as a package.
- Would we keep the webextension and embed-lib as separate repositories? What are the pros and cons of this?
We can do it both ways but I think probably not. Maybe we can put webextension to the monorepo but I'm not sure. On my opinion, monorepo should contain packages that are building blocks of the same app(s). Since embed-lib and nemo-ui do not integrate components directly but load them dynamically they probably should be in a separate directory. Webextension integrates components within its build so they can be in a same monorepo; however, we can keep them separate as well: pulling updated components library into webextension is not a big deal. There are no complicated relationships between the two as there are between several libraries within components.
I think we should start with minimal amount of packages in monorepo possible and then see how it goes. I was thinking we can start to move packages into the monorepo one by one, starting from simplest ones, and then move more once we get experience and trust.
- What about service level libraries, like lexis-cs, and the user word and setting apis? I presume these will still remain separate codebases?
I think it's better to keep them separate. I would just separate a messaging service from LexisCS to break a dependency of Client Adapters on it.
3.What is the most sensible way to merge the repositories without losing commit history?
There are techniques for that that work in majority of cases. Below are some article about that: https://medium.com/@filipenevola/how-to-migrate-to-mono-repository-without-losing-any-git-history-7a4d80aa7de2 https://www.shopsys.com/how-to-merge-15-repositories-to-1-monorepo-keep-their-git-history-and-add-project-base-as-well-6e124f3a0ab3/
- I think we will have to be a to build separate packages within the monorepo. Components is already almost too big for jsdelivr to serve as a package.
I'm for it. We can tweak our architecture to make things more efficient. The big part of components is inflection tables data. If we'll move it to Lexis this will allow us to reduce components' size by 1MB at least.
If we'll try the monorepo, what approach shall use use for versioning packages within it (client adapters, components, etc.)? Shall they all have the same version or will we go with different ones? On my opinion, one version is simpler and makes sense because all libraries are part of the same entity, but I might be wrong.
@balmas, @irina060981: what do you think?
- Would we keep the webextension and embed-lib as separate repositories? What are the pros and cons of this?
We can do it both ways but I think probably not. Maybe we can put webextension to the monorepo but I'm not sure. On my opinion, monorepo should contain packages that are building blocks of the same app(s). Since embed-lib and nemo-ui do not integrate components directly but load them dynamically they probably should be in a separate directory. Webextension integrates components within its build so they can be in a same monorepo; however, we can keep them separate as well: pulling updated components library into webextension is not a big deal. There are no complicated relationships between the two as there are between several libraries within components.
I think we should start with minimal amount of packages in monorepo possible and then see how it goes. I was thinking we can start to move packages into the monorepo one by one, starting from simplest ones, and then move more once we get experience and trust.
This sounds like a good plan to me.
- What about service level libraries, like lexis-cs, and the user word and setting apis? I presume these will still remain separate codebases?
I think it's better to keep them separate. I would just separate a messaging service from LexisCS to break a dependency of Client Adapters on it.
I think I want to do this anyway. More on that soon, hopefully.
If we'll try the monorepo, what approach shall use use for versioning packages within it (client adapters, components, etc.)? Shall they all have the same version or will we go with different ones? On my opinion, one version is simpler and makes sense because all libraries are part of the same entity, but I might be wrong.
@balmas, @irina060981: what do you think?
I think 1 version is simpler. I would go with that until we have a clear reason not to.
Right now we're facing several development challenges. Some of them are described in #25, #23, #21, and alpheios-project/node-build#24, but those are not limited to that. The process that we employ now works, but would it be able to serve us in the future? With increased code complexity it might be hard and/or time consuming to use the existing process; as a result, code quality and development time may suffer.
Using those opportunities that are currently available to us it might be paramount to change/make corrections to the existing process so that it will not be a burden but a helping tool for the months to come.
After thinking about it for a while and studying best practices currently established I think the solution to our issues may come in a form of a monorepo with independent packages inside it.
Here is some background. Monorepo has some advantages and disadvantages. I will try to list all that are of importance for us as objectively as I can here so we'll decide if it's worth it. I personally think that in our situation the price we have to pay for it is much smaller than the advantages we will get. The information about monoreops is taken from Wikipedia and several other sources. I will list most interesting of them at the end.
Monorepo's advantages:
Monorepo's drawbacks:
Monorepos with separate packages This is when a monorepo has modules developed as separate packages hosted within a single repository, usually called
packages
. It allows to keep code modular. Each module can be published as a separate package to npm and used independently. Some examples of this are Babel and Jest. I think we shall employ this technique by keeping our existing packages separated or even maybe splitting is more (components can be a candidate) as it is easier with the monorepo approach. There are several tools that can help us with managing separate packages within a monorepo. The most established is Lerna and I think we should consider it first but there might be other approaches as well.Who uses monorepos? Many large open-source JS projects do including, but not limited to: Babel, Lodash, React, Angular, Ember, Meteor, Jest.
@balmas, @irina060981: Please let me know what your thoughts are on this. Thanks!
Some useful references: A Wikipedia page Repo style wars: Mono vs Multi Cross-repository Component Sharing using Mono-repo Multi-packages Architecture Building large scale react applications in a monorepo