Skip to content

Commit 8e36ee1

Browse files
committed
Update log console native usages
1 parent 11212a7 commit 8e36ee1

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

app/code/Magento/PageCache/view/frontend/web/js/page-cache.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ define([
6868
el.contentDocument || (el.contentWindow ? el.contentWindow.document : []) :
6969
$.merge([], el.childNodes);
7070
} catch (e) {
71+
console.error(e);
72+
7173
return [];
7274
}
7375
});

app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,19 @@ define([
9090
var loaded = $.Deferred(),
9191
source = node.component;
9292

93+
console.info('componentStartLoading', {
94+
component: node.component
95+
});
96+
9397
require([source], function (constr) {
98+
console.info('componentFinishLoading', {
99+
component: node.component
100+
});
94101
loaded.resolve(node, constr);
102+
}, function () {
103+
console.error('componentLoadingFail', {
104+
component: node.component
105+
});
95106
});
96107

97108
return loaded.promise();
@@ -106,6 +117,11 @@ define([
106117
function initComponent(node, Constr) {
107118
var component = new Constr(_.omit(node, 'children'));
108119

120+
console.info('componentStartInitialization', {
121+
component: node.component,
122+
componentName: node.name
123+
});
124+
109125
registry.set(node.name, component);
110126
}
111127

app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ define([
6868
return origUpdate.apply(this, arguments);
6969
}
7070

71+
if (!options.name) {
72+
console.error('Could not find template name', options);
73+
}
74+
7175
templateName = options.name;
7276
} else if (typeof options === 'string') {
7377
templateName = options;
78+
} else {
79+
console.error('Could not build a template binding', options);
7480
}
7581
engine._trackRender(templateName);
7682
isSync = engine._hasTemplateLoaded(templateName);
@@ -178,10 +184,31 @@ define([
178184
source.requestedBy = bindingContext.$data.name;
179185
sources[templateId] = source;
180186

187+
console.info('templateStartLoading', {
188+
template: templateId,
189+
component: bindingContext.$data.name
190+
});
191+
181192
renderer.render(template).then(function (rendered) {
193+
console.info('templateLoadedFromServer', {
194+
template: templateId,
195+
component: bindingContext.$data.name
196+
});
197+
182198
source.nodes(rendered);
183199
engine._releaseRender(templateId, 'async');
184200
}).fail(function () {
201+
console.error('templateLoadingFail', {
202+
template: templateId,
203+
component: bindingContext.$data.name
204+
});
205+
});
206+
}
207+
208+
if (source.requestedBy !== bindingContext.$data.name) {
209+
console.info('templateLoadedFromCache', {
210+
template: templateId,
211+
component: bindingContext.$data.name
185212
});
186213
}
187214

0 commit comments

Comments
 (0)