← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/sprinkle-in-yui-391 into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/sprinkle-in-yui-391 into lp:launchpad.

Commit message:
Destroy all callsites of Y.Lang.substitute and Y.substitute, and start building YUI 3.9.1. The combobuild target is gone, replaced by jsbuild.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/sprinkle-in-yui-391/+merge/157805

Destroy all callsites of Y.Lang.substitute and Y.substitute, and start building YUI 3.9.1. Since we have stopped building launchpad.js, also destroy the combobuild target, since combo-loading is now mandatory -- it's shell calls have been moved to jsbuild.

-- 
https://code.launchpad.net/~stevenk/launchpad/sprinkle-in-yui-391/+merge/157805
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/sprinkle-in-yui-391 into lp:launchpad.
=== modified file 'Makefile'
--- Makefile	2013-04-08 04:48:17 +0000
+++ Makefile	2013-04-09 06:45:27 +0000
@@ -23,7 +23,7 @@
 LP_BUILT_JS_ROOT=${ICING}/build
 
 JS_BUILD_DIR := build/js
-YUI_VERSIONS := 3.5.1
+YUI_VERSIONS := 3.5.1 3.9.1
 YUI_BUILDS := $(patsubst %,$(JS_BUILD_DIR)/yui-%, $(YUI_VERSIONS))
 YUI2_BUILD:= $(JS_BUILD_DIR)/yui2
 YUI_DEFAULT := yui-3.5.1
@@ -127,7 +127,7 @@
 	chmod 777 $(CODEHOSTING_ROOT)/rewrite.log
 	touch $(CODEHOSTING_ROOT)/config/launchpad-lookup.txt
 
-inplace: build combobuild logs clean_logs codehosting-dir
+inplace: build logs clean_logs codehosting-dir
 	if [ -d /srv/launchpad.dev ]; then \
 		ln -sfn $(WD)/build/js $(CONVOY_ROOT); \
 	fi
