Hello,

I have a php class that generates an HTML5 audio player with support for 
WebVTT captions and chapters and is very accessible.

It's a personal class, I am not distributing it as FLOSS and I probably 
won't, but it uses jQuery and its own JavaScript and it's own CSS (in an 
external file, I do not allow the style attribute in my code) and its own 
webfont that is used kind of like an image sprite but better IMHO than 
using an image sprite (for the interface buttons).

Anyway one of the things that literally bothers me about so many web 
applications is they bundle scripts many of which (e.g. jQuery) are third 
party to the web application.

I was thinking it would be good for something *like* PSR-4 to exist for 
non-php resources.

What I mean is Web Application A requires jQuery >= 3 but doesn't need to 
bundle it itself, where the bundled often often becomes stale.

Instead there could be a PSR class interface defined so that when the web 
application needs to add jQuery to the (x)html document head - it could call

$whatever::addJavaScript("jQuery:jQuery", "3.0");

Class $whatever would then look in virtual vendor namespace "jQuery" for a 
script that meets the name definition of "jQuery" with minimum version 
"3.0" and returns the appropriate URI to add to the script node.

For people who use composer it may not make much difference, they will end 
up with stale version over time (or initially if a composer.lock file is 
used) just like they often end up with stale unpatched vulnerable versions 
of class libraries - but for those who actually update their installs 
periodically (or use an actual package manager which composer is not) it 
could be of a great benefit.

I already do something similar for my own private web apps, it could IMHO 
be a huge benefit if there was a standardized way of doing it.

Thoughts?

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/7c6c34a4-9bfc-4742-8bea-3a5a257e7eb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to