Skip to content
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

Implement Support For Multiple Namespaces #98

Open
alexstandiford opened this issue Dec 7, 2020 · 0 comments
Open

Implement Support For Multiple Namespaces #98

alexstandiford opened this issue Dec 7, 2020 · 0 comments

Comments

@alexstandiford
Copy link

A disadvantage to using Composer at the plugin level is if multiple plugins are running the same dependency, it will load in each of those versions separately. Of course, this is great when there are different versions, however, it can be wasteful if multiple plugins are using the same version of a dependency in a plugin.

On personal projects that do not distribute, I have been putting composer dependencies for all of the plugins and themes on that site in a single composer.json in the mu-plugins directory, and then requiring the autoloader as a muplugin.

This is nice because it sets up the autoloader before the plugins get loaded in, and provides a relatively straightforward way for multiple plugins to use dependencies for the same version.

However, updating plugins is still a very manual process, as everything that uses those dependencies needs updated and tested should I need to upgrade to a newer version. This creates a barrier since there's potential for extensive additional testing to be implemented just to use a newer version of a plugin.

If it were possible to configure multiple namespaces in Mozart, I think this problem could be resolved at the mu-plugin level. With that, you could theoretically create multiple namespaces for different versions of a dependency that needs to run on a single installation of a site.

I would consider my next statement out of scope for this issue (and perhaps Mozart, altogether) but from that, you could potentially build a script that gathers up all dependencies from the composer.json files in each active plugin, and generate all dependencies across plugins on a site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant