? Success

User tests: Successful: Unsuccessful:

avatar Narimm
Narimm
14 Feb 2014

This feature will ad the ability to pull core files that are are hard coded in the Joomla framework from a third party content delivery service. The system will be off by default and is backward compatible with template designs for administration. The system will focus initially on the larger JS files that we include from external packages such as jQuery and Mootools. But can be expanded as needed to include other CORE external packages. It is NOT intended to replace systems using external CDN's for full content delivery. I think the benefits of using CDN's or NOT using them can be an individual decision.

The current extent of this feature is allowing

jQuery
JQuery-migrate
MooTools core

to be sourced from a third party provider.

This feature requests follows some discussion on Joomla CMS Development List
https://groups.google.com/forum/?hl=en-GB#!topic/joomla-dev-cms/l_rXxF9Ev68

avatar Narimm Narimm - open - 14 Feb 2014
avatar phproberto
phproberto - comment - 14 Feb 2014

Can you please check for code style errors?

Thanks!

avatar Bakual
Bakual - comment - 14 Feb 2014

Please see our coding standards here: http://joomla.github.io/coding-standards/

avatar Narimm Narimm - change - 14 Feb 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-02-14 12:39:15
avatar Narimm Narimm - close - 14 Feb 2014
avatar Narimm Narimm - close - 14 Feb 2014
avatar Narimm Narimm - change - 14 Feb 2014
Status Closed New
avatar Narimm Narimm - reopen - 14 Feb 2014
avatar Narimm Narimm - reopen - 14 Feb 2014
avatar Narimm
Narimm - comment - 14 Feb 2014

You would think GItbug would give a little warning if you accidently click close.

avatar Narimm
Narimm - comment - 14 Feb 2014

Thanks Bakual - have Joomla coding standards loaded into codesniffer....mind you it generates about 1000 errors and warnings for those files... unrelated to my code.

avatar Bakual
Bakual - comment - 14 Feb 2014

Thanks Bakual - have Joomla coding standards loaded into codesniffer....mind you it generates about 1000 errors and warnings for those files... unrelated to my code.

Yeah, that's why we have started the CodeStyle initiative :smile:

You can ignore everything not related to your code. However the lines you touch in this PR will have to follow the codestyles. Otherwise our CI Jenkins will not be pleased and refuses to merge it into master.

avatar Narimm
Narimm - comment - 16 Feb 2014

I would like to try and get this one accepted for 3.3. Any support from the PT. Some testers would be appreciated.

avatar Bakual
Bakual - comment - 16 Feb 2014

Personally I like the idea to support CDNs. However I think the implementation is a bit to specific for a global parameter. It's only targetting jQuery (and MooTools, which we want to remove anyway).
I would love to see a more generic approach for that.

An idea which came to mind is adding a plugin trigger to JHtml::Script() which runs before actually loading the file. Like onBeforeLoadScript or something. This event would be able to return a path for the file to load.
This way you could create a simple plugin which checks the filename and returns an alternative CDN path if it the filename matches the pattern. That would then work for all scripts, not only jQuery.

avatar brianteeman
brianteeman - comment - 16 Feb 2014

After applying the patch something goes wrong with the cookie description

screenshot 2014-02-16 10 54 41

avatar beat
beat - comment - 16 Feb 2014

Implementation seems overly complicated, while with a generic approach as suggested by @Bakual it would be much easier. Actually, several third-party joomla plugins as well as templates do this already. So while the idea is nice, the proposed patch seems overcomplicated to me.

Agreeing with all that definitely it is not a setting to turn on by default in the age of global tracking.

avatar Bakual
Bakual - comment - 16 Feb 2014

@brianteeman Not only there, every fieldset which is called after the cdn one.
That's actually a bug in the way we call this layouts. For some reason we set the description (and some other properties) manually to $this->description before we pass the whole $this to the layout. Instead of just passing the $form or even better only the fieldset itself.
Now since the PR defines a $this->description, this stays there till it get overwritten again for a later fieldset. In our case that never happens.

avatar Narimm
Narimm - comment - 16 Feb 2014

I am going to close this pull request - I tend to agree with Beat in regard to it being overly complicated...like all things it wasnt when I started but then became so as I looked at how J called its core resources...and my original aim was avoiding some sort of preg_replace hack. done at render.

My target was not to enable rendering of all js and other scripts as a configurable option just the core which J itself defines as Jquery and (yes while it will be removed) Mootools.

The truth is you dont need a more generic approach because the core files are fixed. In fact if the aim is to use minimal externally maintained libraries. The list is unlikely to grow.

They might be overwritten later by a template or something but the aim here was to give the end admin the ability to collect these BIG assets from a CDN.

Template writers can call the assets from a CDN by default, as long as they avoid the Joomla framework.. which is crazy..

Enough said - I will look at the method Bak mentioned and work at that...any direction appreciated.

I think the simplest temporary fix Bak for the bug is to reset the name, description after the output is rendered. - shall I open a pull

avatar Narimm
Narimm - comment - 16 Feb 2014

Quick patch for config templates
#3124

avatar Narimm Narimm - change - 16 Feb 2014
Status New Closed
Closed_Date 2014-02-14 12:39:15 2014-02-16 15:19:53
avatar Narimm Narimm - close - 16 Feb 2014
avatar Narimm Narimm - close - 16 Feb 2014
avatar Narimm
Narimm - comment - 16 Feb 2014

Can anyone tell me cause I have been looking but does auto have a value defined in Joomla's context...I havent been able to make heads or tails or phproberto's suggestion to uses = auto instead of = null

avatar Bakual
Bakual - comment - 16 Feb 2014

Can anyone tell me cause I have been looking but does auto have a value defined in Joomla's context...I havent been able to make heads or tails or phproberto's suggestion to uses = auto instead of = null

It doesn't have a special meaning imho. But it would be checked as "true" making your code a little bit simpler than explicitely checking for "null"

avatar Narimm
Narimm - comment - 17 Feb 2014

While no longer relavent, are you saying if I set a argument to default to
auto. Its value will check true by default....?
On 17/02/2014 1:39 AM, "Thomas Hunziker" notifications@github.com wrote:

Can anyone tell me cause I have been looking but does auto have a value
defined in Joomla's context...I havent been able to make heads or tails or
phproberto's suggestion to uses = auto instead of = null

It doesn't have a special meaning imho. But it would be checked as "true"
making your code a little bit simpler than explicitely checking for "null"

Reply to this email directly or view it on GitHub#3103 (comment)
.

avatar Bakual
Bakual - comment - 17 Feb 2014

While no longer relavent, are you saying if I set a argument to default to
auto. Its value will check true by default....?

You checked like this: if($useCdn === null || $useCdn === true) which means you either want it to return true if true has been passed or the default value null has been used.
If you just use if ($useCdn), PHP will return true for almost any value except 0, false, null and an empty string. It's not a strict boolean check. as soon as the variable contains a value which doesn't translate to a boolean false, it will return true.
That means if you default value would be auto (or any other random string), the check returns true.

Add a Comment

Login with GitHub to post a comment