felixwahner / TextformatterOEmbed

Textformatter OEmbed for processwire
MIT License
5 stars 2 forks source link

Remove Dependencies from module #5

Open gmclelland opened 8 years ago

gmclelland commented 8 years ago

Hi Felix,

Would you consider removing the dependencies included in this module?

Dependencies are better handled with composer. In fact, this is direction that Drupal is going see https://www.drupal.org/blog/drupal-8-will-no-longer-include-dev-dependencies-in-release-packages. I believe the next version of the jumplinks module will make use of composer as well https://github.com/rockettpw/jumplinks/issues/14.

http://processwire.com/blog/posts/composer-google-calendars-and-processwire/#using-composer

This also might prevent future errors from happening with Processwire's new File Complier...namespace errors and file compilation errors.

Maybe just state in the readme.txt what versions are required? For example https://github.com/ryancramerdesign/GoogleClientAPI.

Basically after the vendor folder is removed, you would also remove require_once 'vendor/autoload.php'; and I think that is it.

What do think?

felixwahner commented 7 years ago

Hi Glenn,

Yes I considered this but rather do a "PW3" Version / Fork of TextformatterOEmbed to ensure sites still running pw2 won't break.
I do have some experience with composer but the way pw2 modules are installed made it impossible to handle dependencies the way they are meant to be used. Do you know if installing modules (in pw3) via the admin interface still works when dependencies have to be fullfilled via composer?

gmclelland commented 7 years ago

Do you know if installing modules (in pw3) via the admin interface still works when dependencies have to be fullfilled via composer?

No, it won't work via admin interface. People will have to follow your instructions and manually edit their site's composer.json and then run composer install to download the dependencies. I think this is a problem other CMSes that provide module installers as well.

Yes I considered this but rather do a "PW3" Version / Fork of TextformatterOEmbed to ensure sites still running pw2 won't break.

How about using different branches? This is how Drupal does modules. I have more of a Drupal background. I'm somewhat new to Processwire. Here is the documentation page for using Composer with a Drupal module https://www.drupal.org/node/2514612

Typically you have branches for each major version of Drupal Core.

When stable releases are ready, new releases are tagged. Example 7.x-1.13

Here is what an example module page looks like https://www.drupal.org/project/commerce

For processwire you could do branches for:

Hope that helps