launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #06412
[Merge] lp:~rharding/launchpad/fix_yui_934225 into lp:launchpad
Richard Harding has proposed merging lp:~rharding/launchpad/fix_yui_934225 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #934225 in Launchpad itself: "Launchpad announce for projects is showing https error"
https://bugs.launchpad.net/launchpad/+bug/934225
For more details, see:
https://code.launchpad.net/~rharding/launchpad/fix_yui_934225/+merge/93622
= Summary =
Currently the YUI2 code isn't built into the launchpad.js build file. It's gotten missed in the updates over time to allow for the combo loader.
== Proposed Fix ==
Rather than doing a separate trick to get it, make it work just as the YUI3 deps are done. They pull from a list of deps out of the build/js directory.
== Implementation Details ==
We had to make sure we cp the YUI2 into the build/js directory earlier in the build process so that the Makefile can see the files as valid to work with. Once the build/js/yui2 directory is populated, we can run yui-deps which will pick those files up to be combined into the launchpad.js build file.
== Demo and Q/A ==
The bug demonstrates a page that loads the yui2 calendar. That page should not attempt to load the JS via the yahoo cdn, but instead already have the files in launchpad.js
--
https://code.launchpad.net/~rharding/launchpad/fix_yui_934225/+merge/93622
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/fix_yui_934225 into lp:launchpad.
=== modified file 'Makefile'
--- Makefile 2012-02-16 20:35:40 +0000
+++ Makefile 2012-02-17 17:45:23 +0000
@@ -180,6 +180,8 @@
--builddir $(LP_BUILT_JS_ROOT)
$(JS_LP): jsbuild_widget_css
+$(JS_YUI):
+ cp -a lib/canonical/launchpad/icing/yui_2.7.0b/build build/js/yui2
$(JS_OUT): $(JS_ALL)
ifeq ($(JS_BUILD), min)
=== modified file 'utilities/sourcedeps.cache'
--- utilities/sourcedeps.cache 2012-02-10 13:55:22 +0000
+++ utilities/sourcedeps.cache 2012-02-17 17:45:23 +0000
@@ -71,4 +71,4 @@
16,
"robertc@xxxxxxxxxxxxxxxxx-20050911111209-ee5da49011cf936a"
]
-}
\ No newline at end of file
+}
=== modified file 'utilities/yui-deps.py'
--- utilities/yui-deps.py 2012-02-02 06:01:27 +0000
+++ utilities/yui-deps.py 2012-02-17 17:45:23 +0000
@@ -7,112 +7,125 @@
from sys import argv
-
-yui_root = 'build/js/yui-3.3.0'
-yui_deps = [
- 'yui/yui',
- 'oop/oop',
- 'dom/dom',
- 'dom/dom-style-ie',
- 'event-custom/event-custom',
- 'event/event',
- 'pluginhost/pluginhost',
- 'node/node',
- 'event/event-base-ie',
- 'node/align-plugin',
- 'attribute/attribute',
- 'base/base',
- 'anim/anim',
- 'async-queue/async-queue',
- 'json/json',
- 'plugin/plugin',
- 'cache/cache',
- 'classnamemanager/classnamemanager',
- 'collection/collection',
- 'dump/dump',
- 'intl/intl',
- 'substitute/substitute',
- 'widget/widget',
- 'widget/widget-base-ie',
- 'console/lang/console.js',
- 'console/console',
- 'console/console-filters',
- 'cookie/cookie',
- 'dataschema/dataschema',
- 'datatype/lang/datatype.js',
- 'datatype/datatype',
- 'querystring/querystring-stringify-simple',
- 'queue-promote/queue-promote',
- 'io/io',
- 'datasource/datasource',
- 'dd/dd',
- 'dd/dd-gestures',
- 'dd/dd-drop-plugin',
- 'event/event-touch',
- 'event-gestures/event-gestures',
- 'dd/dd-plugin',
- 'dom/selector-css3',
- 'editor/editor',
- 'event-simulate/event-simulate',
- 'event-valuechange/event-valuechange',
- 'escape/escape',
- 'text/text-data-wordbreak',
- 'text/text-wordbreak',
- 'text/text-data-accentfold',
- 'text/text-accentfold',
- 'highlight/highlight',
- 'history/history',
- 'history/history-hash-ie',
- 'history-deprecated/history-deprecated',
- 'imageloader/imageloader',
- 'jsonp/jsonp',
- 'jsonp/jsonp-url',
- 'loader/loader',
- 'node/node-event-simulate',
- 'transition/transition',
- 'node-flick/node-flick',
- 'node-focusmanager/node-focusmanager',
- 'node-menunav/node-menunav',
- 'widget/widget-position',
- 'widget/widget-position-align',
- 'widget/widget-position-constrain',
- 'widget/widget-stack',
- 'widget/widget-stdmod',
- 'overlay/overlay',
- 'profiler/profiler',
- 'querystring/querystring',
- 'querystring/querystring-parse-simple',
- 'scrollview/scrollview-base',
- 'scrollview/scrollview-base-ie',
- 'scrollview/scrollview-scrollbars',
- 'scrollview/scrollview',
- 'scrollview/scrollview-paginator',
- 'node/shim-plugin',
- 'slider/slider',
- 'sortable/sortable',
- 'sortable/sortable-scroll',
- 'stylesheet/stylesheet',
- 'swfdetect/swfdetect',
- 'swf/swf',
- 'tabview/tabview-base',
- 'widget/widget-child',
- 'widget/widget-parent',
- 'tabview/tabview',
- 'tabview/tabview-plugin',
- 'test/test',
- 'uploader/uploader',
- 'widget-anim/widget-anim',
- 'widget/widget-locale',
- 'yql/yql',
-]
+yui_roots = {
+ 3: 'build/js/yui-3.3.0',
+ 2: 'build/js/yui2',
+}
+yui_deps = {
+ 3: [
+ 'yui/yui',
+ 'oop/oop',
+ 'dom/dom',
+ 'dom/dom-style-ie',
+ 'event-custom/event-custom',
+ 'event/event',
+ 'pluginhost/pluginhost',
+ 'node/node',
+ 'event/event-base-ie',
+ 'node/align-plugin',
+ 'attribute/attribute',
+ 'base/base',
+ 'anim/anim',
+ 'async-queue/async-queue',
+ 'json/json',
+ 'plugin/plugin',
+ 'cache/cache',
+ 'classnamemanager/classnamemanager',
+ 'collection/collection',
+ 'dump/dump',
+ 'intl/intl',
+ 'substitute/substitute',
+ 'widget/widget',
+ 'widget/widget-base-ie',
+ 'console/lang/console.js',
+ 'console/console',
+ 'console/console-filters',
+ 'cookie/cookie',
+ 'dataschema/dataschema',
+ 'datatype/lang/datatype.js',
+ 'datatype/datatype',
+ 'querystring/querystring-stringify-simple',
+ 'queue-promote/queue-promote',
+ 'io/io',
+ 'datasource/datasource',
+ 'dd/dd',
+ 'dd/dd-gestures',
+ 'dd/dd-drop-plugin',
+ 'event/event-touch',
+ 'event-gestures/event-gestures',
+ 'dd/dd-plugin',
+ 'dom/selector-css3',
+ 'editor/editor',
+ 'event-simulate/event-simulate',
+ 'event-valuechange/event-valuechange',
+ 'escape/escape',
+ 'text/text-data-wordbreak',
+ 'text/text-wordbreak',
+ 'text/text-data-accentfold',
+ 'text/text-accentfold',
+ 'highlight/highlight',
+ 'history/history',
+ 'history/history-hash-ie',
+ 'history-deprecated/history-deprecated',
+ 'imageloader/imageloader',
+ 'jsonp/jsonp',
+ 'jsonp/jsonp-url',
+ 'loader/loader',
+ 'node/node-event-simulate',
+ 'transition/transition',
+ 'node-flick/node-flick',
+ 'node-focusmanager/node-focusmanager',
+ 'node-menunav/node-menunav',
+ 'widget/widget-position',
+ 'widget/widget-position-align',
+ 'widget/widget-position-constrain',
+ 'widget/widget-stack',
+ 'widget/widget-stdmod',
+ 'overlay/overlay',
+ 'profiler/profiler',
+ 'querystring/querystring',
+ 'querystring/querystring-parse-simple',
+ 'scrollview/scrollview-base',
+ 'scrollview/scrollview-base-ie',
+ 'scrollview/scrollview-scrollbars',
+ 'scrollview/scrollview',
+ 'scrollview/scrollview-paginator',
+ 'node/shim-plugin',
+ 'slider/slider',
+ 'sortable/sortable',
+ 'sortable/sortable-scroll',
+ 'stylesheet/stylesheet',
+ 'swfdetect/swfdetect',
+ 'swf/swf',
+ 'tabview/tabview-base',
+ 'widget/widget-child',
+ 'widget/widget-parent',
+ 'tabview/tabview',
+ 'tabview/tabview-plugin',
+ 'test/test',
+ 'uploader/uploader',
+ 'widget-anim/widget-anim',
+ 'widget/widget-locale',
+ 'yql/yql',
+ ],
+ 2: [
+ 'calendar/calendar.js',
+ 'dom/dom.js',
+ 'event/event.js',
+ 'yahoo-dom-event/yahoo-dom-event.js',
+ 'yahoo/yahoo.js'
+ ]
+}
if __name__ == '__main__':
ext = "-%s.js" % argv[1] if len(argv) >= 2 else ".js"
- for yui_dep in yui_deps:
- # If the yui_dep already has a .js suffix, don't add ext to it.
- if yui_dep.endswith(".js"):
- yui_dep_path = "%s/%s" % (yui_root, yui_dep)
- else:
- yui_dep_path = "%s/%s%s" % (yui_root, yui_dep, ext)
- print yui_dep_path
+ for version, yui_deps in yui_deps.iteritems():
+ yui_root = yui_roots[version]
+ for yui_dep in yui_deps:
+ # If the yui_dep already has a .js suffix, don't add ext to it.
+ if yui_dep.endswith(".js"):
+ yui_dep_path = "%s/%s" % (yui_root, yui_dep)
+ else:
+ yui_dep_path = "%s/%s%s" % (yui_root, yui_dep, ext)
+ print yui_dep_path