Why GPM and not composer?

Hello, I’m new to grav. And i just wonder. Why is there even something like GPM? Why not use composer for plugins managment?

Composer is lovely, and yields a serenity only found with dependency-managers, but it is not all that easy to use for plugin- or theme-developers who already have little experience with version control. Also, packages within the GPM are all distributed as ready-to-go, so the installation only requires unpacking - not resolving dependencies. Thus the process does not depend on Composer, but only on Curl or Fopen within PHP.

I do agree, though, that the dependency-resolution of Composer would be a huge boon for the future of Grav’s ecosystem - but just like Git it takes some teaching.

I think that composer is much easier to understand than git. I think, dont’s using something just because it’s not super easy isn’t the best argument, and from user prespective, composer can be as easy as gpm. Composer (at least, what is needed for basic development) isn’t rocket science. And i would bet that anyone who can develop something with PHP met composer, at least as a user.

And when i look around, there are people demanding more advanced features in gpm. Like:

I think GPM will naturaly evolve to be more complicated, to by able to cover most of need features.

I really like Grav and it’s ideas, but GPM is more like reinventing wheel. For me it’s the single one thing, why i don’t use grav for my projects. I don’t think there can’t be developed something better than composer, but for project like grav, it would be overkill anyway.

Community around WP came up with https://wpackagist.org.

It would be really cool to integrate composer into grav. Or build gpm with composer as foundation. Wrap composer, to be more easily used, as gpm, but for advenced users, let it be composer.

(Last argument, A lot of deploy and CI system are prepared for composer.)

I would agree that GPM will likely end up developing in the direction of Composer, and there was a discussion specifically on dependencies. In regards to #1243, there are some solutions/suggestions lurking around, but there is not a final word on the virtue of caching. #1200 is now possible, but only with direct URLs to packages.

One reason I think GPM still is beneficial, is that there is an authoritative list of extensions known to work with Grav - some quality-control. However this list could of course exists even with composer-packages, and I also agree that Composer as the foundation makes a lot of sense.

As for the state of using Composer to release packages, it clearly has benefits, but currently only about 27% of all releases available for Grav has explicit dependencies. So currently, there is no particular benefit of applying Composer, but for the future it will make a lot of sense - its already how Grav installs itself from source, so it can definitely be done.

I think, for future, you don’t want to close gpm only for approved packages. As i understant it isn’t even closed right now (people can add custom gpm repositories to grav config, or i’m i wrong?)

As you say, you can always have list of approved plugins. But, for feature and project like this, is sometimes better, to have community decide what is good, have some repository with ranking system, and the most popular packages, you can quality check and approve.

I’m not saying like, right now switch to composer. I would like to propose change. I don’t know how grav development works, how are next steps decided, who decides it. But i think, it would be really cool, to aim bpm towards composer. Is there any official way to propose. Or should i just try to convert it, (core and basic plugins), make pull requests, and let community decide?

(I think convert core and basic plugins to be used with composer, can b achived in order of days (months for all packages). Because current system, is actualy quite compatibly designed.)

Hi @michalhona,

the GPM is closed since there exists only one (the official) Grav repository. If you want to add your themes and plugins, you usually have to file a ticket and it gets added. I personally asked or provided a PR in the past to allow custom GPM repositories as I think it is quite useful. However, @rhukster and others don’t like to see alternate repositories because (@rhukster: Correct me when I’m wrong) they interfere somehow with the plans the Grav Team has for Pro plugins and themes.

I’m sorry for my mistake about gpm. I couldn’t find more about it but what does lines in user/.dependencies mean? I thought you could pentencionaly add custom repositories for gpm.