[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
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: [RFC] Include and use jQuery

Post by ToonArmy »

VSE+ wrote:
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>
The point still stands. They block things arbitrarily, there is no chance of predicting.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] Include and use jQuery

Post by keith10456 »

I'm all for JQuery.

As previously stated, many mods use it and adding it to the default will help prevent conflicts.

However, I'm against relying on Google or any other 3rd party. Security and trust are the main issues. Let it reside on the individual server.

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

Re: [RFC] Include and use jQuery

Post by igorw »

keith10456 wrote:As previously stated, many mods use it and adding it to the default will help prevent conflicts.
More details and actual links for verification would be nice. :)

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 »

Hmm, I just tested out Invision IP.Board.

They provide an option in the Admin section that lets you choose to have javascript files (they use scriptaculous and prototype) load from Google's servers or from your own server.

Kind of a nice option. Maybe phpBB could implement it that way. In terms of html output, bandwidth, and speed, loading from Google would be best. Of course, if China is an issue for your particular situation, you could choose to have them loaded from your own servers instead.

They also have an option to use regular or Minified javascript and CSS. That would also be a good feature to see in phpBB. :D
Has an irascible disposition.

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 185
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: [RFC] Include and use jQuery

Post by Marc »

eviL3 wrote:
keith10456 wrote:As previously stated, many mods use it and adding it to the default will help prevent conflicts.
More details and actual links for verification would be nice. :)
I'm currently working on this MOD:
http://www.phpbb.com/community/viewtopi ... &t=2101869

Problems occur if you already have jQuery included and include it again, i.e. if your style already uses jQuery and you include it for example by using my MOD.

That will result in a Stack overflow error in Internet Explorer. Currently the only way to prevent this is by checking if the jQuery functions already exits. If jQuery would be included by default, you wouldn't have to spend time checking if jQuery is loaded.

Also, jQuery would help prevent issues with browsers. For example if your javascript works for Firefox, it might not work in IE or Opera. ;)

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

Re: [RFC] Include and use jQuery

Post by Truemedia »

I first thought Dojo would be better for phpBB because it has more resources and tools for styling themes and UI, aswell as DOM and AJAX stuff that would not doubt be used by developers, and it is very nicely documented.

Although the fact that jQuery is a lot more familliar to most people may be another reason to avoid it.

Although I would encourage designers and developers to look at the features )http://www.dojotoolkit.org/) dojo offers. It seems more suitable in terms of features that phpbb would actually use, and plugins would be simpler. A big problem that could arise if phpbb used jquery in future would be jquery plugins. They would have to be optimized for phpBB hooks, layout, and fitting in code.

Looking at a lot of current jquery plugins they could seriously mess up your layout, cause javascript errors for other plugins, and possabily open vunerabilities. Not that code using dojo couldn't do this but Jquery is much more prone to it. Just something to seriously consider.

Nelsaidi
Registered User
Posts: 122
Joined: Tue Nov 11, 2008 5:44 pm

Re: [RFC] Include and use jQuery

Post by Nelsaidi »

IMO popularity is important, getting developers to learn Dojo to use some javascript isnt the best way forward - jQuery is very popular and this should be a reason to use it. I understand you may be thinking about the Apple AppStore effect thing where making an app for the iphone is so easy alot of the apps are useless, to be honest because there is more to a plugin than javascript this shouldnt be the case.

What would hooks have to do with this? jQuery would let everyone do hat they do know with so mch less lines of javascript, and more effectively.

Its easier to code efficiently with a framework as opposed to pure javascript, so inclusion of some framework would be good. jQuery would be the best imo for functionality, popularity and ease of use.

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] Include and use jQuery

Post by keith10456 »

igorw wrote:
keith10456 wrote:As previously stated, many mods use it and adding it to the default will help prevent conflicts.
More details and actual links for verification would be nice. :)
Off the top of my head a couple of my mods by Ian use Jquery. So does the Instant Messenger mod.

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 »

It won't matter for 3.1 or 3.2 anyways since none of those MODs are going to work without significant changes. ;)
Image

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: [RFC] Include and use jQuery

Post by ToonArmy »

VSE+ wrote:Hmm, I just tested out Invision IP.Board.

They provide an option in the Admin section that lets you choose to have javascript files (they use scriptaculous and prototype) load from Google's servers or from your own server.

Kind of a nice option. Maybe phpBB could implement it that way. In terms of html output, bandwidth, and speed, loading from Google would be best. Of course, if China is an issue for your particular situation, you could choose to have them loaded from your own servers instead.

They also have an option to use regular or Minified javascript and CSS. That would also be a good feature to see in phpBB. :D
I'm against yet more options, we could make it a hidden setting however.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

Post Reply