-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
To multi-repo or not #375
Comments
I'm a bit concerned about the fact that while we figured out some workaround for this problem for us, the same issue most likely will still exist for anyone who forks a couple of ckeditor5 repositories and needs the same thing. |
That's a really good point. It's the place where multi-repo works against the same DX as we have. There are a couple of things to consider, though:
So, I agree that in this specific scenario having multi-repo becomes an obstacle, but such scenarios should be less frequent in CKEditor 5. I've been also thinking whether we could implement time travel without a single history point, but unfortunately that would be really tricky. The history can be combined based on commit dates, but then you need to create a set of git commits describing these changes anyway in order to be able to use |
Part 2/3: #376 :D |
We started using Lerna and monorepo for https://github.com/ckeditor/ckeditor5-dev/ packages and it works fine there. That case is perfect for a monorepo, because we're the only ones who'll ever work more with these packages. However, we faced a minor, but an irritating issue with it – we can't now install dev version of these packages in ckeditor5 using package.json (it's possible with separate repositories using |
BTW, I don't remember whether this was mentioned, but we're struggling with this right now, so I'll repeat it – mono-repo isn't that nice to work with if you want to use a dev version of some package on, e.g., your CI server. For example, we can't easily install ckeditor5-dev-tests from a branch on Travis, because npm cannot install (AFAIK) a package from a specified branch + directory. So we need all these steps:
Instead of a single |
OK, it seems that nothing's gonna change here. We still use multi-repo and don't plan to change this :) I updated dev env guide some time ago if you want to know some more details on how to work with this architecture: https://github.com/ckeditor/ckeditor5/wiki/Development-environment. |
It's time we make some really final decisions. We've used multi-repo approach for the last two years and as we're closing to the release some of our decisions become irreversible. This will be one of them – whether we go with a multi-repo multi-package, single repo multi-package, or single repo single package.
Cool stuff
I've written an article in the past explaining our choice: https://medium.com/content-uneditable/why-we-chose-a-multirepo-architecture-for-ckeditor-5-54c7e50af1f5#.2a7c74lup
Summing up and adding few more thoughts:
<name>/src/
structure, while in a release they build the code to<name>/lib/
. This was pretty understandable (src is ES6, lib is ES5) and if I wanted to do the same I'd need to complicate the release process just a bit (still, it's more than usualnpm publish
).packages/<package-name>/lib
". So a dev version of Babel plugins is not available innode_modules/
? ;| After a while I think that what I needed might belerna bootstrap
.node_modules/
, then they start to conflict with other package deps. If separately, then what if one official plugin requires another official plugin? Is the latter also symlinked somehow or its stable version is always used? Dealing with npm and symlinks is the most hardcore part of the whole puzzle for me and you don't avoid that in a single repo.Bad stuff
Still, all these arguments should not convince you right away (unless you're an ideologist). What I've seen so far is that none of the options is perfect, but perhaps one of them is just unacceptable.
Let's try to go through all the problems that we had so far and see.
run
task). The only difference is that we need to commit them to each repos, but that we've got automated as well.And perhaps more...
Conclusions
For me the conclusions are pretty clear for now. It's more complicated to manage a multi-repo, but not impossible and when you have multiple packages you need to automate a lot of things anyway. OTOH, multi-repo gives you things which a single repo doesn't – that the official environment can be built in a generic way useful for everyone and that multiple packages are really multiple packages, not just multiple npm entries.
Feel free to disagree with me.
There are still two topics which I'd like to review more closely – issue management and general developer experience with CKEditor 5. Both of those topics are a bit related to general multi-repo considerations, but are non-blockers.
Other thoughts
While searching for some articles I found https://github.com/mixu/gr. It looks like a big part of our
ckeditor5-dev-env
. I always wanted to build a general tool for multi-repo management. This would be more time consuming than developing something totally custom, but may turn to be helpful in long term if the project is used by others. I'm only unsure whether I like the gr's code base, so I'd be more willing to just take it as an inspiration.The second thing is that after I wrote the article on Medium, I found that D3 and ProseMirror turned to multi-repos as well (perhaps I inspired someone :D) and Aurelia was released something around that moment too. I also remember that there was one more big project which chose this path, but I can't recall now. So we're not alone here ;>.
And last but not least, I also realised that e.g. Babel is a different project than CKEditor 5. CKEditor 5 will never be so open to contributors because we have different approach to OSS. We've our strict rules about what can get into the official code base there's a much higher need to develop 3rd party solutions (plus there are closed source addons too). So what may work for others may not work for us.
The text was updated successfully, but these errors were encountered: