| Q | A
| ---------------- | -----
| RFC? | yes
| Sylius version | ALL
Currently, the Sylius plugin manual dictates NOT using Sylius in the name: http://docs.sylius.org/en/latest/plugins/creating-plugin.html (at the bottom). It doesn't clearly state how to name the repository of a plugin, but most plugins until now also exclude Sylius from the repository name. The composer.json states type sylius-plugin, but that's only discoverable through Packagist search: https://packagist.org/search/?type=sylius-plugin.
On one of my plugins I got an issue filed to rename the plugin to something more recognisable, basically adding Sylius to the naming - which I can only agree with: https://github.com/stefandoorn/google-tag-manager-enhanced-ecommerce-plugin/issues/13.
I see multiple benefits from renaming plugins to include the Sylius name:
Sylius. Seeing the name more around make people wonder what it is and does. sylius_ prefix in the configuration files. SitemapPlugin only would result in sitemap key, whereas SyliusSitemapPlugin would result in sylius_sitemap which looks less confusing for me (and reduces potential conflicts).Proposed changes:
sylius- and end with plugin. E.g.: sylius-sitemap-plugin.SitemapPlugin, because as soon as a Sylius user is using it it's rather clear. Alternative for namespacing change:
SyliusSitemapPlugin to make it even more clear inside the code that you are using a Sylius specific thing - instead of something Symfony wide of even PHP wide. StefanDoorn\SyliusSitemapPlugin.I "vote" yes for the repository naming rules. you had me at Google SEO.
for Namespacing, I would be interested to learn how is this impacting current users of the plugin - isn't this a BC break?
The additional benefit would be to have sylius_ prefix in the configuration files. SitemapPlugin only would result in sitemap key, whereas SyliusSitemapPlugin would result in sylius_sitemap which looks less confusing for me (and reduces potential conflicts).
As for namespaces, I think we should follow PSR-0 / PSR-4 and always include vendor name in the first one so StefanDoorn\SyliusSitemapPluginit is.
I'm not sure how it works from trademark-related perspective so I'd leave it for @pjedrzejewski - it wouldn't be a bad idea to create some sort of explicit trademark policy (like the Symfony one).
@gabiudrescu changing the namespace is a BC break indeed (without providing any deprecation layer first), but plugins do not need to follow Sylius' release cycle, so it's perfectly fine to release new major version then.
@gabiudrescu @pamil Yes, this might lead to quite some BC breaks if we start renaming namespaces etc.
@pamil Good one with config naming! I'll edit the RFC to include this one.
Everything in this thread makes sense to me. :) @stefandoorn Could you open a PR to the documentation?
Sure @pjedrzejewski, will do that later this week.
Submitted a PR in #8903. I hope I took all feedback into consideration. Only thing I've adjusted is the repository name, as it now simply reflects the class name / namespace name instead of another format. I think this is easier. Feedback is welcome.
Next to this, a PR should be opened against the PluginSkeleton to rename things in there also probably I guess - but not 100% sure about that.
Most helpful comment
Sure @pjedrzejewski, will do that later this week.