User tests: Successful: Unsuccessful:
It's silly to use three http requests to load the basic jQuery framework files. Just combine them and load with a single request. So there are four possibilities:
Each of them also has a minified version. Depending on the options passed, one of these files will be chosen and only it will be loaded. No need to load three files.
Labels |
Added:
?
|
OK RE: above of course you don't have 2 jQuery files being loaded but the template override now fails which means you could have a different version of jQuery being loaded - which is just as bad.
Category | ⇒ | JavaScript |
I guess it depends on how jQuery is being overridden. There are several ways to do it with varying degrees of rightness. It seems to me that the most correct way is to actually override override the JHtml 'jquery.framework' function so that it loads whatever you want it to load, or nothing at all if you don't want to use jQuery. I don't think this causes a problem for any but the most wrong ways of overriding. People should avoid doing things the wrong way.
I agree that a build script would make maintaining these files a bit simpler but I don't think they get changed that often anyway.
there are many ways to reduce http requests. In this case, I would prefer to use a Joomla plugin (which could be found in JED) to do the job, or just build my apache/nginx server with pagespeed support to have minified and combined css and js
Please fix the codestyle and unittest errors that Travis is complaining about.
I can't say I fully agree with us manipulating the distributed files from a vendor, even if it's combining things into one file. IMO this is best left to a site implementor to decide on and not a core responsibility.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-27 22:03:38 |
Closed_By | ⇒ | wilsonge |
It seems to me that the most correct way is to actually override override the JHtml 'jquery.framework' function so that it loads whatever you want it to load
If you onyl want to change the version of jQuery, putting your own version into the correct override place in your template will be the simplest and most correct thing to do. Michael wrote once an excellent artiicle (https://www.babdev.com/blog/139-use-the-media-folder-allow-overridable-media) on his blog about that. No need for messing with JHtml at all.
@wilsonge is right that your PR would break that.
I don't think this works. Because in many template frameworks people override the jQuery file. If you do that but have the jQuery + migrate file loading suddenly you have two jquery files being loaded
As well practically I think this is a bad idea because we now have to update jQuery in 3 different places (6 if you include the minified versions) which is just asking for issues in the future
I agree having 3 http requests is non-sensical and something we should look to deal with in the future. But I don't think we can solve it b/c in 3.x - probably in 4 we should do this except do it in the build script or similar?