marko 5.23.0 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime/components/entry/index-browser.js +2 -6
- package/dist/runtime/components/registry/index-browser.js +444 -20
- package/dist/runtime/components/registry/index.js +1 -1
- package/dist/runtime/components/renderer.js +6 -5
- package/dist/runtime/components/update-manager.js +7 -7
- package/dist/runtime/components/util/index-browser.js +4 -4
- package/dist/runtime/components/util/index.js +2 -2
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +4 -4
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +4 -4
- package/dist/runtime/helpers/repeatable.js +12 -0
- package/dist/runtime/helpers/self-iterator.js +3 -0
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/html/AsyncStream.js +14 -14
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/create-readable/index-browser.js +1 -1
- package/dist/runtime/html/create-readable/index.js +9 -9
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +3 -3
- package/dist/runtime/html/helpers/data-marko.js +1 -1
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/index.js +2 -2
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/setImmediate/index-browser.js +1 -1
- package/dist/runtime/setImmediate/index-worker.js +2 -2
- package/dist/runtime/setImmediate/index.js +2 -2
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +74 -74
- package/dist/runtime/vdom/VComponent.js +3 -3
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +44 -44
- package/dist/runtime/vdom/VFragment.js +5 -5
- package/dist/runtime/vdom/VNode.js +32 -32
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/v-element.js +1 -1
- package/dist/runtime/vdom/helpers/v-text.js +1 -1
- package/dist/runtime/vdom/hot-reload.js +4 -4
- package/dist/runtime/vdom/index.js +2 -2
- package/dist/runtime/vdom/morphdom/fragment.js +4 -4
- package/dist/runtime/vdom/morphdom/helpers.js +4 -4
- package/dist/runtime/vdom/morphdom/index.js +36 -36
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +6 -6
- package/dist/runtime/vdom/preserve-attrs.js +1 -1
- package/dist/runtime/vdom/vdom.js +14 -14
- package/docs/body-content.md +37 -18
- package/docs/class-components.md +1 -1
- package/docs/express.md +2 -2
- package/docs/fastify.md +1 -1
- package/docs/rendering.md +14 -4
- package/docs/typescript.md +13 -13
- package/index.d.ts +4 -2
- package/package.json +3 -3
- package/src/runtime/components/entry/index-browser.js +2 -6
- package/src/runtime/components/registry/index-browser.js +451 -27
- package/src/runtime/components/renderer.js +2 -1
- package/src/runtime/helpers/repeatable.js +12 -0
- package/src/runtime/helpers/self-iterator.js +3 -0
- package/dist/runtime/components/init-components/index-browser.js +0 -453
- package/dist/runtime/components/init-components/index.js +0 -2
- package/dist/runtime/components/init-components/package.json +0 -11
- package/src/runtime/components/init-components/index-browser.js +0 -453
- package/src/runtime/components/init-components/index.js +0 -1
- package/src/runtime/components/init-components/package.json +0 -11
@@ -37,7 +37,7 @@ customEvents)
|
|
37
37
|
var component = componentDef && componentDef.h_;
|
38
38
|
if (typeof tag === "string") {
|
39
39
|
if (renderBody) {
|
40
|
-
out.
|
40
|
+
out.aJ_(
|
41
41
|
tag,
|
42
42
|
attrs,
|
43
43
|
key,
|
@@ -45,9 +45,9 @@ customEvents)
|
|
45
45
|
addEvents(componentDef, customEvents, props));
|
46
46
|
|
47
47
|
renderBody(out);
|
48
|
-
out.
|
48
|
+
out.aK_();
|
49
49
|
} else {
|
50
|
-
out.
|
50
|
+
out.aL_(
|
51
51
|
tag,
|
52
52
|
attrs,
|
53
53
|
key,
|
@@ -144,7 +144,7 @@ function attrsToCamelCase(attrs) {
|
|
144
144
|
var result = {};
|
145
145
|
|
146
146
|
for (var key in attrs) {
|
147
|
-
result[changeCase.
|
147
|
+
result[changeCase.aI_(key)] = attrs[key];
|
148
148
|
}
|
149
149
|
|
150
150
|
return result;
|
@@ -8,7 +8,7 @@ var markoAttr = require("./helpers/data-marko");
|
|
8
8
|
var escapeXmlHelper = require("./helpers/escape-xml");
|
9
9
|
var parseHTML = require("../vdom/parse-html");
|
10
10
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
11
|
-
var escapeXmlString = escapeXmlHelper.
|
11
|
+
var escapeXmlString = escapeXmlHelper.aM_;
|
12
12
|
var selfClosingTags = require("self-closing-tags");
|
13
13
|
|
14
14
|
function noop() {}
|
@@ -93,8 +93,8 @@ function AsyncStream(global, writer, parentOut) {
|
|
93
93
|
|
94
94
|
this.g_ = null;
|
95
95
|
this.i_ = null;
|
96
|
-
this.
|
97
|
-
this.
|
96
|
+
this.av_ = null;
|
97
|
+
this.aN_ = false;
|
98
98
|
}
|
99
99
|
|
100
100
|
AsyncStream.DEFAULT_TIMEOUT = 10000;
|
@@ -115,7 +115,7 @@ AsyncStream.enableAsyncStackTrace = function () {
|
|
115
115
|
var proto = AsyncStream.prototype = {
|
116
116
|
constructor: AsyncStream,
|
117
117
|
Y_: typeof document === "object" && document,
|
118
|
-
|
118
|
+
aO_: true,
|
119
119
|
|
120
120
|
sync: function () {
|
121
121
|
this._sync = true;
|
@@ -154,7 +154,7 @@ var proto = AsyncStream.prototype = {
|
|
154
154
|
return this._state.writer.toString();
|
155
155
|
},
|
156
156
|
|
157
|
-
|
157
|
+
aP_: function () {
|
158
158
|
this._result = this._result || new RenderResult(this);
|
159
159
|
return this._result;
|
160
160
|
},
|
@@ -205,7 +205,7 @@ var proto = AsyncStream.prototype = {
|
|
205
205
|
}
|
206
206
|
|
207
207
|
this._lastCount++;
|
208
|
-
newStream.
|
208
|
+
newStream.aN_ = true;
|
209
209
|
}
|
210
210
|
|
211
211
|
name = options.name;
|
@@ -249,7 +249,7 @@ var proto = AsyncStream.prototype = {
|
|
249
249
|
if (state.writer.end) {
|
250
250
|
state.writer.end();
|
251
251
|
} else {
|
252
|
-
state.events.emit("finish", this.
|
252
|
+
state.events.emit("finish", this.aP_());
|
253
253
|
}
|
254
254
|
},
|
255
255
|
|
@@ -321,7 +321,7 @@ var proto = AsyncStream.prototype = {
|
|
321
321
|
parentOut._handleChildDone(this);
|
322
322
|
}
|
323
323
|
} else {
|
324
|
-
if (childOut.
|
324
|
+
if (childOut.aN_) {
|
325
325
|
this._lastCount--;
|
326
326
|
}
|
327
327
|
|
@@ -362,7 +362,7 @@ var proto = AsyncStream.prototype = {
|
|
362
362
|
var state = this._state;
|
363
363
|
|
364
364
|
if (event === "finish" && state.finished === true) {
|
365
|
-
callback(this.
|
365
|
+
callback(this.aP_());
|
366
366
|
} else if (event === "last") {
|
367
367
|
this.onLast(callback);
|
368
368
|
} else {
|
@@ -376,7 +376,7 @@ var proto = AsyncStream.prototype = {
|
|
376
376
|
var state = this._state;
|
377
377
|
|
378
378
|
if (event === "finish" && state.finished === true) {
|
379
|
-
callback(this.
|
379
|
+
callback(this.aP_());
|
380
380
|
} else if (event === "last") {
|
381
381
|
this.onLast(callback);
|
382
382
|
} else {
|
@@ -501,7 +501,7 @@ var proto = AsyncStream.prototype = {
|
|
501
501
|
return newOut;
|
502
502
|
},
|
503
503
|
|
504
|
-
|
504
|
+
aL_: function (
|
505
505
|
tagName,
|
506
506
|
elementAttrs,
|
507
507
|
key,
|
@@ -535,7 +535,7 @@ var proto = AsyncStream.prototype = {
|
|
535
535
|
this.write(str);
|
536
536
|
},
|
537
537
|
|
538
|
-
|
538
|
+
aJ_: function (
|
539
539
|
name,
|
540
540
|
elementAttrs,
|
541
541
|
key,
|
@@ -652,13 +652,13 @@ var proto = AsyncStream.prototype = {
|
|
652
652
|
c: function (componentDef, key, customEvents) {
|
653
653
|
this.g_ = componentDef;
|
654
654
|
this.i_ = key;
|
655
|
-
this.
|
655
|
+
this.av_ = customEvents;
|
656
656
|
}
|
657
657
|
};
|
658
658
|
|
659
659
|
// alias:
|
660
660
|
proto.w = proto.write;
|
661
|
-
proto.
|
661
|
+
proto.aK_ = proto.endElement;
|
662
662
|
|
663
663
|
module.exports = AsyncStream;
|
664
664
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const immediate = require("../setImmediate");
|
4
|
-
const setImmediate = immediate.
|
5
|
-
const clearImmediate = immediate.
|
4
|
+
const setImmediate = immediate.ax_;
|
5
|
+
const clearImmediate = immediate.aQ_;
|
6
6
|
const StringWriter = require("./StringWriter");
|
7
7
|
|
8
8
|
/**
|
@@ -17,9 +17,9 @@ if (String(OutgoingMessageProto.flush).indexOf("deprecated") !== -1) {
|
|
17
17
|
class Readable extends stream.Readable {
|
18
18
|
constructor(template, data) {
|
19
19
|
super();
|
20
|
-
this.
|
21
|
-
this.
|
22
|
-
this.
|
20
|
+
this.aS_ = template;
|
21
|
+
this.aT_ = data;
|
22
|
+
this.aU_ = false;
|
23
23
|
}
|
24
24
|
|
25
25
|
write(data) {
|
@@ -33,19 +33,19 @@ class Readable extends stream.Readable {
|
|
33
33
|
}
|
34
34
|
|
35
35
|
_read() {
|
36
|
-
if (this.
|
36
|
+
if (this.aU_) {
|
37
37
|
return;
|
38
38
|
}
|
39
39
|
|
40
|
-
this.
|
41
|
-
var template = this.
|
42
|
-
var data = this.
|
40
|
+
this.aU_ = true;
|
41
|
+
var template = this.aS_;
|
42
|
+
var data = this.aT_;
|
43
43
|
var globalData = data && data.$global;
|
44
|
-
var out = this.
|
44
|
+
var out = this.aS_.createOut(
|
45
45
|
globalData,
|
46
46
|
this,
|
47
47
|
undefined,
|
48
|
-
template.
|
48
|
+
template.aR_);
|
49
49
|
|
50
50
|
template.render(data, out);
|
51
51
|
out.end();
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
var attrHelper = require("./attr");
|
3
|
-
var notEmptyAttr = attrHelper.
|
4
|
-
var isEmptyAttrValue = attrHelper.
|
3
|
+
var notEmptyAttr = attrHelper.aV_;
|
4
|
+
var isEmptyAttrValue = attrHelper.aW_;
|
5
5
|
var classHelper = require("./class-attr");
|
6
6
|
var styleHelper = require("./style-attr");
|
7
7
|
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
4
4
|
var escapeDoubleQuotes = escapeQuoteHelpers.y_;
|
5
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
5
|
+
var escapeSingleQuotes = escapeQuoteHelpers.aX_;
|
6
6
|
|
7
7
|
module.exports = maybeEmptyAttr;
|
8
8
|
|
9
|
-
maybeEmptyAttr.
|
10
|
-
maybeEmptyAttr.
|
9
|
+
maybeEmptyAttr.aV_ = notEmptyAttr;
|
10
|
+
maybeEmptyAttr.aW_ = isEmpty;
|
11
11
|
|
12
12
|
function maybeEmptyAttr(name, value) {
|
13
13
|
if (isEmpty(value)) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
4
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
4
|
+
var escapeSingleQuotes = escapeQuoteHelpers.aX_;
|
5
5
|
var escapeDoubleQuotes = escapeQuoteHelpers.y_;
|
6
6
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
7
7
|
// var FLAG_HAS_RENDER_BODY = 2;
|
@@ -15,13 +15,13 @@ exports.t = function createTemplate(typeName) {
|
|
15
15
|
};
|
16
16
|
|
17
17
|
function Template(typeName) {
|
18
|
-
this.
|
18
|
+
this.aY_ = typeName;
|
19
19
|
}
|
20
20
|
|
21
21
|
Template.prototype.stream = require("./create-readable");
|
22
22
|
|
23
23
|
var AsyncStream = require("./AsyncStream");
|
24
|
-
require("../createOut").
|
24
|
+
require("../createOut").aD_(
|
25
25
|
Template.prototype.createOut = function createOut(
|
26
26
|
globalData,
|
27
27
|
writer,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";var defaultCreateOut = require("./createOut");
|
2
|
-
var setImmediate = require("./setImmediate").
|
2
|
+
var setImmediate = require("./setImmediate").ax_;
|
3
3
|
var extend = require("raptor-util/extend");
|
4
4
|
|
5
5
|
function safeRender(renderFunc, finalData, finalOut, shouldEnd) {
|
@@ -70,7 +70,7 @@ module.exports = function (target, renderer) {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
render(localData, out);
|
73
|
-
return out.
|
73
|
+
return out.aP_();
|
74
74
|
},
|
75
75
|
|
76
76
|
/**
|
@@ -96,7 +96,7 @@ module.exports = function (target, renderer) {
|
|
96
96
|
var finalData;
|
97
97
|
var globalData;
|
98
98
|
var render = renderFunc || this._;
|
99
|
-
var shouldBuffer = this.
|
99
|
+
var shouldBuffer = this.aR_;
|
100
100
|
var shouldEnd = true;
|
101
101
|
|
102
102
|
if (data) {
|
@@ -108,7 +108,7 @@ module.exports = function (target, renderer) {
|
|
108
108
|
finalData = {};
|
109
109
|
}
|
110
110
|
|
111
|
-
if (out && out.
|
111
|
+
if (out && out.aO_) {
|
112
112
|
finalOut = out;
|
113
113
|
shouldEnd = false;
|
114
114
|
extend(out.global, globalData);
|
@@ -127,7 +127,7 @@ module.exports = function (target, renderer) {
|
|
127
127
|
if (callback) {
|
128
128
|
finalOut.
|
129
129
|
on("finish", function () {
|
130
|
-
callback(null, finalOut.
|
130
|
+
callback(null, finalOut.aP_());
|
131
131
|
}).
|
132
132
|
once("error", callback);
|
133
133
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";exports.
|
2
|
-
exports.
|
1
|
+
"use strict";exports.ax_ = setTimeout;
|
2
|
+
exports.aQ_ = clearTimeout;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";exports.
|
2
|
-
exports.
|
1
|
+
"use strict";exports.ax_ = setImmediate;
|
2
|
+
exports.aQ_ = clearImmediate;
|