Ahh, so I think I'm confusing "include it with the core" and "load it on every page whether it's used or not".
I think the general consensus supports including it with the core package, but only in such a way as to not load it on pages that don't require its functionality. Does that seem accurate?
If we were to implement something like the suggested libraries that manage which libraries are needed on each page load, would that library use less resources itself than just including jQuery UI by default?
Prevent multiple inclusions of jQuery UI
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: Prevent multiple inclusions of jQuery UI
I'm ok with that.imkingdavid wrote: I think the general consensus supports including it with the core package, but only in such a way as to not load it on pages that don't require its functionality. Does that seem accurate?
Things like includeJS & cia use very minimal amount of processing and it would do most work on the client.imkingdavid wrote: If we were to implement something like the suggested libraries that manage which libraries are needed on each page load, would that library use less resources itself than just including jQuery UI by default?
Ofc, if jQuery UI is used every single time, no exceptions, it's best not to have that extra code in the first place but if it is used only sometimes, then it makes a lot of sense, at least, to me.
Re: Prevent multiple inclusions of jQuery UI
This could be resolved for 3.2 anyway with extension dependencies and have them require an extension that includes just jQuery UI. This issue comes up a lot with symfony bundles that need jQuery etc. as they all bundle it.
Have the MOD team decided how to bundle extension zip packages yet? If its from the board root or ext/ then multiple extensions could be included in the zip file and people can include a phpbb/jquery-ui extension in their package. The only problem's you'd have then would be if they are using different jQuery UI versions but that would be an extension conflict anyway, nothing we can really do about that.
Otherwise, it's including it in the core (which I don't have an objection to. I'm just airing the other options).
Have the MOD team decided how to bundle extension zip packages yet? If its from the board root or ext/ then multiple extensions could be included in the zip file and people can include a phpbb/jquery-ui extension in their package. The only problem's you'd have then would be if they are using different jQuery UI versions but that would be an extension conflict anyway, nothing we can really do about that.
Otherwise, it's including it in the core (which I don't have an objection to. I'm just airing the other options).
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Prevent multiple inclusions of jQuery UI
How do they handle it in Symfony? What kind of issues can come up?
The problem I see with jQuery UI is that it has specific style elements/design to it, so it will have to be unique per style and every style will need to include it/make sure the elements are styled correctly for their custom style.
The problem I see with jQuery UI is that it has specific style elements/design to it, so it will have to be unique per style and every style will need to include it/make sure the elements are styled correctly for their custom style.
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: Prevent multiple inclusions of jQuery UI
I ignore all Symfony and 3.2 discussion for now.
What we could do easy is something like:
This way, ext authors can easily load it (by just setting $LOAD_JQUERY_UI to true) and it does not waste resources when its not used.
What we could do easy is something like:
<!-- IF $LOAD_JQUERY_UI --><!-- INCLUDEJS jquery.ui.js --><!-- ENDIF -->
This way, ext authors can easily load it (by just setting $LOAD_JQUERY_UI to true) and it does not waste resources when its not used.
Member of the Development-Team — No Support via PM
-
- Registered User
- Posts: 165
- Joined: Fri Apr 05, 2013 3:38 am
Re: Prevent multiple inclusions of jQuery UI
What happens when someone wants to use a different theme in jquery ui?
Re: Prevent multiple inclusions of jQuery UI
Symfony (Or composer world in general) - There is no solution. We have this all the time with bundles including jQuery, UI, Bootstrap etc. and it does cause issues. Jordi, the composer (co-)lead developer, appealed for anyone to come up with a solution.EXreaction wrote:How do they handle it in Symfony? What kind of issues can come up?
The problem I see with jQuery UI is that it has specific style elements/design to it, so it will have to be unique per style and every style will need to include it/make sure the elements are styled correctly for their custom style.
I see your point. Unless extensions are packaged to ext/ or / then I think joas' solution is the best one.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: Prevent multiple inclusions of jQuery UI
Themes should not present as much of an issue. Themes come in namespaced folders, and are just CSS files (and images).Alien_Time wrote:What happens when someone wants to use a different theme in jquery ui?
So an ext. author can use any theme they want, and include it in their ext package. While this means it would be possible that multiple themes could be loaded on a board by different extensions each using their own themes, there should not really be any conflicts since each theme has its own name.
The only issue may be if themes of the same name, but different versions are loaded at the same time by different extensions. But if thats the case, its easy to identify and fix.
Of course having said all that, how many extensions does anybody think are actually going to use jQuery UI (or UI themes)? Not a whole lot I think.
Has an irascible disposition.
-
- Registered User
- Posts: 165
- Joined: Fri Apr 05, 2013 3:38 am
Re: Prevent multiple inclusions of jQuery UI
That makes sense VSE. In that case, including jquery ui js in the phpbb package and then having the ability to enable it similar to the nickvergessen's suggestion will work well.
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: Prevent multiple inclusions of jQuery UI
That sounds like a great idea. Of course, you need to set $LOAD_JQUERY_UI once you've included it.nickvergessen wrote:I ignore all Symfony and 3.2 discussion for now.
What we could do easy is something like:
<!-- IF $LOAD_JQUERY_UI --><!-- INCLUDEJS jquery.ui.js --><!-- ENDIF -->
This way, ext authors can easily load it (by just setting $LOAD_JQUERY_UI to true) and it does not waste resources when its not used.