[RFC|Merged] Use Google's jQuery
Re: Use Google's jQuery
Oh alright. I will create the ACP option to choose local or CDN. But I will not do the versioning since that would require including all those versions as local files with phpbb, and would be a bit excessive IMHO.
Has an irascible disposition.
Re: Use Google's jQuery
The version requested from a CDN should match the version we have in the tree.
We should try to prevent a situation where one of the chosen CDNs does not have a version that we ship (at some point in the future).
We should try to prevent a situation where one of the chosen CDNs does not have a version that we ship (at some point in the future).
Re: Use Google's jQuery
We will only allow the use of the version from CDN's that equals the version we are shipping.
My question is, we need to store the version as a variable or constant somewhere. Where is the best place/way to do that?
I think we could either:
1) hard-code the version numbers into the function that creates the links to the various CDNs
2) Define it as a constant
3) Store it as a config variable in the database
The question here is really, what is the best method to use to ease the update process of phpBB? Where will the dev team remember and know where to find and change this version number when they also update the hard-copy of jQuery that is included?
My question is, we need to store the version as a variable or constant somewhere. Where is the best place/way to do that?
I think we could either:
1) hard-code the version numbers into the function that creates the links to the various CDNs
2) Define it as a constant
3) Store it as a config variable in the database
The question here is really, what is the best method to use to ease the update process of phpBB? Where will the dev team remember and know where to find and change this version number when they also update the hard-copy of jQuery that is included?
Has an irascible disposition.
Re: Use Google's jQuery
I think a constant would be the best approach.
Re: Use Google's jQuery
OK, so I will define the constant in constants.phpOleg wrote:I think a constant would be the best approach.
Has an irascible disposition.
Re: Use Google's jQuery
Here it is.
ACP option to select Localhost, Google, Microsoft or jQuery CDNs.
Located in ACP under Board Features -> Load Settings
Also has a fall back to the local copy included with phpBB if the CDN fails, or if the board is being used offline.
Pull Request: https://github.com/phpbb/phpbb3/pull/389
Tracker: http://tracker.phpbb.com/browse/PHPBB3-10390
ACP option to select Localhost, Google, Microsoft or jQuery CDNs.
Located in ACP under Board Features -> Load Settings
Also has a fall back to the local copy included with phpBB if the CDN fails, or if the board is being used offline.
Pull Request: https://github.com/phpbb/phpbb3/pull/389
Tracker: http://tracker.phpbb.com/browse/PHPBB3-10390
Has an irascible disposition.
Re: Use Google's jQuery
This really seems like the kind of configuration settings we want to avoid. We all know that the ACP is scary because of all of the options. So if we add this, the UI needs to be simple. Something among the lines of: "Serve jQuery from CDN: ON/OFF". And we choose one, that we will support. The user simply does not want to worry about which CDN to choose.
Also, this must be disabled by default. The privacy issue and the issue of including remote javascript make this a MUST opt-in.
Also, this must be disabled by default. The privacy issue and the issue of including remote javascript make this a MUST opt-in.
Re: Use Google's jQuery
Thanks!VSE+ wrote:Here it is.
Thinking about Igor's point, I tend to agree that just a yes/no would be nicer for the ACP. But then the question is: which one do we pick? We can probably still have a config variable in the database (for our future about:config like config editor) that stores the actual CDN URL or something along those lines. So someone who really wants a different CDN, can pick a different one through the db.
What do you think?
Yup, that looks good, thanks.VSE+ wrote:Also has a fall back to the local copy included with phpBB if the CDN fails, or if the board is being used offline.
Re: Use Google's jQuery
"localhost" is incorrect for just about all live boards. I would suggest something along the lines of "included" or "bundled" copy instead of "localhost" and change the question to "Use the included/bundled copy of jQuery hosted on your server or use jQuery hosted by a third-party CDN", which is perhaps longer but more reflective of the actual option.
Note that the fallback option is going to be useless in cases where the browser never gets to it. Firefox will hang forever/infinitely loop in certain network conditions on an inline <script> tag like the one used for the cdn, never executing anything after it in the markup.
Note that the fallback option is going to be useless in cases where the browser never gets to it. Firefox will hang forever/infinitely loop in certain network conditions on an inline <script> tag like the one used for the cdn, never executing anything after it in the markup.
Re: Use Google's jQuery
Agreed, but looking at the code this seems to be the case?igorw wrote: Also, this must be disabled by default. The privacy issue and the issue of including remote javascript make this a MUST opt-in.