marko 5.32.4 → 5.32.6
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/bin/markoc.js +34 -37
- package/dist/compiler/index.js +3 -3
- package/dist/runtime/components/Component.js +14 -15
- package/dist/runtime/components/ComponentDef.js +1 -1
- package/dist/runtime/components/defineComponent.js +2 -2
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +2 -2
- package/dist/runtime/components/legacy/dependencies/html.js +2 -2
- package/dist/runtime/components/legacy/dependencies/vdom.js +2 -2
- package/dist/runtime/components/legacy/renderer-legacy.js +5 -5
- package/dist/runtime/components/renderer.js +5 -5
- package/dist/runtime/helpers/dynamic-tag.js +3 -3
- package/dist/runtime/html/AsyncStream.js +4 -4
- package/dist/runtime/html/helpers/class-attr.js +1 -1
- package/dist/runtime/html/helpers/style-attr.js +1 -1
- package/dist/runtime/renderable.js +2 -2
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +3 -3
- package/dist/runtime/vdom/VComponent.js +2 -2
- package/dist/runtime/vdom/VDocumentFragment.js +2 -2
- package/dist/runtime/vdom/VElement.js +2 -2
- package/dist/runtime/vdom/VFragment.js +3 -3
- package/dist/runtime/vdom/VText.js +2 -2
- package/dist/runtime/vdom/hot-reload.js +3 -3
- package/dist/runtime/vdom/morphdom/index.js +6 -6
- package/dist/runtime/vdom/vdom.js +4 -4
- package/docs/10-awesome-marko-features.md +1 -1
- package/docs/class-components.md +1 -1
- package/docs/compiler.md +2 -2
- package/docs/http.md +1 -1
- package/docs/lasso.md +1 -1
- package/docs/marko-vs-react.md +1 -1
- package/docs/rendering.md +1 -1
- package/docs/rollup.md +4 -4
- package/docs/why-is-marko-fast.md +1 -1
- package/index.d.ts +46 -46
- package/package.json +6 -6
- package/src/compiler/index.js +6 -6
- package/src/core-tags/core/await/AsyncValue.js +1 -1
- package/src/core-tags/core/await/client-reorder-runtime.js +1 -1
- package/src/core-tags/core/await/renderer.js +1 -1
- package/src/core-tags/core/await/reorderer-renderer.js +4 -4
- package/src/node-require/browser-refresh.js +1 -1
- package/src/node-require/hot-reload.js +2 -2
- package/src/node-require/index.js +3 -3
- package/src/runtime/RenderResult.js +3 -3
- package/src/runtime/components/Component.js +21 -22
- package/src/runtime/components/ComponentDef.js +1 -1
- package/src/runtime/components/State.js +2 -2
- package/src/runtime/components/defineComponent.js +2 -2
- package/src/runtime/components/event-delegation.js +1 -1
- package/src/runtime/components/legacy/defineRenderer-legacy.js +3 -3
- package/src/runtime/components/legacy/dependencies/html.js +1 -1
- package/src/runtime/components/legacy/dependencies/index.js +2 -2
- package/src/runtime/components/legacy/dependencies/vdom.js +1 -1
- package/src/runtime/components/legacy/renderer-legacy.js +14 -14
- package/src/runtime/components/renderer.js +10 -10
- package/src/runtime/helpers/_change-case.js +1 -1
- package/src/runtime/helpers/dynamic-tag.js +11 -11
- package/src/runtime/helpers/render-tag.js +2 -2
- package/src/runtime/html/AsyncStream.js +8 -8
- package/src/runtime/html/BufferedWriter.js +1 -1
- package/src/runtime/html/helpers/attr.js +1 -1
- package/src/runtime/html/helpers/attrs.js +1 -1
- package/src/runtime/html/helpers/class-attr.js +1 -1
- package/src/runtime/html/helpers/data-marko.js +1 -1
- package/src/runtime/html/helpers/merge-attrs.js +2 -2
- package/src/runtime/html/helpers/style-attr.js +1 -1
- package/src/runtime/html/index.js +2 -2
- package/src/runtime/queueMicrotask.js +4 -4
- package/src/runtime/renderable.js +3 -3
- package/src/runtime/vdom/AsyncVDOMBuilder.js +9 -9
- package/src/runtime/vdom/VComponent.js +1 -1
- package/src/runtime/vdom/VDocumentFragment.js +2 -2
- package/src/runtime/vdom/VElement.js +11 -11
- package/src/runtime/vdom/VFragment.js +2 -2
- package/src/runtime/vdom/VText.js +1 -1
- package/src/runtime/vdom/helpers/attrs.js +1 -1
- package/src/runtime/vdom/helpers/v-element.js +1 -1
- package/src/runtime/vdom/hot-reload.js +2 -2
- package/src/runtime/vdom/index.js +2 -2
- package/src/runtime/vdom/morphdom/fragment.js +2 -2
- package/src/runtime/vdom/morphdom/helpers.js +2 -2
- package/src/runtime/vdom/morphdom/index.js +27 -27
- package/src/runtime/vdom/morphdom/specialElHandlers.js +1 -1
- package/src/runtime/vdom/vdom.js +4 -4
- package/src/taglib/index.js +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
var beginComponent = require("@internal/components-beginComponent");
|
|
2
|
+
var endComponent = require("@internal/components-endComponent");
|
|
3
|
+
var registry = require("@internal/components-registry");
|
|
4
|
+
var componentsUtil = require("@internal/components-util");
|
|
1
5
|
var getComponentsContext =
|
|
2
6
|
require("../ComponentsContext").___getComponentsContext;
|
|
3
|
-
var componentsUtil = require("@internal/components-util");
|
|
4
7
|
var componentLookup = componentsUtil.___componentLookup;
|
|
5
|
-
var registry = require("@internal/components-registry");
|
|
6
8
|
var modernRenderer = require("../renderer");
|
|
7
9
|
var resolveComponentKey = modernRenderer.___resolveComponentKey;
|
|
8
10
|
var trackAsyncComponents = modernRenderer.___trackAsyncComponents;
|
|
9
|
-
var beginComponent = require("@internal/components-beginComponent");
|
|
10
|
-
var endComponent = require("@internal/components-endComponent");
|
|
11
11
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
12
12
|
|
|
13
13
|
function createRendererFunc(templateRenderFunc, componentProps) {
|
|
@@ -29,7 +29,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
29
29
|
parentLegacyComponentDef,
|
|
30
30
|
parentLegacyComponentDef.___component,
|
|
31
31
|
parentLegacyComponentDef.___component.___rawState,
|
|
32
|
-
out.global
|
|
32
|
+
out.global,
|
|
33
33
|
);
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
@@ -74,7 +74,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
74
74
|
out,
|
|
75
75
|
typeName,
|
|
76
76
|
customEvents,
|
|
77
|
-
ownerComponentId
|
|
77
|
+
ownerComponentId,
|
|
78
78
|
);
|
|
79
79
|
if (isSplit || widgetState) {
|
|
80
80
|
component.input = null;
|
|
@@ -83,7 +83,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
83
83
|
if ("MARKO_DEBUG") {
|
|
84
84
|
complain(
|
|
85
85
|
"Possible performance impact: this widget does not contain state, but is marked as a stateful widget. This will result in additional hydration data serialized. In order for marko to identify this as a split widget, w-bind should use a widget.js with defineWidget rather than index.js with defineComponent.",
|
|
86
|
-
{ location: typeName, level: 1 }
|
|
86
|
+
{ location: typeName, level: 1 },
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
component.input = input.widgetProps;
|
|
@@ -135,7 +135,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
135
135
|
key,
|
|
136
136
|
ownerComponentDef,
|
|
137
137
|
isSplit,
|
|
138
|
-
isFakeComponent
|
|
138
|
+
isFakeComponent,
|
|
139
139
|
);
|
|
140
140
|
componentsContext.___legacyComponentDef = componentDef;
|
|
141
141
|
|
|
@@ -158,7 +158,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
158
158
|
out,
|
|
159
159
|
typeName,
|
|
160
160
|
customEvents,
|
|
161
|
-
ownerComponentId
|
|
161
|
+
ownerComponentId,
|
|
162
162
|
);
|
|
163
163
|
if (isSplit || widgetState) {
|
|
164
164
|
component.input = null;
|
|
@@ -167,7 +167,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
167
167
|
if ("MARKO_DEBUG") {
|
|
168
168
|
complain(
|
|
169
169
|
"Possible performance impact: this widget does not contain state, but is marked as a stateful widget. This will result in additional hydration data serialized. In order for marko to identify this as a split widget, w-bind should use a widget.js with defineWidget rather than index.js with defineComponent.",
|
|
170
|
-
{ location: typeName, level: 1 }
|
|
170
|
+
{ location: typeName, level: 1 },
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
173
|
component.input = input.widgetProps;
|
|
@@ -180,12 +180,12 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
180
180
|
ownerComponentDef,
|
|
181
181
|
isSplit,
|
|
182
182
|
false,
|
|
183
|
-
this
|
|
183
|
+
this,
|
|
184
184
|
);
|
|
185
185
|
} else {
|
|
186
186
|
vComponentNode.___component = component = registry.___createComponent(
|
|
187
187
|
typeName,
|
|
188
|
-
component.id
|
|
188
|
+
component.id,
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
191
|
this.___component = component;
|
|
@@ -206,7 +206,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
206
206
|
componentDef,
|
|
207
207
|
component,
|
|
208
208
|
component.___rawState,
|
|
209
|
-
out.global
|
|
209
|
+
out.global,
|
|
210
210
|
);
|
|
211
211
|
|
|
212
212
|
if (customEvents && componentDef.___component) {
|
|
@@ -216,7 +216,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
|
|
|
216
216
|
} else {
|
|
217
217
|
componentDef.___component.___setCustomEvents(
|
|
218
218
|
customEvents,
|
|
219
|
-
ownerComponentId
|
|
219
|
+
ownerComponentId,
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
var copyProps = require("raptor-util/copyProps");
|
|
2
|
+
var beginComponent = require("@internal/components-beginComponent");
|
|
3
|
+
var endComponent = require("@internal/components-endComponent");
|
|
4
|
+
var registry = require("@internal/components-registry");
|
|
1
5
|
var componentsUtil = require("@internal/components-util");
|
|
2
6
|
var componentLookup = componentsUtil.___componentLookup;
|
|
3
7
|
|
|
4
8
|
var ComponentsContext = require("./ComponentsContext");
|
|
5
9
|
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
6
|
-
var registry = require("@internal/components-registry");
|
|
7
|
-
var copyProps = require("raptor-util/copyProps");
|
|
8
10
|
var isServer = componentsUtil.___isServer === true;
|
|
9
|
-
var beginComponent = require("@internal/components-beginComponent");
|
|
10
|
-
var endComponent = require("@internal/components-endComponent");
|
|
11
11
|
|
|
12
12
|
var COMPONENT_BEGIN_ASYNC_ADDED_KEY = "$wa";
|
|
13
13
|
|
|
@@ -42,7 +42,7 @@ function handleBeginAsync(event) {
|
|
|
42
42
|
asyncOut.c(
|
|
43
43
|
parentOut.___assignedComponentDef,
|
|
44
44
|
parentOut.___assignedKey,
|
|
45
|
-
parentOut.___assignedCustomEvents
|
|
45
|
+
parentOut.___assignedCustomEvents,
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -56,7 +56,7 @@ function handleBeginDetachedAsync(event) {
|
|
|
56
56
|
function createRendererFunc(
|
|
57
57
|
templateRenderFunc,
|
|
58
58
|
componentProps,
|
|
59
|
-
renderingLogic
|
|
59
|
+
renderingLogic,
|
|
60
60
|
) {
|
|
61
61
|
var onInput = renderingLogic && renderingLogic.onInput;
|
|
62
62
|
var typeName = componentProps.t;
|
|
@@ -69,7 +69,7 @@ function createRendererFunc(
|
|
|
69
69
|
if ("MARKO_DEBUG") {
|
|
70
70
|
if (!componentProps.d) {
|
|
71
71
|
throw new Error(
|
|
72
|
-
"Component was compiled in a different NODE_ENV than the Marko runtime is using."
|
|
72
|
+
"Component was compiled in a different NODE_ENV than the Marko runtime is using.",
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
} else if (componentProps.d) {
|
|
@@ -130,7 +130,7 @@ function createRendererFunc(
|
|
|
130
130
|
out,
|
|
131
131
|
typeName,
|
|
132
132
|
customEvents,
|
|
133
|
-
ownerComponentId
|
|
133
|
+
ownerComponentId,
|
|
134
134
|
);
|
|
135
135
|
|
|
136
136
|
// This is the final input after running the lifecycle methods.
|
|
@@ -208,7 +208,7 @@ function createRendererFunc(
|
|
|
208
208
|
key,
|
|
209
209
|
ownerComponentDef,
|
|
210
210
|
isSplit,
|
|
211
|
-
isImplicitComponent
|
|
211
|
+
isImplicitComponent,
|
|
212
212
|
);
|
|
213
213
|
|
|
214
214
|
componentDef.___isExisting = isExisting;
|
|
@@ -221,7 +221,7 @@ function createRendererFunc(
|
|
|
221
221
|
componentDef,
|
|
222
222
|
component,
|
|
223
223
|
component.___rawState,
|
|
224
|
-
out.global
|
|
224
|
+
out.global,
|
|
225
225
|
);
|
|
226
226
|
|
|
227
227
|
endComponent(out, componentDef);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
|
-
var
|
|
4
|
+
var w10NOOP = require("warp10/constants").NOOP;
|
|
5
|
+
var ComponentDef = require("../components/ComponentDef");
|
|
5
6
|
var ComponentsContext = require("../components/ComponentsContext");
|
|
7
|
+
var changeCase = require("./_change-case");
|
|
6
8
|
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
7
|
-
var ComponentDef = require("../components/ComponentDef");
|
|
8
|
-
var w10NOOP = require("warp10/constants").NOOP;
|
|
9
9
|
var RENDER_BODY_TO_JSON = function () {
|
|
10
10
|
return w10NOOP;
|
|
11
11
|
};
|
|
@@ -26,7 +26,7 @@ module.exports = function dynamicTag(
|
|
|
26
26
|
props,
|
|
27
27
|
componentDef,
|
|
28
28
|
key,
|
|
29
|
-
customEvents
|
|
29
|
+
customEvents,
|
|
30
30
|
) {
|
|
31
31
|
if (tag) {
|
|
32
32
|
if (tag.default) {
|
|
@@ -42,7 +42,7 @@ module.exports = function dynamicTag(
|
|
|
42
42
|
attrs,
|
|
43
43
|
key,
|
|
44
44
|
componentDef,
|
|
45
|
-
addEvents(componentDef, customEvents, props)
|
|
45
|
+
addEvents(componentDef, customEvents, props),
|
|
46
46
|
);
|
|
47
47
|
renderBody(out);
|
|
48
48
|
out.___endElement();
|
|
@@ -52,7 +52,7 @@ module.exports = function dynamicTag(
|
|
|
52
52
|
attrs,
|
|
53
53
|
key,
|
|
54
54
|
componentDef,
|
|
55
|
-
addEvents(componentDef, customEvents, props)
|
|
55
|
+
addEvents(componentDef, customEvents, props),
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
} else {
|
|
@@ -73,7 +73,7 @@ module.exports = function dynamicTag(
|
|
|
73
73
|
if ("MARKO_DEBUG") {
|
|
74
74
|
if (tag.renderer && tag.renderer.renderer) {
|
|
75
75
|
complain(
|
|
76
|
-
"An object with a 'renderer' was passed to the dynamic tag, but renderer was another template."
|
|
76
|
+
"An object with a 'renderer' was passed to the dynamic tag, but renderer was another template.",
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -90,7 +90,7 @@ module.exports = function dynamicTag(
|
|
|
90
90
|
if ("MARKO_DEBUG") {
|
|
91
91
|
if (render.safeHTML || render.toHTML) {
|
|
92
92
|
throw new Error(
|
|
93
|
-
"Using `<include(x)/>` or the `<${dynamic}/>` tags with a `{ safeHTML: ... }` object is no longer supported. Use the unescaped text placeholder syntax instead."
|
|
93
|
+
"Using `<include(x)/>` or the `<${dynamic}/>` tags with a `{ safeHTML: ... }` object is no longer supported. Use the unescaped text placeholder syntax instead.",
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -107,7 +107,7 @@ module.exports = function dynamicTag(
|
|
|
107
107
|
componentsContext.___componentDef = new ComponentDef(
|
|
108
108
|
component,
|
|
109
109
|
parentComponentDef.id + "-" + parentComponentDef.___nextKey(key),
|
|
110
|
-
globalContext
|
|
110
|
+
globalContext,
|
|
111
111
|
);
|
|
112
112
|
render.toJSON = RENDER_BODY_TO_JSON;
|
|
113
113
|
|
|
@@ -131,7 +131,7 @@ module.exports = function dynamicTag(
|
|
|
131
131
|
component,
|
|
132
132
|
IS_SERVER &&
|
|
133
133
|
componentDef &&
|
|
134
|
-
componentDef.___flags & FLAG_WILL_RERENDER_IN_BROWSER
|
|
134
|
+
componentDef.___flags & FLAG_WILL_RERENDER_IN_BROWSER,
|
|
135
135
|
);
|
|
136
136
|
renderBody(out);
|
|
137
137
|
out.ef();
|
|
@@ -164,7 +164,7 @@ function addEvents(componentDef, customEvents, props) {
|
|
|
164
164
|
event[0],
|
|
165
165
|
event[1],
|
|
166
166
|
event[2],
|
|
167
|
-
event[3]
|
|
167
|
+
event[3],
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -9,12 +9,12 @@ module.exports = function renderTagHelper(
|
|
|
9
9
|
out,
|
|
10
10
|
componentDef,
|
|
11
11
|
key,
|
|
12
|
-
customEvents
|
|
12
|
+
customEvents,
|
|
13
13
|
) {
|
|
14
14
|
out.c(componentDef, key, customEvents);
|
|
15
15
|
(handler._ || (handler._ = handler.render || handler.renderer || handler))(
|
|
16
16
|
input,
|
|
17
|
-
out
|
|
17
|
+
out,
|
|
18
18
|
);
|
|
19
19
|
out.___assignedComponentDef = null;
|
|
20
20
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var EventEmitter = require("events-light");
|
|
3
|
-
var
|
|
4
|
-
var BufferedWriter = require("./BufferedWriter");
|
|
3
|
+
var selfClosingTags = require("self-closing-tags");
|
|
5
4
|
var RenderResult = require("../RenderResult");
|
|
5
|
+
var parseHTML = require("../vdom/parse-html");
|
|
6
|
+
var BufferedWriter = require("./BufferedWriter");
|
|
6
7
|
var attrsHelper = require("./helpers/attrs");
|
|
7
8
|
var markoAttr = require("./helpers/data-marko");
|
|
8
9
|
var escapeXmlHelper = require("./helpers/escape-xml");
|
|
9
|
-
var
|
|
10
|
+
var StringWriter = require("./StringWriter");
|
|
10
11
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
|
11
12
|
var escapeXmlString = escapeXmlHelper.___escapeXML;
|
|
12
|
-
var selfClosingTags = require("self-closing-tags");
|
|
13
13
|
|
|
14
14
|
function noop() {}
|
|
15
15
|
|
|
@@ -227,8 +227,8 @@ var proto = (AsyncStream.prototype = {
|
|
|
227
227
|
(name ? "(" + name + ") " : "") +
|
|
228
228
|
"timed out after " +
|
|
229
229
|
timeout +
|
|
230
|
-
"ms"
|
|
231
|
-
)
|
|
230
|
+
"ms",
|
|
231
|
+
),
|
|
232
232
|
);
|
|
233
233
|
}, timeout);
|
|
234
234
|
}
|
|
@@ -508,7 +508,7 @@ var proto = (AsyncStream.prototype = {
|
|
|
508
508
|
elementAttrs,
|
|
509
509
|
key,
|
|
510
510
|
componentDef,
|
|
511
|
-
props
|
|
511
|
+
props,
|
|
512
512
|
) {
|
|
513
513
|
var str =
|
|
514
514
|
"<" +
|
|
@@ -542,7 +542,7 @@ var proto = (AsyncStream.prototype = {
|
|
|
542
542
|
elementAttrs,
|
|
543
543
|
key,
|
|
544
544
|
componentDef,
|
|
545
|
-
props
|
|
545
|
+
props,
|
|
546
546
|
) {
|
|
547
547
|
var str =
|
|
548
548
|
"<" +
|
|
@@ -34,7 +34,7 @@ function notEmptyAttr(name, value) {
|
|
|
34
34
|
if ("MARKO_DEBUG") {
|
|
35
35
|
complain(
|
|
36
36
|
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead.",
|
|
37
|
-
{ locationIndex: 2 }
|
|
37
|
+
{ locationIndex: 2 },
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -15,7 +15,7 @@ module.exports = function attrs(arg) {
|
|
|
15
15
|
// eslint-disable-next-line no-constant-condition
|
|
16
16
|
if ("MARKO_DEBUG") {
|
|
17
17
|
complain(
|
|
18
|
-
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
|
|
18
|
+
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value",
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
return arg;
|
|
@@ -27,7 +27,7 @@ module.exports = function dataMarko(out, componentDef, props, key) {
|
|
|
27
27
|
result +=
|
|
28
28
|
' data-marko-key="' +
|
|
29
29
|
escapeDoubleQuotes(
|
|
30
|
-
componentDef.___nextKey(key) + " " + componentDef.id
|
|
30
|
+
componentDef.___nextKey(key) + " " + componentDef.id,
|
|
31
31
|
) +
|
|
32
32
|
'"';
|
|
33
33
|
}
|
|
@@ -17,7 +17,7 @@ module.exports = function mergeAttrs() {
|
|
|
17
17
|
// eslint-disable-next-line no-constant-condition
|
|
18
18
|
if ("MARKO_DEBUG") {
|
|
19
19
|
complain(
|
|
20
|
-
"Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead."
|
|
20
|
+
"Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead.",
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -35,7 +35,7 @@ module.exports = function mergeAttrs() {
|
|
|
35
35
|
// eslint-disable-next-line no-constant-condition
|
|
36
36
|
if ("MARKO_DEBUG") {
|
|
37
37
|
complain(
|
|
38
|
-
"Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead."
|
|
38
|
+
"Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead.",
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -3,10 +3,10 @@ module.exports =
|
|
|
3
3
|
typeof queueMicrotask === "function"
|
|
4
4
|
? queueMicrotask
|
|
5
5
|
: typeof Promise === "function" && (promise = Promise.resolve())
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
? function (cb) {
|
|
7
|
+
promise.then(cb).catch(rethrow);
|
|
8
|
+
}
|
|
9
|
+
: setTimeout;
|
|
10
10
|
function rethrow(err) {
|
|
11
11
|
setTimeout(function () {
|
|
12
12
|
throw err;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var defaultCreateOut = require("./createOut");
|
|
4
|
-
var setImmediate = require("@internal/set-immediate").___setImmediate;
|
|
5
3
|
var extend = require("raptor-util/extend");
|
|
4
|
+
var setImmediate = require("@internal/set-immediate").___setImmediate;
|
|
5
|
+
var defaultCreateOut = require("./createOut");
|
|
6
6
|
|
|
7
7
|
function safeRender(renderFunc, finalData, finalOut, shouldEnd) {
|
|
8
8
|
try {
|
|
@@ -123,7 +123,7 @@ module.exports = function (target, renderer) {
|
|
|
123
123
|
globalData, // global
|
|
124
124
|
out, // writer(AsyncStream) or parentNode(AsyncVDOMBuilder)
|
|
125
125
|
undefined, // parentOut
|
|
126
|
-
shouldBuffer // ignored by AsyncVDOMBuilder
|
|
126
|
+
shouldBuffer, // ignored by AsyncVDOMBuilder
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
var EventEmitter = require("events-light");
|
|
2
|
+
var RenderResult = require("../RenderResult");
|
|
3
|
+
var attrsHelper = require("./helpers/attrs");
|
|
4
|
+
var morphdom = require("./morphdom");
|
|
2
5
|
var vdom = require("./vdom");
|
|
3
6
|
var VElement = vdom.___VElement;
|
|
4
7
|
var VDocumentFragment = vdom.___VDocumentFragment;
|
|
@@ -6,9 +9,6 @@ var VText = vdom.___VText;
|
|
|
6
9
|
var VComponent = vdom.___VComponent;
|
|
7
10
|
var VFragment = vdom.___VFragment;
|
|
8
11
|
var virtualizeHTML = vdom.___virtualizeHTML;
|
|
9
|
-
var RenderResult = require("../RenderResult");
|
|
10
|
-
var morphdom = require("./morphdom");
|
|
11
|
-
var attrsHelper = require("./helpers/attrs");
|
|
12
12
|
|
|
13
13
|
var EVENT_UPDATE = "update";
|
|
14
14
|
var EVENT_FINISH = "finish";
|
|
@@ -82,7 +82,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
82
82
|
component,
|
|
83
83
|
childCount,
|
|
84
84
|
flags,
|
|
85
|
-
props
|
|
85
|
+
props,
|
|
86
86
|
);
|
|
87
87
|
return this.___beginNode(element, childCount);
|
|
88
88
|
},
|
|
@@ -95,7 +95,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
95
95
|
componentDef.___component,
|
|
96
96
|
0,
|
|
97
97
|
0,
|
|
98
|
-
props
|
|
98
|
+
props,
|
|
99
99
|
);
|
|
100
100
|
},
|
|
101
101
|
|
|
@@ -149,7 +149,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
149
149
|
component,
|
|
150
150
|
childCount,
|
|
151
151
|
flags,
|
|
152
|
-
props
|
|
152
|
+
props,
|
|
153
153
|
) {
|
|
154
154
|
var element = new VElement(
|
|
155
155
|
tagName,
|
|
@@ -158,7 +158,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
158
158
|
component,
|
|
159
159
|
childCount,
|
|
160
160
|
flags,
|
|
161
|
-
props
|
|
161
|
+
props,
|
|
162
162
|
);
|
|
163
163
|
this.___beginNode(element, childCount, true);
|
|
164
164
|
return this;
|
|
@@ -172,7 +172,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
172
172
|
componentDef.___component,
|
|
173
173
|
0,
|
|
174
174
|
0,
|
|
175
|
-
props
|
|
175
|
+
props,
|
|
176
176
|
);
|
|
177
177
|
},
|
|
178
178
|
|
|
@@ -269,7 +269,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
269
269
|
beginAsync: function (options) {
|
|
270
270
|
if (this.___sync) {
|
|
271
271
|
throw Error(
|
|
272
|
-
"Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942)."
|
|
272
|
+
"Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942).",
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var VNode = require("./VNode");
|
|
2
|
-
var inherit = require("raptor-util/inherit");
|
|
3
1
|
var extend = require("raptor-util/extend");
|
|
2
|
+
var inherit = require("raptor-util/inherit");
|
|
3
|
+
var VNode = require("./VNode");
|
|
4
4
|
|
|
5
5
|
function VDocumentFragmentClone(other) {
|
|
6
6
|
extend(this, other);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* jshint newcap:false */
|
|
2
2
|
|
|
3
3
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
|
-
var
|
|
4
|
+
var inherit = require("raptor-util/inherit");
|
|
5
5
|
var componentsUtil = require("@internal/components-util");
|
|
6
|
+
var domData = require("../components/dom-data");
|
|
6
7
|
var vElementByDOMNode = domData.___vElementByDOMNode;
|
|
7
8
|
var VNode = require("./VNode");
|
|
8
|
-
var inherit = require("raptor-util/inherit");
|
|
9
9
|
var ATTR_XLINK_HREF = "xlink:href";
|
|
10
10
|
var xmlnsRegExp = /^xmlns(:|$)/;
|
|
11
11
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -37,7 +37,7 @@ function convertAttrValue(type, value) {
|
|
|
37
37
|
// eslint-disable-next-line no-constant-condition
|
|
38
38
|
if ("MARKO_DEBUG") {
|
|
39
39
|
complain(
|
|
40
|
-
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead."
|
|
40
|
+
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead.",
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
return JSON.stringify(value);
|
|
@@ -94,7 +94,7 @@ function VElement(
|
|
|
94
94
|
ownerComponent,
|
|
95
95
|
childCount,
|
|
96
96
|
flags,
|
|
97
|
-
props
|
|
97
|
+
props,
|
|
98
98
|
) {
|
|
99
99
|
this.___VNode(childCount, ownerComponent);
|
|
100
100
|
|
|
@@ -138,8 +138,8 @@ VElement.prototype = {
|
|
|
138
138
|
ownerComponent,
|
|
139
139
|
childCount,
|
|
140
140
|
flags,
|
|
141
|
-
props
|
|
142
|
-
)
|
|
141
|
+
props,
|
|
142
|
+
),
|
|
143
143
|
);
|
|
144
144
|
|
|
145
145
|
if (childCount === 0) {
|
|
@@ -170,7 +170,7 @@ VElement.prototype = {
|
|
|
170
170
|
var flags = this.___flags;
|
|
171
171
|
var el = (host.ownerDocument || host).createElementNS(
|
|
172
172
|
namespaceURI,
|
|
173
|
-
tagName
|
|
173
|
+
tagName,
|
|
174
174
|
);
|
|
175
175
|
|
|
176
176
|
if (flags & FLAG_CUSTOM_ELEMENT) {
|
|
@@ -237,9 +237,9 @@ defineProperty(proto, "___value", {
|
|
|
237
237
|
return value != null && value !== false
|
|
238
238
|
? value + ""
|
|
239
239
|
: this.___attributes.type === "checkbox" ||
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
this.___attributes.type === "radio"
|
|
241
|
+
? "on"
|
|
242
|
+
: "";
|
|
243
243
|
},
|
|
244
244
|
});
|
|
245
245
|
|
|
@@ -288,7 +288,7 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
288
288
|
ownerComponent,
|
|
289
289
|
0 /*child count*/,
|
|
290
290
|
0 /*flags*/,
|
|
291
|
-
props
|
|
291
|
+
props,
|
|
292
292
|
);
|
|
293
293
|
|
|
294
294
|
if (vdomEl.___nodeName === "textarea") {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
var inherit = require("raptor-util/inherit");
|
|
1
2
|
var domData = require("../components/dom-data");
|
|
2
3
|
var keysByDOMNode = domData.___keyByDOMNode;
|
|
3
4
|
var vElementByDOMNode = domData.___vElementByDOMNode;
|
|
4
|
-
var VNode = require("./VNode");
|
|
5
|
-
var inherit = require("raptor-util/inherit");
|
|
6
5
|
var createFragmentNode = require("./morphdom/fragment").___createFragmentNode;
|
|
6
|
+
var VNode = require("./VNode");
|
|
7
7
|
|
|
8
8
|
function VFragment(key, ownerComponent, preserve) {
|
|
9
9
|
this.___VNode(null /* childCount */, ownerComponent);
|
|
@@ -13,7 +13,7 @@ module.exports = function (attributes) {
|
|
|
13
13
|
// eslint-disable-next-line no-constant-condition
|
|
14
14
|
if ("MARKO_DEBUG") {
|
|
15
15
|
complain(
|
|
16
|
-
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
|
|
16
|
+
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value",
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
return parseAttrs(attributes);
|