[RFC|Merged] Include and use jQuery (originally for 3.2)

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
DarkBeing
Registered User
Posts: 83
Joined: Sun Jul 19, 2009 2:32 pm
Location: Currently Estonia
Contact:

Re: [RFC] Include and use jQuery

Post by DarkBeing »

I am also in favor of a localized copy of jQuery or at least a switch where the user can decide if he wants to use the local version or the Google hosted one. To add what others already said in favor of a localized version, there is also those phpBB boards to be considered whose server stands in a country where Google tends to get in trouble with the local government (China), Goggle may be still up, but the access to Google from there might not be.

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] Include and use jQuery

Post by MattF »

If it hasn't been said before, I'll say it now:

PLEASE ADD JQUERY to PHPBB!!!

More and more MODs and styles are using Jquery. This can be very frustrating to board admins, as they could end up with multiple inclusions of Jquery as well as multiple/redundant Jquery files that came with their MODs or Styles, and different versions - it can get real messy.

If phpBB added Jquery to the core, not only could phpBB make use of it, but it would mean no MODs or styles would have to include it, thus eliminating redundant files and header-inclusions of the script.

I think the best solution would also be to simply include it directly from Google's API. That way, phpBB does not have to supply the Jquery library files (licensing conflicts??) and whenever Jquery updates, phpBB simply needs to update the link to Jquery in the headers. Not to mention including it through Google means you get to make use of Google's vast CDN, which in many cases is better than including it directly from your own server.

In other words, all phpBB has to add the following line to the overall_header.html:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jq ... "></script>

With such a simple change, I really don't see why it can't be added to 3.1 or even 3.0.8!

FWIW: I have run a large (Jquery intensive web2.0) website for years using the Google hosted Jquery, and have never personally seen nor been alerted to any issue that has every made me feel the need for a "fallback". Google simply does not go down on a world-wide scale. :lol:
Has an irascible disposition.

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] Include and use jQuery

Post by igorw »

VSE+ wrote:licensing conflicts?
jQuery is dual-licensed under under the MIT license and the GPL, which are both compatible with the GPL. http://jquery.org/license

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Include and use jQuery

Post by callumacrae »

This is a good idea, I think it should be implemented :)

I can see it killing a lot of MODs XD

~Callum
Made by developers, for developers!
My blog

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Include and use jQuery

Post by DavidIQ »

callumacrae wrote:I can see it killing a lot of MODs XD
I see quite the oposite. It would add more incentive to create jQuery-dependent MODs :P
Image

GravityDK
Registered User
Posts: 36
Joined: Sat Aug 28, 2010 10:19 am

Re: [RFC] Include and use jQuery

Post by GravityDK »

I would like to see it included too.
Google's hosted version is going to be more reliable than anything, plus faster (parallel download since it's a different domain to other files, and their CDN is fast and geo-aware).

Truemedia
Registered User
Posts: 5
Joined: Sun Aug 29, 2010 1:06 pm

Re: [RFC] Include and use jQuery

Post by Truemedia »

I think jquery is a great library, and is considered the most popular and usable almost as an industry standard, but I think all the pro and cons of several javascript libraries should be compared for overall purpose and functionality which suits phpbb the most, and is likely to have constant features that are unlikely to suddenly pose either a security threat, or make certain parts of the website incompatible.

For example how each framework would perform ajax requests of all types the least complicated and most consistent, which has the best ui options, accessing the dom and changing it (obviously a strong point for jquery), plugin support, event handlers, speed, and in depth documentation so that the code can be treated as an open system, rather than a blackbox solution.

Although I do think either jquery, dojo, or sencha (most people will know if from extJS) really are the best solutions to consider for implementation.

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] Include and use jQuery

Post by igorw »

Good point, I have added an "Alternatives" section to the first post.

If somebody has experience with many different libraries it might be interesting to get some insight. Since jQuery is such a buzzword, most people use it exclusively, I am guilty of this myself. The amount of people (developers and modders) familiar with it is a key factor. You are the first to bring up alternative libraries. :)

Jhong
Registered User
Posts: 50
Joined: Tue Dec 26, 2006 3:28 pm

Re: [RFC] Include and use jQuery

Post by Jhong »

Yes to including jQuery :-)

No to loading from Google (or another CDN). While google's servers may be reliable, my connection to them is not. Particularly here in China, various Google services are often arbitrarily blocked. All JS should be served from the phpBB instance itself.

The loading needs to be overridable by mods and themes.

J

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] Include and use jQuery

Post by MattF »

Jhong wrote:Yes to including jQuery :-)

No to loading from Google (or another CDN). While google's servers may be reliable, my connection to them is not. Particularly here in China, various Google services are often arbitrarily blocked. All JS should be served from the phpBB instance itself.

The loading needs to be overridable by mods and themes.

J
You bring up an interesting point for China. Well, in that case, how about Microsoft, they offer Jquery on their CDN too:

Code: Select all

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
Has an irascible disposition.

Post Reply