Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Merge assets from config.assets to meta #593

Merged
merged 2 commits into from

3 participants

@diervo

In mojito 0.4.x due to the automatic inclusion of the mojito-assets-addon, when executing the loop on line 124 it calls the metaMergeInto of the assets addon which makes the config to merge.

Since we dont have that addon as default in the new mojito version, we will need to do it manually.

If you add the assets addon as a dependencie, due to the implementation of metaMerge will not duplicate assets. So is just a small overhead on computation in that case.

This is a must merge to Shaker.

diervo added some commits
@diervo diervo Merge assets from iconfig.assets to meta
In mojito 0.4.x due to the automatic inclusion of the mojito-assets-addon, when executing the loop on line 124 it calls the metaMergeInto of the assets addon which makes the config to merge.
Since we dont have that automatic, we will need to do it by default.
If you add the assets addon as a dependencie, due to the implementation of metaMerge will not duplicate assets. So is just a small overhead on computation in that case. 
This is a must merge to Shaker.
d384321
@diervo diervo Update lib/app/addons/ac/output-adapter.common.js c36e6a3
@caridy
Owner

+1

@drewfish
Owner

lint passes, unit tests pass, +1

@drewfish drewfish merged commit 9af1e71 into yahoo:develop-perf

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. @diervo

    Merge assets from iconfig.assets to meta

    diervo authored
    In mojito 0.4.x due to the automatic inclusion of the mojito-assets-addon, when executing the loop on line 124 it calls the metaMergeInto of the assets addon which makes the config to merge.
    Since we dont have that automatic, we will need to do it by default.
    If you add the assets addon as a dependencie, due to the implementation of metaMerge will not duplicate assets. So is just a small overhead on computation in that case. 
    This is a must merge to Shaker.
  2. @diervo
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/app/addons/ac/output-adapter.common.js
View
2  lib/app/addons/ac/output-adapter.common.js
@@ -44,6 +44,7 @@ YUI.add('mojito-output-adapter-addon', function(Y, NAME) {
// NOTE: 'this' is the ActionContext instance
var callbackFunc = more ? 'flush' : 'done',
instance = this.command.instance,
+ config = instance.config || {},
context = this.command.context || {},
adapter = this._adapter,
action = this.command.action,
@@ -119,6 +120,7 @@ YUI.add('mojito-output-adapter-addon', function(Y, NAME) {
mojitView.engine = meta.view.engine;
}
+ meta.assets = Y.mojito.util.metaMerge(meta.assets, config.assets || {});
// Here we ask each "thing" attached to the AC if it wants to add view
// "meta"
Y.Object.each(this, function(item) {
Something went wrong with that request. Please try again.