With the use of yml files within Drupal it would be good if we can start using this as well.

I know that the current *.libraries.info is limited, but being able to extend it to maybe event replace the hook_library_info() with the libraries.yml file.

With this I could event see that we could depreciate the hook_library_info().

I think the new yaml file will look something like

library:
  library-1:
    title: 'Library One'
    website: 'http://example.com/library-1'
    version: 1.2 
    js:
      library-1.js:
    css:
      library-2.css:
        type:'file' 
        media: 'screen'

not sure if this would be quite right, but is an example of this.

Also as an added advantage, what would also be great is being able to use the built in PSR-0 class loader to load PSR-0 compatible libraries without any additional code would make implementing external libraries into Drupal much easier for other modules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gordon’s picture

Status: Active » Needs review
FileSize
1.15 KB

I have renamed this to libraries.info.yml which is inline with the info files.

Status: Needs review » Needs work

The last submitted patch, 0001-Issue-2058379-by-gordon-Added-Change-.libraries.info.patch, failed testing.

tstoeckler’s picture

Status: Needs work » Closed (duplicate)

Seems you already fixed that in #2058371: Upgrade Libraries API to 8.x which I'm about to commit. :-)
Still, thanks very much!

tstoeckler’s picture

Issue summary: View changes

Add PSR-0 information