@@ -185,13 +185,11 @@
 	mkdir -p $@
 	cp -a $</* $@
 
-combobuild:
+jsbuild: $(LP_JS_BUILD) $(YUI_DEFAULT_SYMLINK) $(YUI2_BUILD)
 	utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o \
 	build/js/lp/meta.js >/dev/null
 	utilities/check-js-deps
 
-jsbuild: $(LP_JS_BUILD) $(YUI_DEFAULT_SYMLINK) $(YUI2_BUILD)
-
 eggs:
 	# Usually this is linked via link-external-sourcecode, but in
 	# deployment we create this ourselves.

=== modified file 'lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js'
--- lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js	2013-04-09 06:45:27 +0000
@@ -488,7 +488,7 @@
                 this.null_choice_edit.get('addicon'),
                 'Action icon is not the add icon like expected.');
             Assert.areEqual(
-                'inline',
+                'inline-block',
                 this.null_choice_edit.get('addicon').getStyle('display'),
                 'Add icon is not visible when it should be');
             Assert.areEqual(

=== modified file 'lib/lp/app/javascript/picker/picker.js'
--- lib/lp/app/javascript/picker/picker.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/picker/picker.js	2013-04-09 06:45:27 +0000
@@ -554,7 +554,7 @@
             var msg = Y.Node.create('<li></li>');
             msg.appendChild(
                 document.createTextNode(
-                    Y.substitute(this.get('no_results_search_message'),
+                    Y.Lang.sub(this.get('no_results_search_message'),
                     {query: this._search_input.get('value')})));
             this._results_box.appendChild(msg);
             this._results_box.addClass(no_results_class);
@@ -605,7 +605,7 @@
             return;
         }
 
-        var filter_msg = Y.substitute(
+        var filter_msg = Y.Lang.sub(
             'Showing <strong>{filter}</strong> matches for "{search_terms}".',
             {filter: current_filter_value,
             search_terms: this._search_input.get('value')});
@@ -1241,7 +1241,7 @@
 
         search_text_too_short_message: {
             getter: function() {
-                return Y.Lang.substitute(
+                return Y.Lang.sub(
                     "Please enter at least {min} characters.",
                     {min: this.get('min_search_chars')});
             }
@@ -1319,7 +1319,7 @@
 }, "0.1", {"skinnable": true,
            "requires":
                ["oop", "escape", "event", "event-focus", "base", "node",
-                "plugin", "substitute", "widget", "widget-stdmod",
+                "plugin", "lang", "widget", "widget-stdmod",
                 "lp.ui.overlay", "lp.anim", "lp.ui-base",
                 "lp.app.widgets.expander"]
 });

=== modified file 'lib/lp/bugs/javascript/duplicates.js'
--- lib/lp/bugs/javascript/duplicates.js	2012-09-28 04:59:49 +0000
+++ lib/lp/bugs/javascript/duplicates.js	2013-04-09 06:45:27 +0000
@@ -199,7 +199,7 @@
                 '<span id="mark-duplicate-text">',
                 'Duplicate of <a href="/bugs/{dup_id}">bug #{dup_id}</a>',
                 '</span>'].join("");
-        return Y.Lang.substitute(template, {
+        return Y.Lang.sub(template, {
             link_id: link_id,
             url: url,
             dup_id: dup_id
@@ -214,7 +214,7 @@
                 'href={url} ',
                 'class="sprite remove action-icon remove-duplicate-bug"',
                 'style="float: right;">Remove</a>'].join("");
-        return Y.Lang.substitute(template, {
+        return Y.Lang.sub(template, {
             link_id: link_id,
             url: url
         });

=== modified file 'lib/lp/bugs/javascript/subscription.js'
--- lib/lp/bugs/javascript/subscription.js	2012-09-10 20:52:27 +0000
+++ lib/lp/bugs/javascript/subscription.js	2013-04-09 06:45:27 +0000
@@ -846,7 +846,16 @@
             }
         }
     }
-    return Y.substitute(subscription.reason, subscription.vars, var_replacer);
+    var replacements = {}; 
+    for (var property in subscription.vars) {
+        replacements[property] = var_replacer(
+            undefined, subscription.vars[property]);
+    }
+    for (var property in additional_vars) {
+        replacements[property] = var_replacer(
+            property, additional_vars[property]);
+    }
+    return Y.Lang.sub(subscription.reason, replacements);
 }
 namespace._safely_render_description = safely_render_description;
 
@@ -1360,6 +1369,6 @@
 namespace.show_subscription_description = show_subscription_description;
 
 }, '0.1', {requires: [
-    'dom', 'event', 'node', 'substitute', 'lp.ui.effects', 'lp.app.errors',
+    'dom', 'event', 'node', 'lang', 'lp.ui.effects', 'lp.app.errors',
     'lp.app.confirmationoverlay', 'lp.client'
 ]});

=== modified file 'lib/lp/registry/javascript/distroseries/widgets.js'
--- lib/lp/registry/javascript/distroseries/widgets.js	2011-10-17 14:17:53 +0000
+++ lib/lp/registry/javascript/distroseries/widgets.js	2013-04-09 06:45:27 +0000
@@ -665,7 +665,7 @@
             return {
                 data: packageset,
                 value: packageset.get("id"),
-                text: Y.substitute(
+                text: Y.Lang.sub(
                     "{name}: {desc} ({title})", {
                         name: packageset.get("name"),
                         desc: packageset.get("description"),
@@ -721,4 +721,4 @@
 }, "0.1", {"requires": [
                "node", "dom", "io", "widget", "lp.client",
                "lp.app.formwidgets", "lp.anim", "array-extras",
-               "substitute", "transition"]});
+               "lang", "transition"]});

=== modified file 'lib/lp/registry/javascript/distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/distroseriesdifferences_details.js	2012-09-10 20:52:27 +0000
+++ lib/lp/registry/javascript/distroseriesdifferences_details.js	2013-04-09 06:45:27 +0000
@@ -870,7 +870,7 @@
     var nb_selected_packages = namespace.get_number_of_packages();
     var unit = (nb_selected_packages === 1) ? 'package' : 'packages';
     return Y.Node.create('<h2></h2>')
-        .set('text', Y.substitute(
+        .set('text', Y.Lang.sub(
             "You're about to sync {nr} {unit}. Continue?",
             {nr: nb_selected_packages, unit: unit}));
 };
@@ -917,14 +917,14 @@
     }
     if (nb_inputs > namespace.MAX_PACKAGES) {
         summary.append(Y.Node.create(
-            Y.substitute(
+            Y.Lang.sub(
                 '... and {nr} more packages.',
                 {nr: nb_inputs - namespace.MAX_PACKAGES})));
     }
     return summary;
 };
 
-}, "0.1", {"requires": ["io-base", "widget", "event", "overlay",
+}, "0.1", {"requires": ["io-base", "widget", "event", "overlay", "lang",
                         "lp.soyuz.base", "lp.client",
                         "lp.anim", "lp.ui.formoverlay", "lp.ui.effects",
                         "lp.soyuz.dynamic_dom_updater"]});

=== modified file 'lib/lp/registry/javascript/milestonetable.js'
--- lib/lp/registry/javascript/milestonetable.js	2012-07-07 14:00:30 +0000
+++ lib/lp/registry/javascript/milestonetable.js	2013-04-09 06:45:27 +0000
@@ -4,7 +4,7 @@
  * Dynamically add milestones to an HTML table.
  *
  * @module Y.lp.registry.milestonetable
- * @requires node, io-base, substitute, lp.anim
+ * @requires node, io-base, lang, lp.anim
  */
 YUI.add('lp.registry.milestonetable', function(Y) {
     Y.log('loading lp.registry.milestonetable');
@@ -50,7 +50,7 @@
 
     module._on_add_failure = function(id, response, data) {
         // Add the failure message to the milestone table on Y.io failure.
-        var row = Y.Node.create(Y.substitute(
+        var row = Y.Node.create(Y.Lang.sub(
             '<tr><td colspan="0">' +
             'Could not retrieve milestone {name}</td></tr>', data));
         module._ensure_table_is_seen(data.tbody);
@@ -83,7 +83,7 @@
       */
     module.get_milestone_row = function(parameters) {
         module._setup_milestone_event_data(parameters, module._tbody);
-        var milestone_row_uri = Y.substitute(
+        var milestone_row_uri = Y.Lang.sub(
             module._milestone_row_uri_template, parameters);
         Y.io(milestone_row_uri);
         };
@@ -93,7 +93,7 @@
       *
       * @method setup
       * @param {Object} parameters Object literal of config name/value pairs.
-      *     config.milestone_row_uri_template is the Y.substitute template
+      *     config.milestone_row_uri_template is the Y.Lang.sub template
       *         that is used to create the URL to get the milestone row.
       *     config.milestone_rows_id is the id the tbody that the
       *         milestone row will be added too.
@@ -112,10 +112,10 @@
         module._tbody = Y.one(config.milestone_rows_id);
         if (module._tbody === null) {
             throw new Error(
-                Y.substitute("'{milestone_rows_id}' not in page.", config));
+                Y.Lang.sub("'{milestone_rows_id}' not in page.", config));
             }
         };
 
 }, "0.1", {"requires": [
-    "node", "io-base", "substitute", "lp.anim"
+    "node", "io-base", "lang", "lp.anim"
     ]});

=== modified file 'lib/lp/registry/javascript/sharing/granteepicker.js'
--- lib/lp/registry/javascript/sharing/granteepicker.js	2012-08-30 02:52:33 +0000
+++ lib/lp/registry/javascript/sharing/granteepicker.js	2013-04-09 06:45:27 +0000
@@ -137,7 +137,7 @@
         }
         var steptitle = data.steptitle;
         if (!Y.Lang.isValue(steptitle)) {
-            steptitle = Y.Lang.substitute(
+            steptitle = Y.Lang.sub(
                 'Select sharing policies for {name}',
                 {name: data.grantee_name});
         }
@@ -343,7 +343,7 @@
         }
         switch (config.first_step) {
             case 2:
-                var steptitle = Y.Lang.substitute(
+                var steptitle = Y.Lang.sub(
                     'Update sharing policies for {name}',
                     {name: config.grantee.person_name});
                 var data = {

=== modified file 'lib/lp/registry/javascript/sharing/granteetable.js'
--- lib/lp/registry/javascript/sharing/granteetable.js	2012-12-18 21:24:44 +0000
+++ lib/lp/registry/javascript/sharing/granteetable.js	2013-04-09 06:45:27 +0000
@@ -237,7 +237,7 @@
             choice_items.push({
                 value: value,
                 name: title,
-                source_name: Y.Lang.substitute(source_name,
+                source_name: Y.Lang.sub(source_name,
                     {policy_name: information_types[policy],
                      permission_name: title})
             });

=== modified file 'lib/lp/registry/javascript/sharing/sharingdetails.js'
--- lib/lp/registry/javascript/sharing/sharingdetails.js	2012-12-02 14:48:02 +0000
+++ lib/lp/registry/javascript/sharing/sharingdetails.js	2013-04-09 06:45:27 +0000
@@ -210,7 +210,7 @@
     // An error occurred performing an operation on an artifact.
     display_error: function(artifact_id, artifact_type, error_msg) {
         var details_table_body = this.get('details_table_body');
-        var selector = Y.Lang.substitute(
+        var selector = Y.Lang.sub(
             'tr[id=shared-{artifact_type}-{artifact_id}]', {
                 artifact_type: artifact_type,
                 artifact_id: artifact_id});

=== modified file 'lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js	2013-03-20 03:41:40 +0000
+++ lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js	2013-04-09 06:45:27 +0000
@@ -24,12 +24,12 @@
                              missing_row) {
         var derivedtd = '';
         if (!missing_row) {
-            derivedtd = Y.substitute(derivedtd_html, {
+            derivedtd = Y.Lang.sub(derivedtd_html, {
                 package_name: package_name,
                 derived_version: derived_version
             });
         }
-        return Y.substitute( row_html, {
+        return Y.Lang.sub( row_html, {
             package_name: package_name,
             parent_version: parent_version,
             derived_version: derived_version,
@@ -68,11 +68,11 @@
     var derivedtd_html = Y.one('#derivedtd-template').getContent();
     var blacklist_html = Y.one('#blacklist_html').getContent();
     var extra_row = Y.one('#blacklist_extra_row').getContent();
-    extra_row = Y.substitute(extra_row, {
+    extra_row = Y.Lang.sub(extra_row, {
         blacklist_html: blacklist_html
     });
     var whole_table = Y.one('#blacklist_whole_table').getContent();
-    whole_table = Y.substitute(whole_table, {
+    whole_table = Y.Lang.sub(whole_table, {
         row: create_row('evolution', '2.0.9-1', '2.0.8-4', false),
         extra_row: extra_row
     });


Follow ups