Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'develop-perf' of git://github.com/yahoo/mojito into dev…

…elop-perf
  • Loading branch information...
commit c0f1416e1872a21cfd28eb70446e5c7723906ff3 2 parents fde66fd + cda610a
bthaeler authored
8 lib/app/addons/ac/deploy.server.js
@@ -171,11 +171,9 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
171 171 initializer = '<script type="text/javascript">\n' +
172 172 ' YUI_config = ' + yuiConfigStr + ';\n' +
173 173 ' YUI.Env.core.push("loader-base"); // workaround (ticket 2532571)\n' +
174   -
175   - 'YUI_config.bootstrap = true;' +
176   - 'YUI_config.comboBase = "/combo?";' +
177   - 'YUI_config.combine = true;' +
178   -
  174 + ' YUI_config.bootstrap = true;\n' +
  175 + ' YUI_config.comboBase = "/combo?";\n' +
  176 + ' YUI_config.combine = true;\n' +
179 177 ' YUI().use(' + initialModuleList + ', function(Y) {\n' +
180 178 ' window.YMojito = { client: new Y.mojito.Client(' +
181 179 clientConfigStr + ') };\n' +
26 lib/app/middleware/mojito-combo-handler.js
@@ -221,17 +221,8 @@ function staticProvider(store, globalLogger, Y) {
221 221 mojits = store.yui.getConfigAllMojits('client', {}),
222 222 shared = store.yui.getConfigShared('client', {}, false),
223 223 modules_config = Y.merge((mojits.modules || {}), (shared.modules || {})),
224   -
225   - // using the loader at the server side to compute the loader metadata
226   - // to avoid loading the whole thing on demand.
227   - loader = new Y.Loader(Y.merge({
228   - ignoreRegistered: true,
229   - modules: modules_config
230   - }, {
231   - require: Y.Object.keys(modules_config)
232   - })),
233   - resolved = loader.resolve(true),
234   -
  224 + loader,
  225 + resolved,
235 226 appMetaData,
236 227 appResolvedMetaData,
237 228
@@ -241,6 +232,19 @@ function staticProvider(store, globalLogger, Y) {
241 232 conditions = {}, // hash to store conditional functions
242 233 name;
243 234
  235 + // using the loader at the server side to compute the loader metadata
  236 + // to avoid loading the whole thing on demand.
  237 + loader = new Y.Loader(Y.merge({
  238 + ignoreRegistered: true,
  239 + modules: modules_config
  240 + }, {
  241 + require: Y.Object.keys(modules_config)
  242 + }));
  243 + resolved = loader.resolve(true);
  244 +
  245 + // Need to make a copy otherwise the changes we make deep in this structure
  246 + // will bleed into the loader, especially causing condition.test to fail.
  247 + resolved = Y.mojito.util.copy(resolved);
244 248
245 249 if (cache && !maxAge) {
246 250 maxAge = cache;
4 tests/run.js
@@ -36,6 +36,10 @@ program.command('deploy')
36 36 .description('Deploy all apps')
37 37 .action(deploy);
38 38
  39 +// report how we're called, mainly to help debug CI environments
  40 +console.log(process.argv.join(' '));
  41 +console.log();
  42 +
39 43 program.parse(process.argv);
40 44
41 45 function test (cmd) {
11 tests/unit/lib/app/addons/ac/test-deploy.server.js
@@ -157,7 +157,11 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
157 157
158 158 var expected = [
159 159 '<script type="text/javascript">',
160   - ' YUI_config = {"foo":"bar","lang":"klingon","core":["get","features","intl-base","yui-log","mojito","yui-later"]};',
  160 + ' YUI_config = {"foo":"bar","lang":"klingon","base":"combo?","combine":true};',
  161 + ' YUI.Env.core.push("loader-base"); // workaround (ticket 2532571)',
  162 + ' YUI_config.bootstrap = true;',
  163 + ' YUI_config.comboBase = "/combo?";',
  164 + ' YUI_config.combine = true;',
161 165 ' YUI().use(\'mojito-client\', function(Y) {',
162 166 ' window.YMojito = { client: new Y.mojito.Client({"context":{"lang":"klingon","runtime":"client"},"binderMap":{"viewId1":{"needs":"a drink"},"viewId2":{"needs":"another drink"}},"routes":["routes"]}) };',
163 167 ' });',
@@ -259,7 +263,8 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
259 263 Y.mojito.Loader = realLoader;
260 264 }
261 265
262   - A.areSame(1, Object.keys(counts).length, 'too many type:location pairs');
  266 + A.areSame(2, Object.keys(counts).length, 'too many type:location pairs');
  267 + A.areSame(1, counts['js top'], 'wrong number of js:top');
263 268 A.areSame(1, counts['blob bottom'], 'wrong number of blob:bottom');
264 269 },
265 270
@@ -321,7 +326,7 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
321 326 var binderMap = {};
322 327
323 328 addon.constructMojitoClientRuntime(assetHandler, binderMap);
324   - A.areSame("'*'", YUI_use);
  329 + A.areSame("'mojito-client'", YUI_use);
325 330 },
326 331
327 332

0 comments on commit c0f1416

Please sign in to comment.
Something went wrong with that request. Please try again.