Hello Alice

Are you familiar with the likes of npm (node package manager - 
https://www.npmjs.com/ <https://www.npmjs.com/>) or yarn (which is another 
(mostly) JavaScript package manager - https://yarnpkg.com/en/ 
<https://yarnpkg.com/en/>)?

They work in much the same way as composer does, in that you can add (require) 
packages, and save those to a package.json file which records the package and 
the version which you have installed. In much the same way as you can do 
composer install, you can also do yarn install, which will read package.json, 
install all of the dependencies, and then create a yarn.lock file (same purpose 
as composer.lock).

You can then use those assts directly, or there are then tools like web pack 
(https://webpack.js.org/ <https://webpack.js.org/>) which you can use to 
‘compile’ those into ‘bundled' assets for deployment in your solution.

>From what I can gather from your ‘wish’ below it’s likely that these existing 
>‘front end’ dependency managers will cover what you’re trying to achieve.

Hope this helps
Steve



> 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 
> <mailto:php-fig+unsubscr...@googlegroups.com>.
> To post to this group, send email to php-fig@googlegroups.com 
> <mailto: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
>  
> <https://groups.google.com/d/msgid/php-fig/7c6c34a4-9bfc-4742-8bea-3a5a257e7eb5%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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/D3C6E186-963D-4798-B22B-D1BAAE0C943C%40msdev.co.uk.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to