marko 5.33.17 → 5.33.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/node_modules/@internal/components-registry/index-browser.js +29 -26
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +3 -3
- package/dist/node_modules/@internal/components-util/index.js +1 -1
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +2 -1
- package/dist/runtime/components/Component.js +26 -26
- package/dist/runtime/components/ComponentDef.js +6 -6
- package/dist/runtime/components/ComponentsContext.js +1 -1
- package/dist/runtime/components/State.js +1 -1
- package/dist/runtime/components/dom-data.js +3 -3
- package/dist/runtime/components/event-delegation.js +3 -3
- package/dist/runtime/components/legacy/renderer-legacy.js +10 -10
- package/dist/runtime/components/renderer.js +6 -6
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +2 -2
- package/dist/runtime/html/AsyncStream.js +6 -1
- package/dist/runtime/html/helpers/data-marko.js +1 -1
- package/dist/runtime/vdom/VElement.js +1 -1
- package/dist/runtime/vdom/VFragment.js +1 -1
- package/dist/runtime/vdom/hot-reload.js +5 -5
- package/dist/runtime/vdom/morphdom/index.js +11 -11
- package/package.json +3 -3
- package/src/node_modules/@internal/components-registry/index-browser.js +3 -0
- package/src/node_modules/@internal/preserve-tag/index-browser.js +2 -1
- package/src/runtime/html/AsyncStream.js +6 -1
- package/src/runtime/html/helpers/data-marko.js +1 -1
- package/src/runtime/vdom/morphdom/index.js +3 -3
@@ -12,8 +12,9 @@ var req = require("@internal/require");
|
|
12
12
|
var componentLookup = componentsUtil._k_;
|
13
13
|
var addComponentRootToKeyedElements =
|
14
14
|
componentsUtil._l_;
|
15
|
-
var
|
16
|
-
var
|
15
|
+
var keysByDOMNode = domData._m_;
|
16
|
+
var keyedElementsByComponentId = domData._n_;
|
17
|
+
var componentsByDOMNode = domData._o_;
|
17
18
|
var serverComponentRootNodes = {};
|
18
19
|
var serverRenderedMeta = {};
|
19
20
|
var win = window;
|
@@ -118,7 +119,7 @@ function getComponentClass(typeName, isLegacy) {
|
|
118
119
|
}
|
119
120
|
|
120
121
|
// Make the component "type" accessible on each component instance
|
121
|
-
ComponentClass.prototype.
|
122
|
+
ComponentClass.prototype._p_ = typeName;
|
122
123
|
|
123
124
|
// eslint-disable-next-line no-constant-condition
|
124
125
|
|
@@ -221,7 +222,7 @@ function indexServerComponentBoundaries(node, runtimeId, stack) {
|
|
221
222
|
} else if (node.nodeType === 1) {
|
222
223
|
// HTML element node
|
223
224
|
var markoKey = node.getAttribute("data-marko-key");
|
224
|
-
var markoProps = componentsUtil.
|
225
|
+
var markoProps = componentsUtil._q_(node);
|
225
226
|
if (markoKey) {
|
226
227
|
var separatorIndex = markoKey.indexOf(" ");
|
227
228
|
ownerId = markoKey.substring(separatorIndex + 1);
|
@@ -233,12 +234,14 @@ function indexServerComponentBoundaries(node, runtimeId, stack) {
|
|
233
234
|
keyedElementsByComponentId[ownerId] || (
|
234
235
|
keyedElementsByComponentId[ownerId] = {});
|
235
236
|
}
|
237
|
+
|
238
|
+
keysByDOMNode.set(node, markoKey);
|
236
239
|
keyedElements[markoKey] = node;
|
237
240
|
}
|
238
241
|
if (markoProps) {
|
239
242
|
Object.keys(markoProps).forEach(function (key) {
|
240
243
|
if (key.slice(0, 2) === "on") {
|
241
|
-
eventDelegation.
|
244
|
+
eventDelegation._r_(key.slice(2));
|
242
245
|
}
|
243
246
|
});
|
244
247
|
}
|
@@ -306,13 +309,13 @@ function initComponent(componentDef, host) {
|
|
306
309
|
return; // legacy
|
307
310
|
}
|
308
311
|
|
309
|
-
component.
|
312
|
+
component._s_();
|
310
313
|
component.B_ = host;
|
311
314
|
|
312
|
-
var isExisting = componentDef.
|
315
|
+
var isExisting = componentDef._t_;
|
313
316
|
|
314
317
|
if (isExisting) {
|
315
|
-
component.
|
318
|
+
component._u_();
|
316
319
|
}
|
317
320
|
|
318
321
|
var domEvents = componentDef._b_;
|
@@ -340,15 +343,15 @@ function initComponent(componentDef, host) {
|
|
340
343
|
});
|
341
344
|
|
342
345
|
if (eventListenerHandles.length) {
|
343
|
-
component.
|
346
|
+
component._v_ = eventListenerHandles;
|
344
347
|
}
|
345
348
|
}
|
346
349
|
|
347
|
-
if (component.
|
348
|
-
component._w_();
|
349
|
-
} else {
|
350
|
-
component._v_ = true;
|
350
|
+
if (component._w_) {
|
351
351
|
component._x_();
|
352
|
+
} else {
|
353
|
+
component._w_ = true;
|
354
|
+
component._y_();
|
352
355
|
}
|
353
356
|
}
|
354
357
|
|
@@ -364,7 +367,7 @@ function initClientRendered(componentDefs, host) {
|
|
364
367
|
if (!host) host = document;
|
365
368
|
// Ensure that event handlers to handle delegating events are
|
366
369
|
// always attached before initializing any components
|
367
|
-
eventDelegation.
|
370
|
+
eventDelegation._z_(host);
|
368
371
|
var len = componentDefs.length;
|
369
372
|
var componentDef;
|
370
373
|
var i;
|
@@ -477,15 +480,15 @@ function initServerRendered(renderedComponents, host) {
|
|
477
480
|
// Ensure that event handlers to handle delegating events are
|
478
481
|
// always attached before initializing any components
|
479
482
|
indexServerComponentBoundaries(host, runtimeId);
|
480
|
-
eventDelegation.
|
483
|
+
eventDelegation._z_(host);
|
481
484
|
|
482
485
|
if (renderedComponents.g) {
|
483
|
-
meta.
|
486
|
+
meta._A_ = renderedComponents.g;
|
484
487
|
}
|
485
488
|
|
486
489
|
if (renderedComponents.t) {
|
487
|
-
meta.
|
488
|
-
meta.
|
490
|
+
meta._B_ = meta._B_ ?
|
491
|
+
meta._B_.concat(renderedComponents.t) :
|
489
492
|
renderedComponents.t;
|
490
493
|
}
|
491
494
|
|
@@ -493,7 +496,7 @@ function initServerRendered(renderedComponents, host) {
|
|
493
496
|
// and return an array of functions to mount these components
|
494
497
|
(renderedComponents.w || []).
|
495
498
|
map(function (componentDef) {
|
496
|
-
var typeName = meta.
|
499
|
+
var typeName = meta._B_[componentDef[1]];
|
497
500
|
|
498
501
|
return registered[typeName] ||
|
499
502
|
document.readyState === "complete" ||
|
@@ -508,10 +511,10 @@ function initServerRendered(renderedComponents, host) {
|
|
508
511
|
}
|
509
512
|
|
510
513
|
function tryHydrateComponent(rawDef, meta, host, runtimeId) {
|
511
|
-
var componentDef = ComponentDef.
|
514
|
+
var componentDef = ComponentDef._C_(
|
512
515
|
rawDef,
|
516
|
+
meta._B_,
|
513
517
|
meta._A_,
|
514
|
-
meta._z_,
|
515
518
|
exports
|
516
519
|
);
|
517
520
|
var mount = hydrateComponentAndGetMount(componentDef, host);
|
@@ -549,12 +552,12 @@ function hydrateComponentAndGetMount(componentDef, host) {
|
|
549
552
|
if (rootNode) {
|
550
553
|
delete serverComponentRootNodes[componentId];
|
551
554
|
|
552
|
-
component.
|
555
|
+
component._D_ = rootNode;
|
553
556
|
componentsByDOMNode.set(rootNode, component);
|
554
557
|
|
555
558
|
if (componentDef.u_ & FLAG_WILL_RERENDER_IN_BROWSER) {
|
556
559
|
component.B_ = host;
|
557
|
-
renderResult = component.
|
560
|
+
renderResult = component._E_(component.O_, true);
|
558
561
|
trackComponent(componentDef);
|
559
562
|
return function mount() {
|
560
563
|
renderResult.afterInsert(host);
|
@@ -581,9 +584,9 @@ function tryInvoke(fn) {
|
|
581
584
|
}
|
582
585
|
|
583
586
|
exports.r = register;
|
584
|
-
exports.
|
585
|
-
exports.
|
587
|
+
exports._F_ = createComponent;
|
588
|
+
exports._G_ = getComponentClass;
|
586
589
|
exports.U_ = win.$initComponents = initServerRendered;
|
587
590
|
|
588
|
-
require("../../../runtime/components/ComponentsContext").
|
591
|
+
require("../../../runtime/components/ComponentsContext")._H_ =
|
589
592
|
initClientRendered;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";var domData = require("../../../runtime/components/dom-data");
|
2
|
-
var componentsByDOMNode = domData.
|
3
|
-
var keysByDOMNode = domData.
|
2
|
+
var componentsByDOMNode = domData._o_;
|
3
|
+
var keysByDOMNode = domData._m_;
|
4
4
|
var vElementsByDOMNode = domData._J_;
|
5
5
|
var vPropsByDOMNode = domData._K_;
|
6
6
|
var markoUID = window.$MUID || (window.$MUID = { i: 0 });
|
@@ -174,6 +174,6 @@ exports._P_ = destroyComponentForNode;
|
|
174
174
|
exports._Q_ = destroyNodeRecursive;
|
175
175
|
exports._R_ = nextComponentIdProvider;
|
176
176
|
exports._S_ = attachBubblingEvent;
|
177
|
-
exports.
|
177
|
+
exports._q_ = getMarkoPropsFromEl;
|
178
178
|
exports._l_ = addComponentRootToKeyedElements;
|
179
179
|
exports._T_ = normalizeComponentKey;
|
@@ -17,8 +17,8 @@ require("./ComponentsContext").S_;
|
|
17
17
|
var domData = require("./dom-data");
|
18
18
|
var eventDelegation = require("./event-delegation");
|
19
19
|
var updateManager = require("./update-manager");
|
20
|
-
var componentsByDOMNode = domData.
|
21
|
-
var keyedElementsByComponentId = domData.
|
20
|
+
var componentsByDOMNode = domData._o_;
|
21
|
+
var keyedElementsByComponentId = domData._n_;
|
22
22
|
var CONTEXT_KEY = "__subtree_context__";
|
23
23
|
|
24
24
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
@@ -127,8 +127,8 @@ function processUpdateHandlers(component, stateChanges, oldState) {
|
|
127
127
|
handlerMethod.call(component, newValue, oldValue);
|
128
128
|
});
|
129
129
|
|
130
|
-
component.
|
131
|
-
component.
|
130
|
+
component._x_();
|
131
|
+
component._s_();
|
132
132
|
}
|
133
133
|
|
134
134
|
return true;
|
@@ -169,15 +169,15 @@ function Component(id) {
|
|
169
169
|
EventEmitter.call(this);
|
170
170
|
this.id = id;
|
171
171
|
this.z_ = null;
|
172
|
-
this.
|
172
|
+
this._D_ = null;
|
173
173
|
this.ah_ = null;
|
174
|
-
this.
|
174
|
+
this._v_ = null;
|
175
175
|
this.X_ = null; // Used to keep track of bubbling DOM events for components rendered on the server
|
176
176
|
this.V_ = null;
|
177
177
|
this.W_ = null;
|
178
178
|
this.ai_ = null;
|
179
179
|
this.O_ = undefined;
|
180
|
-
this.
|
180
|
+
this._w_ = false;
|
181
181
|
this.aj_ = undefined;
|
182
182
|
this.I_ = false;
|
183
183
|
this._a_ = false;
|
@@ -304,7 +304,7 @@ Component.prototype = componentProto = {
|
|
304
304
|
return;
|
305
305
|
}
|
306
306
|
|
307
|
-
var root = this.
|
307
|
+
var root = this._D_;
|
308
308
|
|
309
309
|
this._M_();
|
310
310
|
|
@@ -332,12 +332,12 @@ Component.prototype = componentProto = {
|
|
332
332
|
this.an_();
|
333
333
|
this.I_ = true;
|
334
334
|
|
335
|
-
componentsByDOMNode.set(this.
|
335
|
+
componentsByDOMNode.set(this._D_, undefined);
|
336
336
|
|
337
|
-
this.
|
337
|
+
this._D_ = null;
|
338
338
|
|
339
339
|
// Unsubscribe from all DOM events
|
340
|
-
this.
|
340
|
+
this._u_();
|
341
341
|
|
342
342
|
var subscriptions = this.ah_;
|
343
343
|
if (subscriptions) {
|
@@ -488,7 +488,7 @@ Component.prototype = componentProto = {
|
|
488
488
|
}
|
489
489
|
}
|
490
490
|
|
491
|
-
this.
|
491
|
+
this._s_();
|
492
492
|
},
|
493
493
|
|
494
494
|
get at_() {
|
@@ -498,13 +498,13 @@ Component.prototype = componentProto = {
|
|
498
498
|
|
499
499
|
},
|
500
500
|
|
501
|
-
|
501
|
+
_s_: function () {
|
502
502
|
this.ak_ = false;
|
503
503
|
this._a_ = false;
|
504
504
|
this.ai_ = null;
|
505
505
|
var state = this.z_;
|
506
506
|
if (state) {
|
507
|
-
state.
|
507
|
+
state._s_();
|
508
508
|
}
|
509
509
|
},
|
510
510
|
|
@@ -523,16 +523,16 @@ Component.prototype = componentProto = {
|
|
523
523
|
var input = this.ai_ || this.O_;
|
524
524
|
|
525
525
|
updateManager.ax_(function () {
|
526
|
-
self.
|
526
|
+
self._E_(input, false).afterInsert(self.B_);
|
527
527
|
});
|
528
528
|
|
529
|
-
this.
|
529
|
+
this._s_();
|
530
530
|
},
|
531
531
|
|
532
|
-
|
532
|
+
_E_: function (input, isHydrate) {
|
533
533
|
var host = this.B_;
|
534
534
|
var globalData = this.aj_;
|
535
|
-
var rootNode = this.
|
535
|
+
var rootNode = this._D_;
|
536
536
|
var renderer = this.Q_;
|
537
537
|
var createOut = renderer.createOut || defaultCreateOut;
|
538
538
|
var out = createOut(globalData);
|
@@ -557,16 +557,16 @@ Component.prototype = componentProto = {
|
|
557
557
|
},
|
558
558
|
|
559
559
|
aA_: function () {
|
560
|
-
var root = this.
|
560
|
+
var root = this._D_;
|
561
561
|
root.remove();
|
562
562
|
return root;
|
563
563
|
},
|
564
564
|
|
565
|
-
|
566
|
-
var eventListenerHandles = this.
|
565
|
+
_u_: function () {
|
566
|
+
var eventListenerHandles = this._v_;
|
567
567
|
if (eventListenerHandles) {
|
568
568
|
eventListenerHandles.forEach(removeListener);
|
569
|
-
this.
|
569
|
+
this._v_ = null;
|
570
570
|
}
|
571
571
|
},
|
572
572
|
|
@@ -592,7 +592,7 @@ Component.prototype = componentProto = {
|
|
592
592
|
},
|
593
593
|
|
594
594
|
get el() {
|
595
|
-
return walkFragments(this.
|
595
|
+
return walkFragments(this._D_);
|
596
596
|
},
|
597
597
|
|
598
598
|
get els() {
|
@@ -602,7 +602,7 @@ Component.prototype = componentProto = {
|
|
602
602
|
|
603
603
|
|
604
604
|
|
605
|
-
return (this.
|
605
|
+
return (this._D_ ? this._D_.nodes : []).filter(
|
606
606
|
function (el) {
|
607
607
|
return el.nodeType === ELEMENT_NODE;
|
608
608
|
}
|
@@ -620,12 +620,12 @@ Component.prototype = componentProto = {
|
|
620
620
|
this.aD_("render", out);
|
621
621
|
},
|
622
622
|
|
623
|
-
|
623
|
+
_x_() {
|
624
624
|
this.onUpdate && this.onUpdate();
|
625
625
|
this.aD_("update");
|
626
626
|
},
|
627
627
|
|
628
|
-
|
628
|
+
_y_() {
|
629
629
|
this.onMount && this.onMount();
|
630
630
|
this.aD_("mount");
|
631
631
|
},
|
@@ -5,7 +5,7 @@ var w10Noop = require("warp10/constants").NOOP;
|
|
5
5
|
var componentUtil = require("@internal/components-util");
|
6
6
|
var attachBubblingEvent = componentUtil._S_;
|
7
7
|
var addDelegatedEventHandler =
|
8
|
-
require("./event-delegation").
|
8
|
+
require("./event-delegation")._r_;
|
9
9
|
var KeySequence = require("./KeySequence");
|
10
10
|
var EMPTY_OBJECT = {};
|
11
11
|
|
@@ -26,7 +26,7 @@ function ComponentDef(component, componentId, componentsContext) {
|
|
26
26
|
|
27
27
|
this._b_ = undefined; // An array of DOM events that need to be added (in sets of three)
|
28
28
|
|
29
|
-
this.
|
29
|
+
this._t_ = false;
|
30
30
|
|
31
31
|
this.t_ = false;
|
32
32
|
this.u_ = 0;
|
@@ -81,14 +81,14 @@ ComponentDef.prototype = {
|
|
81
81
|
return attachBubblingEvent(this, handlerMethodName, isOnce, extraArgs);
|
82
82
|
},
|
83
83
|
|
84
|
-
get
|
85
|
-
return this.s_.
|
84
|
+
get _p_() {
|
85
|
+
return this.s_._p_;
|
86
86
|
}
|
87
87
|
};
|
88
88
|
|
89
89
|
ComponentDef.prototype.nk = ComponentDef.prototype.aL_;
|
90
90
|
|
91
|
-
ComponentDef.
|
91
|
+
ComponentDef._C_ = function (o, types, global, registry) {
|
92
92
|
var id = o[0];
|
93
93
|
var typeName = types[o[1]];
|
94
94
|
var input = o[2] || null;
|
@@ -102,7 +102,7 @@ ComponentDef._B_ = function (o, types, global, registry) {
|
|
102
102
|
|
103
103
|
var component =
|
104
104
|
typeName /* legacy */ &&
|
105
|
-
registry.
|
105
|
+
registry._F_(typeName, id, isLegacy);
|
106
106
|
|
107
107
|
// Prevent newly created component from being queued for update since we area
|
108
108
|
// just building it from the server info
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";var componentsUtil = require("@internal/components-util");
|
2
2
|
var runtimeId = componentsUtil._O_;
|
3
3
|
var componentLookup = componentsUtil._k_;
|
4
|
-
var getMarkoPropsFromEl = componentsUtil.
|
4
|
+
var getMarkoPropsFromEl = componentsUtil._q_;
|
5
5
|
|
6
6
|
var TEXT_NODE = 3;
|
7
7
|
|
@@ -136,8 +136,8 @@ exports.aT_ = noop;
|
|
136
136
|
exports.am_ = noop;
|
137
137
|
exports.aQ_ = delegateEvent;
|
138
138
|
exports.aR_ = getEventFromEl;
|
139
|
-
exports.
|
140
|
-
exports.
|
139
|
+
exports._r_ = addDelegatedEventHandler;
|
140
|
+
exports._z_ = function (host) {
|
141
141
|
Object.keys(delegatedEvents).forEach(function (eventType) {
|
142
142
|
addDelegatedEventHandlerToHost(eventType, host);
|
143
143
|
});
|
@@ -65,9 +65,9 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
68
|
-
if (registry.
|
68
|
+
if (registry._I_ && typeName) {
|
69
69
|
if (renderingLogic) delete renderingLogic.onRender;
|
70
|
-
component = registry.
|
70
|
+
component = registry._F_(
|
71
71
|
renderingLogic,
|
72
72
|
id,
|
73
73
|
input,
|
@@ -93,7 +93,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
93
93
|
if (isRerender) {
|
94
94
|
// Look in in the DOM to see if a component with the same ID and type already exists.
|
95
95
|
component = componentLookup[id];
|
96
|
-
if (component && component.
|
96
|
+
if (component && component._p_ !== typeName) {
|
97
97
|
component = undefined;
|
98
98
|
}
|
99
99
|
}
|
@@ -104,7 +104,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
104
104
|
isExisting = false;
|
105
105
|
// We need to create a new instance of the component
|
106
106
|
if (typeName) {
|
107
|
-
component = registry.
|
107
|
+
component = registry._F_(typeName, id);
|
108
108
|
}
|
109
109
|
}
|
110
110
|
}
|
@@ -143,15 +143,15 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
143
143
|
var vComponentNode = out.aa_;
|
144
144
|
|
145
145
|
componentDef.s_ = isFakeComponent ? null : component;
|
146
|
-
componentDef.
|
146
|
+
componentDef._t_ = isExisting;
|
147
147
|
componentDef.y_ = true;
|
148
148
|
|
149
149
|
componentDef.t = function (typeName) {
|
150
150
|
if (typeName) {
|
151
|
-
if (registry.
|
151
|
+
if (registry._I_) {
|
152
152
|
var oldComponent = component;
|
153
153
|
if (renderingLogic) delete renderingLogic.onRender;
|
154
|
-
component = registry.
|
154
|
+
component = registry._F_(
|
155
155
|
renderingLogic || {},
|
156
156
|
id,
|
157
157
|
input,
|
@@ -183,7 +183,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
183
183
|
this
|
184
184
|
);
|
185
185
|
} else {
|
186
|
-
vComponentNode.s_ = component = registry.
|
186
|
+
vComponentNode.s_ = component = registry._F_(
|
187
187
|
typeName,
|
188
188
|
component.id
|
189
189
|
);
|
@@ -194,7 +194,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
194
194
|
return component;
|
195
195
|
};
|
196
196
|
|
197
|
-
if (!registry.
|
197
|
+
if (!registry._I_) {
|
198
198
|
component.L_ && component.L_();
|
199
199
|
}
|
200
200
|
|
@@ -210,7 +210,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
210
210
|
);
|
211
211
|
|
212
212
|
if (customEvents && componentDef.s_) {
|
213
|
-
if (registry.
|
213
|
+
if (registry._I_) {
|
214
214
|
componentDef.V_ = customEvents;
|
215
215
|
componentDef.W_ = ownerComponentId;
|
216
216
|
} else {
|
@@ -7,7 +7,7 @@ var componentLookup = componentsUtil._k_;
|
|
7
7
|
|
8
8
|
var ComponentsContext = require("./ComponentsContext");
|
9
9
|
var getComponentsContext = ComponentsContext.S_;
|
10
|
-
var isServer = componentsUtil.
|
10
|
+
var isServer = componentsUtil._I_ === true;
|
11
11
|
|
12
12
|
var COMPONENT_BEGIN_ASYNC_ADDED_KEY = "$wa";
|
13
13
|
|
@@ -123,7 +123,7 @@ renderingLogic)
|
|
123
123
|
// we don't need to match up the UI component with a previously
|
124
124
|
// rendered component already mounted to the DOM. We also create
|
125
125
|
// a lightweight ServerComponent
|
126
|
-
component = registry.
|
126
|
+
component = registry._F_(
|
127
127
|
renderingLogic,
|
128
128
|
id,
|
129
129
|
input,
|
@@ -141,7 +141,7 @@ renderingLogic)
|
|
141
141
|
if (
|
142
142
|
isRerender && (
|
143
143
|
component = componentLookup[id]) &&
|
144
|
-
component.
|
144
|
+
component._p_ !== typeName)
|
145
145
|
{
|
146
146
|
// Destroy the existing component since
|
147
147
|
component.destroy();
|
@@ -153,7 +153,7 @@ renderingLogic)
|
|
153
153
|
} else {
|
154
154
|
isExisting = false;
|
155
155
|
// We need to create a new instance of the component
|
156
|
-
component = registry.
|
156
|
+
component = registry._F_(typeName, id);
|
157
157
|
|
158
158
|
if (shouldApplySplitMixins === true) {
|
159
159
|
shouldApplySplitMixins = false;
|
@@ -192,7 +192,7 @@ renderingLogic)
|
|
192
192
|
// node to track that it is a preserve marker
|
193
193
|
out.bb_(component);
|
194
194
|
globalComponentsContext.q_[id] = true;
|
195
|
-
component.
|
195
|
+
component._s_(); // The component is no longer dirty so reset internal flags
|
196
196
|
return;
|
197
197
|
}
|
198
198
|
}
|
@@ -211,7 +211,7 @@ renderingLogic)
|
|
211
211
|
isImplicitComponent
|
212
212
|
);
|
213
213
|
|
214
|
-
componentDef.
|
214
|
+
componentDef._t_ = isExisting;
|
215
215
|
|
216
216
|
// Render the template associated with the component using the final template
|
217
217
|
// data that we constructed
|
@@ -144,7 +144,7 @@ exports.p = function (domCompat) {
|
|
144
144
|
let rootNode = host.fragment;
|
145
145
|
if (!rootNode) {
|
146
146
|
const component = scope.marko5Component = _k_[scope.m5c];
|
147
|
-
rootNode = component.
|
147
|
+
rootNode = component._D_;
|
148
148
|
host = rootNode.startNode;
|
149
149
|
domCompat.setScopeNodes(host, rootNode.endNode);
|
150
150
|
}
|
@@ -183,7 +183,7 @@ exports.p = function (domCompat) {
|
|
183
183
|
getRootNode(host)
|
184
184
|
);
|
185
185
|
const component = componentDefs[0].s_;
|
186
|
-
component.
|
186
|
+
component._D_ = rootNode;
|
187
187
|
component.O_ = input[0];
|
188
188
|
component.V_ = customEvents;
|
189
189
|
scope.marko5Component = component;
|
@@ -597,7 +597,12 @@ var proto = AsyncStream.prototype = {
|
|
597
597
|
var str =
|
598
598
|
"<" +
|
599
599
|
tagName +
|
600
|
-
markoAttr(
|
600
|
+
markoAttr(
|
601
|
+
this,
|
602
|
+
componentDef,
|
603
|
+
props,
|
604
|
+
key && key[0] === "@" ? key : undefined
|
605
|
+
) +
|
601
606
|
attrsHelper(elementAttrs);
|
602
607
|
|
603
608
|
if (selfClosingTags.voidElements.indexOf(tagName) !== -1) {
|
@@ -224,7 +224,7 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
224
224
|
var attrName = attr.name;
|
225
225
|
if (!xmlnsRegExp.test(attrName)) {
|
226
226
|
if (attrName === "data-marko") {
|
227
|
-
props = componentsUtil.
|
227
|
+
props = componentsUtil._q_(node);
|
228
228
|
} else if (attr.namespaceURI === NS_XLINK) {
|
229
229
|
attrs[ATTR_XLINK_HREF] = attr.value;
|
230
230
|
} else {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";var inherit = require("raptor-util/inherit");
|
2
2
|
var domData = require("../components/dom-data");
|
3
|
-
var keysByDOMNode = domData.
|
3
|
+
var keysByDOMNode = domData._m_;
|
4
4
|
var vElementByDOMNode = domData._J_;
|
5
5
|
var createFragmentNode = require("./morphdom/fragment")._j_;
|
6
6
|
var VNode = require("./VNode");
|
@@ -4,7 +4,7 @@ var updateManager = require("../components/update-manager");
|
|
4
4
|
var runtime = require(".");
|
5
5
|
|
6
6
|
var createTemplate = runtime.t;
|
7
|
-
var createComponent = registry.
|
7
|
+
var createComponent = registry._F_;
|
8
8
|
var registered = {};
|
9
9
|
var instancesByType = {};
|
10
10
|
var queue;
|
@@ -31,7 +31,7 @@ exports.t = runtime.t = function (typeName) {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
queue.push(function () {
|
34
|
-
var newProto = registry.
|
34
|
+
var newProto = registry._G_(typeName).prototype;
|
35
35
|
instances.forEach(function (instance) {
|
36
36
|
if (hasLifecycleChanged(instance.__proto__, newProto)) {
|
37
37
|
var renderer = instance.Q_;
|
@@ -46,7 +46,7 @@ exports.t = runtime.t = function (typeName) {
|
|
46
46
|
|
47
47
|
instance.cn_ = true;
|
48
48
|
instance.an_();
|
49
|
-
instance.
|
49
|
+
instance._w_ = false;
|
50
50
|
|
51
51
|
if (instance.ah_) {
|
52
52
|
instance.ah_.removeAllListeners();
|
@@ -55,7 +55,7 @@ exports.t = runtime.t = function (typeName) {
|
|
55
55
|
}
|
56
56
|
|
57
57
|
instance.__proto__ = newProto;
|
58
|
-
instance.
|
58
|
+
instance._E_(
|
59
59
|
instance.O_, false).
|
60
60
|
afterInsert(instance.B_);
|
61
61
|
});
|
@@ -71,7 +71,7 @@ exports.t = runtime.t = function (typeName) {
|
|
71
71
|
}
|
72
72
|
};
|
73
73
|
|
74
|
-
registry.
|
74
|
+
registry._F_ = function (typeName, id) {
|
75
75
|
var instances = instancesByType[typeName];
|
76
76
|
var instance = createComponent(typeName, id);
|
77
77
|
|
@@ -13,8 +13,8 @@ var fragment = require("./fragment");
|
|
13
13
|
var helpers = require("./helpers");
|
14
14
|
var virtualizeElement = VElement.cf_;
|
15
15
|
var morphAttrs = VElement.cg_;
|
16
|
-
var keysByDOMNode = domData.
|
17
|
-
var componentByDOMNode = domData.
|
16
|
+
var keysByDOMNode = domData._m_;
|
17
|
+
var componentByDOMNode = domData._o_;
|
18
18
|
var vElementByDOMNode = domData._J_;
|
19
19
|
var detachedByDOMNode = domData.aU_;
|
20
20
|
|
@@ -104,7 +104,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
104
104
|
ownerComponent,
|
105
105
|
parentComponent)
|
106
106
|
{
|
107
|
-
var rootNode = component.
|
107
|
+
var rootNode = component._D_ = insertBefore(
|
108
108
|
createFragmentNode(),
|
109
109
|
referenceNode,
|
110
110
|
referenceNodeParentEl
|
@@ -126,7 +126,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
126
126
|
}
|
127
127
|
|
128
128
|
function morphComponent(component, vComponent) {
|
129
|
-
morphChildren(component.
|
129
|
+
morphChildren(component._D_, vComponent, component);
|
130
130
|
}
|
131
131
|
|
132
132
|
var detachedNodes = [];
|
@@ -181,7 +181,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
181
181
|
{
|
182
182
|
if (isHydrate) {
|
183
183
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
184
|
-
component.
|
184
|
+
component._D_ = rootNode;
|
185
185
|
componentByDOMNode.set(rootNode, component);
|
186
186
|
|
187
187
|
if (ownerComponent && curToNodeKey) {
|
@@ -214,7 +214,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
214
214
|
);
|
215
215
|
}
|
216
216
|
} else {
|
217
|
-
if (matchingFromComponent.
|
217
|
+
if (matchingFromComponent._D_ !== curFromNodeChild) {
|
218
218
|
if (
|
219
219
|
curFromNodeChild && (
|
220
220
|
fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
|
@@ -224,7 +224,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
224
224
|
{
|
225
225
|
// The component associated with the current real DOM node was not rendered
|
226
226
|
// so we should just remove it out of the real DOM by destroying it
|
227
|
-
curFromNodeChild = nextSibling(fromComponent.
|
227
|
+
curFromNodeChild = nextSibling(fromComponent._D_);
|
228
228
|
destroyComponent(fromComponent);
|
229
229
|
continue;
|
230
230
|
}
|
@@ -232,7 +232,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
232
232
|
// We need to move the existing component into
|
233
233
|
// the correct location
|
234
234
|
insertBefore(
|
235
|
-
matchingFromComponent.
|
235
|
+
matchingFromComponent._D_,
|
236
236
|
curFromNodeChild,
|
237
237
|
fromNode
|
238
238
|
);
|
@@ -596,9 +596,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
596
596
|
curFromNodeType === TEXT_NODE &&
|
597
597
|
toNextSibling.bW_ === TEXT_NODE &&
|
598
598
|
curFromNodeValue.startsWith(curToNodeValue) &&
|
599
|
-
|
600
|
-
|
601
|
-
))
|
599
|
+
curFromNodeValue.
|
600
|
+
slice(curToNodeValue.length).
|
601
|
+
startsWith(toNextSibling.cm_))
|
602
602
|
{
|
603
603
|
// In hydrate mode we can use splitText to more efficiently handle
|
604
604
|
// adjacent text vdom nodes that were merged.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.33.
|
3
|
+
"version": "5.33.19",
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
5
5
|
"keywords": [
|
6
6
|
"front-end",
|
@@ -64,8 +64,8 @@
|
|
64
64
|
"build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
|
65
65
|
},
|
66
66
|
"dependencies": {
|
67
|
-
"@marko/compiler": "^5.35.
|
68
|
-
"@marko/translator-default": "^5.32.
|
67
|
+
"@marko/compiler": "^5.35.14",
|
68
|
+
"@marko/translator-default": "^5.32.16",
|
69
69
|
"app-module-path": "^2.2.0",
|
70
70
|
"argly": "^1.2.0",
|
71
71
|
"browser-refresh-client": "1.1.4",
|
@@ -12,6 +12,7 @@ var req = require("@internal/require");
|
|
12
12
|
var componentLookup = componentsUtil.___componentLookup;
|
13
13
|
var addComponentRootToKeyedElements =
|
14
14
|
componentsUtil.___addComponentRootToKeyedElements;
|
15
|
+
var keysByDOMNode = domData.___keyByDOMNode;
|
15
16
|
var keyedElementsByComponentId = domData.___ssrKeyedElementsByComponentId;
|
16
17
|
var componentsByDOMNode = domData.___componentByDOMNode;
|
17
18
|
var serverComponentRootNodes = {};
|
@@ -233,6 +234,8 @@ function indexServerComponentBoundaries(node, runtimeId, stack) {
|
|
233
234
|
keyedElementsByComponentId[ownerId] ||
|
234
235
|
(keyedElementsByComponentId[ownerId] = {});
|
235
236
|
}
|
237
|
+
|
238
|
+
keysByDOMNode.set(node, markoKey);
|
236
239
|
keyedElements[markoKey] = node;
|
237
240
|
}
|
238
241
|
if (markoProps) {
|
@@ -19,7 +19,8 @@ module.exports = function render(input, out) {
|
|
19
19
|
|
20
20
|
var isPreserved =
|
21
21
|
shouldPreserve &&
|
22
|
-
(isHydrate ||
|
22
|
+
((isComponent && isHydrate) ||
|
23
|
+
referenceComponent.___keyedElements[checkKey]);
|
23
24
|
|
24
25
|
if (isComponent) {
|
25
26
|
out.bf(key, ownerComponent, shouldPreserve);
|
@@ -597,7 +597,12 @@ var proto = (AsyncStream.prototype = {
|
|
597
597
|
var str =
|
598
598
|
"<" +
|
599
599
|
tagName +
|
600
|
-
markoAttr(
|
600
|
+
markoAttr(
|
601
|
+
this,
|
602
|
+
componentDef,
|
603
|
+
props,
|
604
|
+
key && key[0] === "@" ? key : undefined,
|
605
|
+
) +
|
601
606
|
attrsHelper(elementAttrs);
|
602
607
|
|
603
608
|
if (selfClosingTags.voidElements.indexOf(tagName) !== -1) {
|
@@ -596,9 +596,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
596
596
|
curFromNodeType === TEXT_NODE &&
|
597
597
|
toNextSibling.___nodeType === TEXT_NODE &&
|
598
598
|
curFromNodeValue.startsWith(curToNodeValue) &&
|
599
|
-
|
600
|
-
|
601
|
-
|
599
|
+
curFromNodeValue
|
600
|
+
.slice(curToNodeValue.length)
|
601
|
+
.startsWith(toNextSibling.___nodeValue)
|
602
602
|
) {
|
603
603
|
// In hydrate mode we can use splitText to more efficiently handle
|
604
604
|
// adjacent text vdom nodes that were merged.
|