marko 5.31.1 → 5.31.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/components/preserve-tag.js +1 -81
- package/dist/core-tags/core/await/AsyncValue.js +20 -20
- package/dist/core-tags/core/await/renderer.js +11 -11
- package/dist/core-tags/core/await/reorderer-renderer.js +3 -3
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +4 -4
- package/dist/node_modules/@internal/components-beginComponent/index.js +11 -11
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +45 -45
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +3 -3
- package/dist/node_modules/@internal/components-endComponent/index.js +3 -3
- package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
- package/dist/node_modules/@internal/components-entry/index.js +19 -19
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
- package/dist/node_modules/@internal/components-registry/index-browser.js +44 -44
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +20 -20
- package/dist/node_modules/@internal/components-util/index.js +10 -10
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +45 -0
- package/dist/node_modules/@internal/preserve-tag/index.js +34 -0
- package/dist/node_modules/@internal/preserve-tag/package.json +11 -0
- package/dist/node_modules/@internal/require/index-browser.js +6 -4
- package/dist/runtime/RenderResult.js +7 -7
- package/dist/runtime/components/Component.js +88 -88
- package/dist/runtime/components/ComponentDef.js +18 -18
- package/dist/runtime/components/ComponentsContext.js +14 -14
- package/dist/runtime/components/GlobalComponentsContext.js +2 -2
- package/dist/runtime/components/ServerComponent.js +12 -12
- package/dist/runtime/components/State.js +9 -9
- package/dist/runtime/components/attach-detach.js +1 -1
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +6 -6
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +10 -10
- package/dist/runtime/components/legacy/renderer-legacy.js +32 -32
- package/dist/runtime/components/renderer.js +20 -20
- package/dist/runtime/dom-insert.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +9 -9
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/html/AsyncStream.js +6 -6
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/attr.js +1 -1
- package/dist/runtime/html/helpers/data-marko.js +4 -4
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/props-script.js +1 -1
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +1 -1
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +27 -27
- package/dist/runtime/vdom/VComponent.js +2 -2
- package/dist/runtime/vdom/VDocumentFragment.js +1 -1
- package/dist/runtime/vdom/VElement.js +15 -15
- package/dist/runtime/vdom/VFragment.js +4 -4
- package/dist/runtime/vdom/VNode.js +2 -2
- package/dist/runtime/vdom/hot-reload.js +11 -11
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +1 -1
- package/dist/runtime/vdom/morphdom/index.js +36 -36
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +3 -3
- package/package.json +1 -1
- package/src/core-tags/components/preserve-tag.js +1 -81
- package/src/node_modules/@internal/preserve-tag/index-browser.js +45 -0
- package/src/node_modules/@internal/preserve-tag/index.js +34 -0
- package/src/node_modules/@internal/preserve-tag/package.json +11 -0
- package/src/node_modules/@internal/require/index-browser.js +6 -4
- package/src/runtime/components/legacy/defineRenderer-legacy.js +1 -1
@@ -1,81 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var getComponentsContext = ComponentsContext.e_;
|
3
|
-
|
4
|
-
module.exports = function render(input, out) {
|
5
|
-
var isComponent = !input.n;
|
6
|
-
var shouldPreserve = !("i" in input) || input.i;
|
7
|
-
var componentsContext = out.b_;
|
8
|
-
|
9
|
-
if (typeof document === "object") {
|
10
|
-
var isHydrate =
|
11
|
-
componentsContext && componentsContext.f_.g_;
|
12
|
-
var ownerComponent = out.h_.i_;
|
13
|
-
var referenceComponent = ownerComponent;
|
14
|
-
var key = out.j_;
|
15
|
-
var checkKey = key;
|
16
|
-
|
17
|
-
if (key[0] !== "@") {
|
18
|
-
var parentComponent = componentsContext.k_.i_;
|
19
|
-
if (ownerComponent !== parentComponent) {
|
20
|
-
referenceComponent = parentComponent;
|
21
|
-
checkKey += ":" + ownerComponent.id;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
var isPreserved =
|
26
|
-
shouldPreserve && (
|
27
|
-
isHydrate || referenceComponent.l_[checkKey]);
|
28
|
-
|
29
|
-
if (isComponent) {
|
30
|
-
out.bf(key, ownerComponent, shouldPreserve);
|
31
|
-
|
32
|
-
if (!isPreserved && input.renderBody) {
|
33
|
-
input.renderBody(out);
|
34
|
-
}
|
35
|
-
|
36
|
-
out.ef();
|
37
|
-
} else {
|
38
|
-
if (isPreserved) {
|
39
|
-
if (input.b) {
|
40
|
-
out.m_.n_ = true;
|
41
|
-
} else {
|
42
|
-
out.beginElement("", null, key, ownerComponent);
|
43
|
-
out.m_.o_ = true;
|
44
|
-
out.endElement();
|
45
|
-
}
|
46
|
-
} else if (input.renderBody) {
|
47
|
-
input.renderBody(out);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
} else {
|
51
|
-
if (isComponent) {
|
52
|
-
out.bf(
|
53
|
-
out.j_,
|
54
|
-
out.h_.i_,
|
55
|
-
true
|
56
|
-
);
|
57
|
-
}
|
58
|
-
|
59
|
-
if (input.renderBody) {
|
60
|
-
if (shouldPreserve) {
|
61
|
-
var parentPreserved = false;
|
62
|
-
|
63
|
-
if (componentsContext) {
|
64
|
-
parentPreserved = componentsContext.p_;
|
65
|
-
} else {
|
66
|
-
componentsContext = getComponentsContext(out);
|
67
|
-
}
|
68
|
-
|
69
|
-
componentsContext.p_ = true;
|
70
|
-
input.renderBody(out);
|
71
|
-
componentsContext.p_ = parentPreserved;
|
72
|
-
} else {
|
73
|
-
input.renderBody(out);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
if (isComponent) {
|
78
|
-
out.ef();
|
79
|
-
}
|
80
|
-
}
|
81
|
-
};
|
1
|
+
"use strict";module.exports = require("@internal/preserve-tag");
|
@@ -5,30 +5,30 @@ function AsyncValue() {
|
|
5
5
|
* The data that was provided via call to resolve(data).
|
6
6
|
* This property is assumed to be public and available for inspection.
|
7
7
|
*/
|
8
|
-
this.
|
8
|
+
this.e_ = undefined;
|
9
9
|
|
10
10
|
/**
|
11
11
|
* The data that was provided via call to reject(err)
|
12
12
|
* This property is assumed to be public and available for inspection.
|
13
13
|
*/
|
14
|
-
this.
|
14
|
+
this.f_ = undefined;
|
15
15
|
|
16
16
|
/**
|
17
17
|
* The queue of callbacks that are waiting for data
|
18
18
|
*/
|
19
|
-
this.
|
19
|
+
this.g_ = undefined;
|
20
20
|
|
21
21
|
/**
|
22
22
|
* The state of the data holder (STATE_INITIAL, STATE_RESOLVED, or STATE_REJECTED)
|
23
23
|
*/
|
24
|
-
this.
|
24
|
+
this.h_ = false;
|
25
25
|
}
|
26
26
|
|
27
27
|
function notifyCallbacks(asyncValue, err, value) {
|
28
|
-
var callbacks = asyncValue.
|
28
|
+
var callbacks = asyncValue.g_;
|
29
29
|
if (callbacks) {
|
30
30
|
// clear out the registered callbacks (we still have reference to the original value)
|
31
|
-
asyncValue.
|
31
|
+
asyncValue.g_ = undefined;
|
32
32
|
|
33
33
|
// invoke all of the callbacks and use their scope
|
34
34
|
for (var i = 0; i < callbacks.length; i++) {
|
@@ -46,14 +46,14 @@ AsyncValue.prototype = {
|
|
46
46
|
* The given callback will be invoked when there is an error or resolved data
|
47
47
|
* available.
|
48
48
|
*/
|
49
|
-
|
49
|
+
i_: function (callback) {
|
50
50
|
// Do we already have data or error?
|
51
|
-
if (this.
|
51
|
+
if (this.h_) {
|
52
52
|
// invoke the callback immediately
|
53
|
-
return callback(this.
|
53
|
+
return callback(this.f_, this.e_);
|
54
54
|
}
|
55
55
|
|
56
|
-
var callbacks = this.
|
56
|
+
var callbacks = this.g_ || (this.g_ = []);
|
57
57
|
callbacks.push(callback);
|
58
58
|
},
|
59
59
|
|
@@ -63,19 +63,19 @@ AsyncValue.prototype = {
|
|
63
63
|
* its initial state so that any future requests to load data will trigger a
|
64
64
|
* new load call.
|
65
65
|
*/
|
66
|
-
|
67
|
-
if (this.
|
66
|
+
j_: function (err) {
|
67
|
+
if (this.h_) {
|
68
68
|
return;
|
69
69
|
}
|
70
70
|
|
71
71
|
// remember the error
|
72
|
-
this.
|
72
|
+
this.f_ = err;
|
73
73
|
|
74
74
|
// Go to the rejected state if we don't have a loader.
|
75
75
|
// If we do have a loader then return to the initial state
|
76
76
|
// (we do this so that next call to done() will trigger load
|
77
77
|
// again in case the error was transient).
|
78
|
-
this.
|
78
|
+
this.h_ = true;
|
79
79
|
|
80
80
|
// always notify callbacks regardless of whether or not we return to the initial state
|
81
81
|
notifyCallbacks(this, err, null);
|
@@ -84,8 +84,8 @@ AsyncValue.prototype = {
|
|
84
84
|
/**
|
85
85
|
* This method will trigger any callbacks to be notified of data.
|
86
86
|
*/
|
87
|
-
|
88
|
-
if (this.
|
87
|
+
k_: function (value) {
|
88
|
+
if (this.h_) {
|
89
89
|
return;
|
90
90
|
}
|
91
91
|
|
@@ -94,10 +94,10 @@ AsyncValue.prototype = {
|
|
94
94
|
|
95
95
|
var finalPromise = value.then(
|
96
96
|
function onFulfilled(value) {
|
97
|
-
queueMicrotask(asyncValue.
|
97
|
+
queueMicrotask(asyncValue.k_.bind(asyncValue, value));
|
98
98
|
},
|
99
99
|
function onRejected(err) {
|
100
|
-
queueMicrotask(asyncValue.
|
100
|
+
queueMicrotask(asyncValue.j_.bind(asyncValue, err));
|
101
101
|
}
|
102
102
|
);
|
103
103
|
|
@@ -106,10 +106,10 @@ AsyncValue.prototype = {
|
|
106
106
|
}
|
107
107
|
} else {
|
108
108
|
// remember the state
|
109
|
-
this.
|
109
|
+
this.e_ = value;
|
110
110
|
|
111
111
|
// go to the resolved state
|
112
|
-
this.
|
112
|
+
this.h_ = true;
|
113
113
|
|
114
114
|
// notify callbacks
|
115
115
|
notifyCallbacks(this, null, value);
|
@@ -24,9 +24,9 @@ function requestData(provider, timeout) {
|
|
24
24
|
|
25
25
|
var callback = function (err, data) {
|
26
26
|
if (err) {
|
27
|
-
asyncValue.
|
27
|
+
asyncValue.j_(err);
|
28
28
|
} else {
|
29
|
-
asyncValue.
|
29
|
+
asyncValue.k_(data);
|
30
30
|
}
|
31
31
|
};
|
32
32
|
|
@@ -38,11 +38,11 @@ function requestData(provider, timeout) {
|
|
38
38
|
provider(null, callback);
|
39
39
|
|
40
40
|
if (value !== undefined) {
|
41
|
-
asyncValue.
|
41
|
+
asyncValue.k_(value);
|
42
42
|
}
|
43
43
|
} else {
|
44
44
|
// Assume the provider is a data object...
|
45
|
-
asyncValue.
|
45
|
+
asyncValue.k_(provider);
|
46
46
|
}
|
47
47
|
|
48
48
|
if (timeout == null) {
|
@@ -64,10 +64,10 @@ function requestData(provider, timeout) {
|
|
64
64
|
if (!error) error = new Error(errorMsg);
|
65
65
|
error.code = "ERR_AWAIT_TIMEDOUT";
|
66
66
|
error.name = "TimeoutError";
|
67
|
-
asyncValue.
|
67
|
+
asyncValue.j_(error);
|
68
68
|
}, timeout);
|
69
69
|
|
70
|
-
asyncValue.
|
70
|
+
asyncValue.i_(function () {
|
71
71
|
if (timeoutId != null) {
|
72
72
|
clearTimeout(timeoutId);
|
73
73
|
}
|
@@ -91,8 +91,8 @@ module.exports = function awaitTag(input, out) {
|
|
91
91
|
var asyncValue = requestData(provider, timeout);
|
92
92
|
var placeholderRenderer = input.placeholder && input.placeholder.renderBody;
|
93
93
|
|
94
|
-
if (asyncValue.
|
95
|
-
renderContents(asyncValue.
|
94
|
+
if (asyncValue.h_) {
|
95
|
+
renderContents(asyncValue.f_, asyncValue.e_, input, out);
|
96
96
|
return;
|
97
97
|
}
|
98
98
|
|
@@ -109,8 +109,8 @@ module.exports = function awaitTag(input, out) {
|
|
109
109
|
awaitInfo.after = input.showAfter;
|
110
110
|
|
111
111
|
clientReorderContext =
|
112
|
-
out.global.
|
113
|
-
out.global.
|
112
|
+
out.global.l_ || (
|
113
|
+
out.global.l_ = {
|
114
114
|
instances: [],
|
115
115
|
nextId: 0
|
116
116
|
});
|
@@ -210,7 +210,7 @@ module.exports = function awaitTag(input, out) {
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
|
213
|
-
asyncValue.
|
213
|
+
asyncValue.i_(renderBody);
|
214
214
|
};
|
215
215
|
|
216
216
|
function renderContents(err, data, input, out) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var escapeDoubleQuotes =
|
4
|
-
require("../../../runtime/html/helpers/escape-quotes").
|
4
|
+
require("../../../runtime/html/helpers/escape-quotes").m_;
|
5
5
|
|
6
6
|
module.exports = function (input, out) {
|
7
7
|
// We cannot call beginSync() when using renderSync(). In this case we will
|
@@ -20,7 +20,7 @@ module.exports = function (input, out) {
|
|
20
20
|
|
21
21
|
global.__awaitReordererInvoked = true;
|
22
22
|
|
23
|
-
if (out.global.
|
23
|
+
if (out.global.l_) {
|
24
24
|
out.flush();
|
25
25
|
}
|
26
26
|
|
@@ -31,7 +31,7 @@ module.exports = function (input, out) {
|
|
31
31
|
});
|
32
32
|
|
33
33
|
out.onLast(function (next) {
|
34
|
-
var awaitContext = global.
|
34
|
+
var awaitContext = global.l_;
|
35
35
|
var remaining;
|
36
36
|
|
37
37
|
// Validate that we have remaining <await> instances that need handled
|
@@ -7,17 +7,17 @@ key,
|
|
7
7
|
ownerComponentDef)
|
8
8
|
{
|
9
9
|
var componentId = component.id;
|
10
|
-
var componentDef = componentsContext.
|
10
|
+
var componentDef = componentsContext.n_ = new ComponentDef(
|
11
11
|
component,
|
12
12
|
componentId,
|
13
13
|
componentsContext
|
14
14
|
);
|
15
|
-
componentsContext.
|
15
|
+
componentsContext.o_.p_[
|
16
16
|
componentId] =
|
17
17
|
true;
|
18
18
|
componentsContext.b_.push(componentDef);
|
19
19
|
|
20
|
-
var out = componentsContext.
|
21
|
-
out.bc(component, key, ownerComponentDef && ownerComponentDef.
|
20
|
+
var out = componentsContext.q_;
|
21
|
+
out.bc(component, key, ownerComponentDef && ownerComponentDef.r_);
|
22
22
|
return componentDef;
|
23
23
|
};
|
@@ -21,20 +21,20 @@ existingComponentDef)
|
|
21
21
|
// widget. It should be removed when the legacy compat layer is removed.
|
22
22
|
var componentDef =
|
23
23
|
existingComponentDef || (
|
24
|
-
componentsContext.
|
24
|
+
componentsContext.n_ = new ComponentDef(
|
25
25
|
component,
|
26
26
|
componentId,
|
27
27
|
componentsContext
|
28
28
|
));
|
29
29
|
|
30
30
|
var ownerIsRenderBoundary =
|
31
|
-
ownerComponentDef && ownerComponentDef.
|
31
|
+
ownerComponentDef && ownerComponentDef.s_;
|
32
32
|
var ownerWillRerender =
|
33
33
|
ownerComponentDef &&
|
34
|
-
ownerComponentDef.
|
34
|
+
ownerComponentDef.t_ & FLAG_WILL_RERENDER_IN_BROWSER;
|
35
35
|
// On the server
|
36
|
-
if (!componentsContext.
|
37
|
-
componentDef.
|
36
|
+
if (!componentsContext.u_ && ownerWillRerender) {
|
37
|
+
componentDef.t_ |= FLAG_WILL_RERENDER_IN_BROWSER;
|
38
38
|
componentDef._wrr = true;
|
39
39
|
return componentDef;
|
40
40
|
}
|
@@ -48,20 +48,20 @@ existingComponentDef)
|
|
48
48
|
|
49
49
|
componentsContext.b_.push(componentDef);
|
50
50
|
|
51
|
-
let out = componentsContext.
|
51
|
+
let out = componentsContext.q_;
|
52
52
|
let runtimeId = out.global.runtimeId;
|
53
53
|
|
54
|
-
componentDef.
|
55
|
-
componentDef.
|
54
|
+
componentDef.s_ = true;
|
55
|
+
componentDef.v_ = componentsContext.u_;
|
56
56
|
|
57
57
|
if (isSplitComponent === false && out.global.noBrowserRerender !== true) {
|
58
|
-
componentDef.
|
58
|
+
componentDef.t_ |= FLAG_WILL_RERENDER_IN_BROWSER;
|
59
59
|
componentDef._wrr = true;
|
60
|
-
componentsContext.
|
60
|
+
componentsContext.u_ = false;
|
61
61
|
}
|
62
62
|
|
63
63
|
if (out.global.oldHydrateNoCreate === true) {
|
64
|
-
componentDef.
|
64
|
+
componentDef.t_ |= FLAG_OLD_HYDRATE_NO_CREATE;
|
65
65
|
}
|
66
66
|
|
67
67
|
if ((ownerIsRenderBoundary || ownerWillRerender) && key != null) {
|
@@ -21,7 +21,7 @@ function noop() {}
|
|
21
21
|
module.exports = function defineWidget(def, renderer) {
|
22
22
|
def = def.Widget || def;
|
23
23
|
|
24
|
-
if (def.
|
24
|
+
if (def.w_) {
|
25
25
|
return def;
|
26
26
|
}
|
27
27
|
|
@@ -51,7 +51,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
51
51
|
BaseComponent.call(this, id, doc);
|
52
52
|
}
|
53
53
|
|
54
|
-
if (!proto.
|
54
|
+
if (!proto.w_) {
|
55
55
|
// Inherit from Component if they didn't already
|
56
56
|
ComponentClass.prototype = Object.create(BaseComponent.prototype);
|
57
57
|
for (var propName in proto) {
|
@@ -64,16 +64,16 @@ module.exports = function defineWidget(def, renderer) {
|
|
64
64
|
// The same prototype will be used by our constructor after
|
65
65
|
// we he have set up the prototype chain using the inherit function
|
66
66
|
proto = Component.prototype = ComponentClass.prototype;
|
67
|
-
proto.
|
67
|
+
proto.x_ = true;
|
68
68
|
|
69
69
|
proto.constructor = def.constructor = Component;
|
70
70
|
|
71
71
|
Object.defineProperty(proto, "state", {
|
72
72
|
get: function () {
|
73
|
-
var raw = this.
|
73
|
+
var raw = this.y_ && this.y_.z_;
|
74
74
|
|
75
75
|
if (raw && !raw.toJSON) {
|
76
|
-
Object.defineProperty(this.
|
76
|
+
Object.defineProperty(this.y_.z_, "toJSON", stateToJSONDef);
|
77
77
|
}
|
78
78
|
|
79
79
|
return raw;
|
@@ -103,7 +103,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
103
103
|
|
104
104
|
|
105
105
|
|
106
|
-
return this.
|
106
|
+
return this.A_;
|
107
107
|
}
|
108
108
|
});
|
109
109
|
|
@@ -121,37 +121,37 @@ module.exports = function defineWidget(def, renderer) {
|
|
121
121
|
|
122
122
|
|
123
123
|
|
124
|
-
return this.
|
124
|
+
return this.B_;
|
125
125
|
}
|
126
126
|
});
|
127
127
|
|
128
128
|
// get legacy methods
|
129
129
|
|
130
|
-
proto.
|
130
|
+
proto.C_ = proto.onRender;
|
131
131
|
Object.defineProperty(proto, "onRender", {
|
132
132
|
get: noop,
|
133
133
|
set: function (v) {
|
134
|
-
proto.
|
134
|
+
proto.C_ = v;
|
135
135
|
}
|
136
136
|
});
|
137
137
|
|
138
|
-
proto.
|
138
|
+
proto.D_ = proto.onUpdate;
|
139
139
|
Object.defineProperty(proto, "onUpdate", {
|
140
140
|
get: function () {
|
141
141
|
return modernMountOrUpdate;
|
142
142
|
},
|
143
143
|
set: function (v) {
|
144
|
-
proto.
|
144
|
+
proto.D_ = v;
|
145
145
|
}
|
146
146
|
});
|
147
147
|
|
148
|
-
proto.
|
148
|
+
proto.E_ = proto.onDestroy;
|
149
149
|
Object.defineProperty(proto, "onDestroy", {
|
150
150
|
get: function () {
|
151
151
|
return modernOnDestory;
|
152
152
|
},
|
153
153
|
set: function (v) {
|
154
|
-
proto.
|
154
|
+
proto.E_ = v;
|
155
155
|
}
|
156
156
|
});
|
157
157
|
|
@@ -160,13 +160,13 @@ module.exports = function defineWidget(def, renderer) {
|
|
160
160
|
proto.onMount = modernMountOrUpdate;
|
161
161
|
|
162
162
|
if (legacyInit) {
|
163
|
-
proto.
|
163
|
+
proto.F_ = legacyInit;
|
164
164
|
}
|
165
165
|
|
166
166
|
// convert legacy to modern
|
167
|
-
proto.
|
167
|
+
proto.G_ = proto.update;
|
168
168
|
proto.update = function () {
|
169
|
-
if (this.
|
169
|
+
if (this.H_) {
|
170
170
|
// eslint-disable-next-line no-constant-condition
|
171
171
|
|
172
172
|
|
@@ -178,36 +178,36 @@ module.exports = function defineWidget(def, renderer) {
|
|
178
178
|
|
179
179
|
|
180
180
|
this.destroy = modernOnDestory;
|
181
|
-
this.
|
181
|
+
this.H_ = false;
|
182
182
|
}
|
183
|
-
this.
|
184
|
-
if (this.
|
183
|
+
this.I_ = true;
|
184
|
+
if (this.B_) {
|
185
185
|
this.onBeforeUpdate && this.onBeforeUpdate();
|
186
186
|
}
|
187
187
|
|
188
|
-
this.
|
189
|
-
this.
|
188
|
+
this.G_();
|
189
|
+
this.I_ = false;
|
190
190
|
};
|
191
191
|
|
192
192
|
function modernMountOrUpdate() {
|
193
193
|
var self = this;
|
194
|
-
var el = this.
|
195
|
-
var prevEl = this.
|
194
|
+
var el = this.J_["@_wbind"];
|
195
|
+
var prevEl = this.B_;
|
196
196
|
|
197
197
|
if (prevEl !== el) {
|
198
|
-
this.
|
198
|
+
this.B_ = el;
|
199
199
|
|
200
200
|
if (prevEl) {
|
201
201
|
this.onBeforeDestroy && this.onBeforeDestroy();
|
202
|
-
this.
|
203
|
-
this.
|
202
|
+
this.E_ && this.E_();
|
203
|
+
this.K_ = undefined;
|
204
204
|
this.removeAllListeners();
|
205
205
|
}
|
206
206
|
|
207
207
|
if (el) {
|
208
|
-
this.
|
209
|
-
this.
|
210
|
-
this.
|
208
|
+
this.F_ && this.F_(this.widgetConfig || {});
|
209
|
+
this.C_ && this.C_({ firstRender: true });
|
210
|
+
this.K_ = legacyRender;
|
211
211
|
|
212
212
|
// eslint-disable-next-line no-constant-condition
|
213
213
|
|
@@ -224,45 +224,45 @@ module.exports = function defineWidget(def, renderer) {
|
|
224
224
|
}
|
225
225
|
} else if (el) {
|
226
226
|
if (prevEl) {
|
227
|
-
this.
|
227
|
+
this.D_ && this.D_();
|
228
228
|
}
|
229
229
|
|
230
|
-
if (this.
|
231
|
-
this.
|
232
|
-
this.
|
230
|
+
if (this.L_) {
|
231
|
+
this.C_ &&
|
232
|
+
this.C_({ firstRender: false });
|
233
233
|
}
|
234
234
|
}
|
235
235
|
|
236
|
-
this.
|
237
|
-
this.
|
238
|
-
this.
|
236
|
+
this.M_ = this.N_;
|
237
|
+
this.N_ = null;
|
238
|
+
this.L_ = false;
|
239
239
|
}
|
240
240
|
|
241
241
|
function legacyRender() {
|
242
|
-
if (!this.
|
242
|
+
if (!this.I_) {
|
243
243
|
this.onBeforeUpdate && this.onBeforeUpdate();
|
244
244
|
}
|
245
245
|
|
246
|
-
this.
|
246
|
+
this.L_ = true;
|
247
247
|
}
|
248
248
|
|
249
249
|
function modernOnDestory() {
|
250
|
-
if (this.
|
250
|
+
if (this.B_) {
|
251
251
|
this.onBeforeDestroy && this.onBeforeDestroy();
|
252
|
-
this.
|
253
|
-
this.
|
252
|
+
this.E_ && this.E_();
|
253
|
+
this.B_ = null;
|
254
254
|
}
|
255
255
|
}
|
256
256
|
|
257
257
|
// Set a flag on the constructor function to make it clear this is
|
258
258
|
// a component so that we can short-circuit this work later
|
259
|
-
Component.
|
259
|
+
Component.w_ = true;
|
260
260
|
|
261
261
|
function State() {
|
262
262
|
BaseState.apply(this, arguments);
|
263
263
|
}
|
264
264
|
inherit(State, BaseState);
|
265
|
-
proto.
|
265
|
+
proto.O_ = State;
|
266
266
|
|
267
267
|
jQuery.patchComponent(
|
268
268
|
window.$,
|
@@ -297,7 +297,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
297
297
|
if (renderer) {
|
298
298
|
// Add the rendering related methods as statics on the
|
299
299
|
// new component constructor function
|
300
|
-
Component.renderer = proto.
|
300
|
+
Component.renderer = proto.P_ = renderer;
|
301
301
|
Component.render = renderer.render;
|
302
302
|
Component.renderSync = renderer.renderSync;
|
303
303
|
}
|
@@ -320,7 +320,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
320
320
|
template = req(template);
|
321
321
|
}
|
322
322
|
|
323
|
-
registry.r(template.
|
323
|
+
registry.r(template.Q_, function () {
|
324
324
|
return Component;
|
325
325
|
});
|
326
326
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";module.exports = function defineWidget(def, renderer) {
|
2
|
-
if (def.
|
2
|
+
if (def.w_) {
|
3
3
|
return def;
|
4
4
|
}
|
5
5
|
|
6
6
|
if (renderer) {
|
7
7
|
return {
|
8
|
-
|
8
|
+
w_: true,
|
9
9
|
_isWidget: true,
|
10
10
|
renderer: renderer,
|
11
11
|
render: renderer.render,
|
@@ -13,6 +13,6 @@
|
|
13
13
|
template: renderer.template
|
14
14
|
};
|
15
15
|
} else {
|
16
|
-
return {
|
16
|
+
return { w_: true, _isWidget: true };
|
17
17
|
}
|
18
18
|
};
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var ComponentsContext = require("../../../runtime/components/ComponentsContext");
|
4
|
-
var getComponentsContext = ComponentsContext.
|
4
|
+
var getComponentsContext = ComponentsContext.R_;
|
5
5
|
|
6
6
|
module.exports = function endComponent(out, componentDef) {
|
7
|
-
if (componentDef.
|
7
|
+
if (componentDef.s_) {
|
8
8
|
out.w("<!--" + out.global.runtimeId + "/-->");
|
9
|
-
getComponentsContext(out).
|
9
|
+
getComponentsContext(out).u_ = componentDef.v_;
|
10
10
|
}
|
11
11
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";var registry = require("@internal/components-registry");
|
2
2
|
|
3
3
|
exports.getComponentForEl =
|
4
|
-
require("@internal/components-util").
|
5
|
-
exports.init = registry.
|
4
|
+
require("@internal/components-util").S_;
|
5
|
+
exports.init = registry.T_;
|
6
6
|
exports.register = function (id, component) {
|
7
7
|
registry.r(id, function () {
|
8
8
|
return component;
|