On - Drupal 8 - what are best practices for installing external libraries?

In what subdirectory are people installing external libraries on Drupal 8?
- Note that practices for the location of contrib modules and so on have also apparently changed for D8.

How are module installers detecting external libraries and their locations, and configuring them on Drupal 8?

Comments

VM’s picture

https://www.drupal.org/node/2605130 & http://kevinquillen.com/drupal/2016/01/30/adding-libraries-to-drupal-8 may aid. Based on my read the concept of 'best practices' is still being fleshed out.

sprite’s picture

Requiring the "composer" tool to install components into Drupal will severely limit the drupal user audience.

Not everyone has SSH access to their Drupal installation environment.

Turning Drupal into a programmer only oriented tool, just seems really foolish.

Please return to an design model and module installation system that doesn't involve running CLI shell commands on a unix terminal.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

Jeff Burnz’s picture

I think there are two comments in the issue VM has linked to that are pretty bang on what will ultimately pan out to be our "best practices":

https://www.drupal.org/node/2605130#comment-11089417
https://www.drupal.org/node/2605130#comment-11091343

As you will note it will depend on what the library is, php, js, etc? PHP should be handled via composer, and theme based assts via the theme libraries, probably using whatever you want like Bower, Node, Bundler etc or just including them in the theme, but modules perhaps will use the Libraries API when it's ready.

I think #57 John Albins comments are a good guide, those ideas just make good common sense.

With regards to detecting libraries, well, thats got to be Libraries API and some hook/method from that module, I havent look at the Libraries API module but one assumes you can get data such as version etc, which of course you'll really want.

sprite’s picture

I requested SSH access to hosting server and got the following response:

To consider your application for SSH access we need to know the full name, address, telephone and email of the proposed user, we also require an email or fax copy of official identification of the user (ID card, Passport or Driving License).

Any SSH access will be closely monitored, please note any use of the SSH access against our Acceptable Usage Policy (AUP)result in immediate termination of your account.

They actually want a copy of my government ID just to give me ssh access to my account on their servers.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

Jeff Burnz’s picture

It's becoming the norm these days, too many fake accounts, if you're in the EU they'll often ask for a copy of your passport. If it's a reputable provider then I'd call it a good thing, rest assured they're looking at everyone in their neighbourhood and therefor safeguarding you as well.

Hadi Farnoud’s picture

why not just add them to your theme directory?

sprite’s picture

WTF?

Seriously?

Get real.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

Jeff Burnz’s picture

@sprite I don't know who you are replying to, but you can take your appalling attitude to another forum. Speak like that to a fellow member of our community again and I'll personally report it as a code of conduct violation. Take a chill pill.

Jeff Burnz’s picture

@Hadi Farnoud yeah, for sure if it's specific to your theme, no problem. For some modules it can make sense to share a library/resource, for example lets say the new Media modules on D8 all want to leverage a PHP library, it would make sense to have that in one place, e.g. /vendor, or perhaps jQuery update module wants all i'ts jQuery versions in one central place, e.g. /libraries