wppunk / WPPlugin

Boilerplate for WordPress plugin using autoload, coding standard, webpack, PHP/JS tests, etc.
MIT License
147 stars 25 forks source link

Dependency conflict #8

Closed JoyceBabu closed 3 years ago

JoyceBabu commented 4 years ago

Right now the the plugin requires both the original vendor/ directory (for autoloading) and the dependencies/vendor directory for the prefixed dependencies. The unused un-prefixed dependencies may still conflict with other plugins, that depends on a separate version of the the same package.

Google site kit solves this by generating a separate classmap based autoloader that does not require the original vendor directory.

Or am I missing something?

wppunk commented 3 years ago

@JoyceBabu Do you have any ideas on how to fix it? It looks like the https://github.com/coenjacobs/mozart package can fix it, and we can use it instead of scoper.

JoyceBabu commented 3 years ago

I don't have any experience with mozart. In fact, this is the first time I am using scoper too.

I have seen better reviews for Scoper, compared to Mozart. But if Mozart has built-in support, then it might be better suited for the current project. Because, it would be very difficult to solve this generically.

In my case, I went with Google Site Kit solution.

wppunk commented 3 years ago

In release 1.1.0, we'll move from Dependency Injection Container by Symfony to Auryn because Auryn has only 11 files, works without any config files, and super straightforward. I've also added the composer build script that can help create the prefixed composer dependencies and delete them.

@JoyceBabu If you want, you can test it. The code is already in the main branch.