GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

[RFC] Multiple repositories vs monolithic repository

Open Vincz opened this issue 5 years ago • 2 comments

Q A
RFC? yes

Hey guys! As we move forward to a more modular approach of the bundle and the code splitting, we will have to make a choice:

  1. To have one repository per package
  2. To have a monolithic repository including all the packages

The advantages of a monolithic repository is as follow:

  1. Only one repository (obvious right?).
  2. Shared configuration for analytic tools (phpstan, phpcs, Github CI)
  3. A common set of tests (possibility to test all packages at once if needed)
  4. Easier to maintain (issues management, etc...).

The problem is that currently, it is not natively supported by composer. But there is a few projects already using this approach (not sure how it works exactly). https://github.com/symfony/symfony (Symfony itself, we have a monolithic repository but also a synchronised repository by package)

Also, a bit of references and related packages: https://tomasvotruba.com/blog/2019/10/28/all-you-always-wanted-to-know-about-monorepo-but-were-afraid-to-ask/ https://beberlei.de/2015/04/11/monolithic_repositories_with_php_and_composer.html

Possible solutions: https://github.com/beberlei/composer-monorepo-plugin https://github.com/symplify/monorepo-builder https://github.com/shopsys/monorepo-tools

Let me know what you think about this.

Vincz avatar Feb 17 '21 08:02 Vincz

Hey Vinz, we working with a monorepos but using splitsh/lite will permit use to synchronize repository in readonly repos and keep all the benefit of composer (like Symfony). That the way we worked with GraphQLPhpGenerator and this bundle (itself a split of an internal project) .

mcg-web avatar Feb 17 '21 09:02 mcg-web

Awesome @mcg-web ! Would you mind to setup the initial repository with the different packages?

Vincz avatar Feb 17 '21 09:02 Vincz