On Sat, Jul 12, 2014 at 10:56 AM, Glen Mazza <[email protected]> wrote:
> Hi Team, having moved about half of the YUI stuff from YUI2 to YUI3, I can > say that the coding is considerably cleaner, it's a nice simpler API with > fewer imports needed. However, it's really designed for non-SSL CDN use as > it significantly bloats the roller-ui folder ( > http://svn.apache.org/viewvc/roller/trunk/app/src/main/ > webapp/roller-ui/yui3/), as it uses a separate folder for each JS file > instead of nicely allowing us to store them all in one folder. > Unfortunately, as mentioned below, Yahoo's CDN doesn't support SSL, > risking "Warning! non-secure items being accessed" browser popups if the > Roller instance is on HTTPS and we switch to CDN use to keep the Roller WAR > free of all these folders. I've asked a question about this on Stack > Overflow (http://stackoverflow.com/questions/24713896/efficient- > way-to-incorporate-yui3-into-a-java-web-application), maybe there are > ways to simplify embedding YUI3 that I've missed. > > YUI 2 is roughly 3.9MB is size, the whole YUI 3 is 34MB and 374 folders. > Removing the "coverage" (testing scripts) and "debug" scripts gets it down > to 10MB, probably 4MB if we just keep the "min" files. I used the YUI > configurator (https://yuilibrary.com/yui/configurator/) to just determine > the 75 or so folders that we need (as of now) to just import those into our > code. All this folder complexity results in a benefit in our JSPs, > generally, unlike YUI2, for YUI3, you need only one script reference > (sometimes a few more CSS ones), it will slurp in the others that it needs: > > <script type="text/javascript" src="<s:url > value='/roller-ui/yui3/yui/yui-min.js' > />"/> (for CDN use:<scriptsrc="http://yui.yahooapis.com/3.17.2/build/ > yui/yui-min.js"/>). > > If you need to debug your scripts (say, within Firebug) you can just > change to the CDN debugging JS: > <scriptsrc="http://yui.yahooapis.com/3.17.2/build/yui/yui-debug.js > "></script> > Sounds like a pain. I can't remember what we had to do to get YUI working before. I'm pretty sure we just included the YUI2 components that we needed and not the whole thing. > > Still, I think JQuery should be our first choice when it does what we > want. It has an SSL-supporting CDN, but even if we didn't need it it takes > up far fewer files. For example, the JQuery popup calendar is just one > file (besides images), we add what we need (http://jqueryui.com/download/) > and it creates a custom JS for us, nicely sitting here: ( > http://svn.apache.org/viewvc/roller/trunk/app/src/main/ > webapp/roller-ui/scripts/). > I agree. JQuery works great and seems to have a much bigger community & eco system (possible evidence of that http://www.google.com/trends/explore#q=jquery,yui,dojo,mootools,scriptaculous ). What I have left to convert is the Media File Chooser popups on the Media > File View and Edit JSPs. There's one more YUI2 element, the green "+" menu > button present on each image in MediaFileView.jsp, which allows users to > create a blog entry or a podcast from the Media File View page using the > image instead of from the standard EntryAdd.jsp page. However, the menu > button is no longer present in YUI3 (http://yuilibrary.com/yui/ > docs/node-menunav/) and should probably be switched over to its JQueryUI > equivalent (http://jqueryui.com/button/). In the interests of getting > rid of YUI2, though, I'd like to get rid of this button entirely now > (whether or not it ever gets replaced with something from JQueryUI). > People already have a nearly identical media file image chooser to embed > images on the EntryEdit/EntryAdd JSPs, so it's redundant allowing them to > create blog articles from the Media File View tab as well (and multiple > access paths creates more code complexity, risk of security holes, user > training issues, etc.) The only thing that would be lost right now is a > one-click ability to create a podcast (pretty rare event anyway), users > would need to select the podcast from the image chooser on the Entry Edit > page and copy it to the EnclosureURL field. Still, IMO that one-click > ability should be moved to the Image Chooser view on the Entry Add/Edit > pages anyway. Thoughts? > That sounds reasonable. Only other thought is this: don't kill yourself on this task, we don't have to switch to YUI3 or eliminate YUI for the Roller 5.1 release. It would be nice, but I don't think it is a must have. - Dave
