marko 4.25.0 → 4.26.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/bin/markoc.js +18 -18
- package/dist/compiler/CompileContext.js +3 -8
- package/dist/core-tags/components/init-components-tag.js +1 -52
- package/dist/core-tags/components/package.json +1 -3
- package/dist/core-tags/components/preferred-script-location-tag.js +2 -2
- package/dist/core-tags/components/preserve-tag.js +1 -27
- package/dist/core-tags/core/await/AsyncValue.js +20 -20
- package/dist/core-tags/core/await/renderer.js +11 -12
- package/dist/core-tags/core/await/reorderer-renderer.js +11 -6
- package/dist/index.js +1 -39
- package/dist/node-require/index.js +11 -0
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +12 -0
- package/dist/{runtime/components/beginComponent.js → node_modules/@internal/components-beginComponent/index.js} +14 -14
- package/dist/node_modules/@internal/components-beginComponent/package.json +11 -0
- package/dist/{runtime/components/legacy/defineWidget-legacy-browser.js → node_modules/@internal/components-define-widget-legacy/index-browser.js} +47 -47
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/dist/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/dist/node_modules/@internal/components-endComponent/index.js +11 -0
- package/dist/node_modules/@internal/components-endComponent/package.json +11 -0
- package/dist/node_modules/@internal/components-entry/index-browser.js +9 -0
- package/dist/node_modules/@internal/components-entry/index.js +285 -0
- package/dist/node_modules/@internal/components-entry/package.json +11 -0
- package/dist/{runtime/components/legacy → node_modules/@internal/components-entry-legacy}/index-browser.js +14 -15
- package/dist/node_modules/@internal/components-entry-legacy/index.js +14 -0
- package/dist/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/dist/{runtime/components/init-components-browser.js → node_modules/@internal/components-registry/index-browser.js} +180 -79
- package/dist/node_modules/@internal/components-registry/index.js +34 -0
- package/dist/node_modules/@internal/components-registry/package.json +11 -0
- package/dist/{runtime/components/util-browser.js → node_modules/@internal/components-util/index-browser.js} +23 -24
- package/dist/{runtime/components/util.js → node_modules/@internal/components-util/index.js} +10 -12
- package/dist/node_modules/@internal/components-util/package.json +11 -0
- package/dist/node_modules/@internal/create-readable/index-browser.js +25 -0
- package/dist/node_modules/@internal/create-readable/index.js +52 -0
- package/dist/node_modules/@internal/create-readable/package.json +11 -0
- package/dist/node_modules/@internal/init-components-tag/index.js +52 -0
- package/dist/node_modules/@internal/init-components-tag/package.json +11 -0
- package/dist/{loader/index-default.js → node_modules/@internal/loader/index.js} +1 -1
- package/dist/node_modules/@internal/loader/package.json +11 -0
- package/dist/{core-tags/components/preserve-tag-browser.js → node_modules/@internal/preserve-tag/index-browser.js} +8 -8
- package/dist/node_modules/@internal/preserve-tag/index.js +27 -0
- package/dist/node_modules/@internal/preserve-tag/package.json +11 -0
- package/dist/node_modules/@internal/set-immediate/index-browser.js +17 -0
- package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -0
- package/dist/node_modules/@internal/set-immediate/index.js +2 -0
- package/dist/node_modules/@internal/set-immediate/package.json +11 -0
- package/dist/runtime/RenderResult.js +24 -19
- package/dist/runtime/components/Component.js +154 -151
- package/dist/runtime/components/ComponentDef.js +28 -28
- package/dist/runtime/components/ComponentsContext.js +19 -19
- package/dist/runtime/components/GlobalComponentsContext.js +4 -4
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +13 -13
- package/dist/runtime/components/State.js +28 -28
- package/dist/runtime/components/attach-detach.js +9 -9
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +6 -6
- package/dist/runtime/components/event-delegation.js +15 -16
- package/dist/runtime/components/index.js +1 -285
- package/dist/runtime/components/legacy/browser.json +1 -1
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +18 -19
- package/dist/runtime/components/legacy/defineWidget-legacy.js +1 -18
- package/dist/runtime/components/legacy/dependencies/html.js +1 -1
- package/dist/runtime/components/legacy/dependencies/index.js +9 -9
- package/dist/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
- package/dist/runtime/components/legacy/index.js +1 -14
- package/dist/runtime/components/legacy/renderer-legacy.js +43 -43
- package/dist/runtime/components/registry.js +1 -34
- package/dist/runtime/components/renderer.js +38 -38
- package/dist/runtime/components/update-manager.js +10 -10
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +6 -6
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/assign.js +3 -2
- package/dist/runtime/helpers/dynamic-tag.js +14 -16
- package/dist/runtime/helpers/load-template.js +1 -1
- package/dist/runtime/helpers/merge.js +3 -1
- package/dist/runtime/helpers/style-value.js +2 -2
- package/dist/runtime/html/AsyncStream.js +61 -52
- package/dist/runtime/html/BufferedWriter.js +5 -1
- package/dist/runtime/html/StringWriter.js +7 -3
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -4
- package/dist/runtime/html/helpers/attrs.js +3 -3
- package/dist/runtime/html/helpers/data-marko.js +4 -6
- package/dist/runtime/html/helpers/escape-quotes.js +2 -2
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/props-script.js +1 -1
- package/dist/runtime/html/index.js +15 -12
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +102 -103
- package/dist/runtime/vdom/VComment.js +7 -7
- package/dist/runtime/vdom/VComponent.js +5 -5
- package/dist/runtime/vdom/VDocumentFragment.js +8 -8
- package/dist/runtime/vdom/VElement.js +55 -54
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +30 -30
- package/dist/runtime/vdom/VText.js +7 -7
- package/dist/runtime/vdom/helpers/v-element.js +1 -1
- package/dist/runtime/vdom/helpers/v-text.js +1 -1
- package/dist/runtime/vdom/index.js +12 -22
- package/dist/runtime/vdom/morphdom/fragment.js +5 -5
- package/dist/runtime/vdom/morphdom/helpers.js +3 -3
- package/dist/runtime/vdom/morphdom/index.js +72 -68
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +8 -8
- package/dist/runtime/vdom/preserve-attrs.js +1 -1
- package/dist/runtime/vdom/vdom.js +19 -21
- package/docs/body-content.md +2 -2
- package/docs/class-components.md +3 -3
- package/docs/express.md +1 -1
- package/docs/lasso.md +3 -6
- package/docs/marko-v4.md +5 -5
- package/docs/redux.md +1 -1
- package/docs/server-side-rendering.md +2 -2
- package/docs/why-is-marko-fast.md +2 -10
- package/package.json +1 -1
- package/src/browser-refresh.js +2 -2
- package/src/compiler/CodeWriter.js +1 -3
- package/src/compiler/CompileContext.js +3 -8
- package/src/compiler/Compiler.js +4 -4
- package/src/compiler/HtmlJsParser.js +1 -1
- package/src/compiler/Migrator.js +1 -1
- package/src/compiler/Parser.js +3 -3
- package/src/compiler/ast/CustomTag.js +9 -11
- package/src/compiler/ast/HtmlAttribute/html/generateCode.js +2 -2
- package/src/compiler/ast/HtmlAttribute/index.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/generateCode.js +1 -1
- package/src/compiler/ast/TemplateRoot.js +1 -1
- package/src/compiler/ast/Text/html/generateCode.js +3 -3
- package/src/compiler/ast/Text/vdom/generateCode.js +1 -1
- package/src/compiler/index.js +4 -4
- package/src/compiler/modules.js +4 -4
- package/src/compiler/util/finger-print.js +1 -1
- package/src/compiler/util/parseExpression.js +1 -1
- package/src/compiler/util/parseStatement.js +1 -1
- package/src/compiler/util/removeDashes.js +1 -1
- package/src/compiler/util/safeVarName.js +1 -1
- package/src/compiler/util/tokenizer.js +1 -1
- package/src/core-tags/cache/cached-fragment-tag-transformer.js +1 -1
- package/src/core-tags/cache/cached-fragment-tag.js +4 -4
- package/src/core-tags/cache/default-cache-manager.js +3 -3
- package/src/core-tags/components/TransformHelper/ComponentArgsCompiler.js +1 -1
- package/src/core-tags/components/TransformHelper/convertToComponent.js +1 -1
- package/src/core-tags/components/TransformHelper/handleComponentPreserveAttrs.js +1 -1
- package/src/core-tags/components/init-components-tag.js +1 -54
- package/src/core-tags/components/package.json +1 -3
- package/src/core-tags/components/preferred-script-location-tag.js +1 -1
- package/src/core-tags/components/preserve-tag.js +1 -27
- package/src/core-tags/components/util/getTransformHelper.js +1 -1
- package/src/core-tags/core/await/AsyncValue.js +3 -3
- package/src/core-tags/core/await/noop-render.js +1 -1
- package/src/core-tags/core/await/renderer.js +8 -7
- package/src/core-tags/core/await/reorderer-renderer.js +35 -14
- package/src/core-tags/core/await/transformer.js +1 -1
- package/src/core-tags/core/core-transformer.js +2 -2
- package/src/core-tags/migrate/all-tags/index.js +1 -1
- package/src/core-tags/migrate/all-templates/index.js +1 -1
- package/src/core-tags/migrate/include-tag.js +3 -2
- package/src/core-tags/migrate/util/parseFor.js +3 -2
- package/src/core-tags/migrate/util/printJS.js +1 -1
- package/src/defineRenderer.js +1 -1
- package/src/express.js +1 -1
- package/src/hot-reload.js +5 -5
- package/src/index.js +1 -41
- package/src/legacy-helpers/notEmpty.js +1 -1
- package/src/node-require/index.js +12 -1
- package/src/{runtime/components/beginComponent-browser.js → node_modules/@internal/components-beginComponent/index-browser.js} +1 -1
- package/src/{runtime/components/beginComponent.js → node_modules/@internal/components-beginComponent/index.js} +2 -2
- package/src/node_modules/@internal/components-beginComponent/package.json +11 -0
- package/src/{runtime/components/legacy/defineWidget-legacy-browser.js → node_modules/@internal/components-define-widget-legacy/index-browser.js} +21 -23
- package/src/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/src/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/src/{runtime/components/endComponent.js → node_modules/@internal/components-endComponent/index.js} +1 -1
- package/src/node_modules/@internal/components-endComponent/package.json +11 -0
- package/src/node_modules/@internal/components-entry/index-browser.js +9 -0
- package/src/node_modules/@internal/components-entry/index.js +301 -0
- package/src/node_modules/@internal/components-entry/package.json +11 -0
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
- package/src/node_modules/@internal/components-entry-legacy/index.js +15 -0
- package/src/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/src/{runtime/components/init-components-browser.js → node_modules/@internal/components-registry/index-browser.js} +240 -75
- package/src/node_modules/@internal/components-registry/index.js +44 -0
- package/src/node_modules/@internal/components-registry/package.json +11 -0
- package/src/{runtime/components/util-browser.js → node_modules/@internal/components-util/index-browser.js} +11 -10
- package/src/{runtime/components/util.js → node_modules/@internal/components-util/index.js} +0 -2
- package/src/node_modules/@internal/components-util/package.json +11 -0
- package/src/node_modules/@internal/create-readable/index-browser.js +30 -0
- package/src/node_modules/@internal/create-readable/index.js +57 -0
- package/src/node_modules/@internal/create-readable/package.json +11 -0
- package/src/node_modules/@internal/init-components-tag/index.js +54 -0
- package/src/node_modules/@internal/init-components-tag/package.json +11 -0
- package/src/{loader/index-default.js → node_modules/@internal/loader/index.js} +2 -2
- package/src/node_modules/@internal/loader/package.json +11 -0
- package/src/node_modules/@internal/preserve-tag/index.js +27 -0
- package/src/node_modules/@internal/preserve-tag/package.json +11 -0
- package/src/node_modules/@internal/set-immediate/index-browser.js +17 -0
- package/src/node_modules/@internal/set-immediate/index-worker.js +2 -0
- package/src/node_modules/@internal/set-immediate/index.js +2 -0
- package/src/node_modules/@internal/set-immediate/package.json +11 -0
- package/src/runtime/RenderResult.js +20 -18
- package/src/runtime/components/Component.js +44 -41
- package/src/runtime/components/ComponentDef.js +9 -9
- package/src/runtime/components/ComponentsContext.js +4 -5
- package/src/runtime/components/GlobalComponentsContext.js +2 -1
- package/src/runtime/components/KeySequence.js +1 -1
- package/src/runtime/components/State.js +6 -6
- package/src/runtime/components/attach-detach.js +4 -4
- package/src/runtime/components/defineComponent.js +1 -1
- package/src/runtime/components/event-delegation.js +10 -10
- package/src/runtime/components/index.js +1 -301
- package/src/runtime/components/jquery.js +2 -2
- package/src/runtime/components/legacy/browser.json +1 -1
- package/src/runtime/components/legacy/defineRenderer-legacy.js +5 -6
- package/src/runtime/components/legacy/defineWidget-legacy.js +1 -18
- package/src/runtime/components/legacy/dependencies/html.js +1 -1
- package/src/runtime/components/legacy/dependencies/index.js +3 -3
- package/src/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
- package/src/runtime/components/legacy/index.js +1 -15
- package/src/runtime/components/legacy/renderer-legacy.js +7 -7
- package/src/runtime/components/ready.js +2 -2
- package/src/runtime/components/registry.js +1 -44
- package/src/runtime/components/renderer.js +4 -4
- package/src/runtime/components/update-manager.js +1 -1
- package/src/runtime/dom-insert.js +8 -8
- package/src/runtime/helpers/_weak-map.js +2 -2
- package/src/runtime/helpers/assign.js +3 -1
- package/src/runtime/helpers/bind-component.js +2 -2
- package/src/runtime/helpers/dynamic-tag.js +2 -4
- package/src/runtime/helpers/for-in.js +1 -1
- package/src/runtime/helpers/load-nested-tag.js +1 -1
- package/src/runtime/helpers/load-template.js +1 -1
- package/src/runtime/helpers/merge.js +3 -1
- package/src/runtime/helpers/noop.js +1 -1
- package/src/runtime/helpers/style-value.js +1 -1
- package/src/runtime/helpers/to-string.js +1 -1
- package/src/runtime/html/AsyncStream.js +90 -76
- package/src/runtime/html/BufferedWriter.js +6 -2
- package/src/runtime/html/StringWriter.js +15 -9
- package/src/runtime/html/helpers/attrs.js +3 -3
- package/src/runtime/html/helpers/data-marko.js +0 -2
- package/src/runtime/html/helpers/escape-quotes.js +1 -1
- package/src/runtime/html/helpers/escape-xml.js +1 -1
- package/src/runtime/html/index.js +23 -13
- package/src/runtime/queueMicrotask.js +2 -2
- package/src/runtime/renderable.js +9 -9
- package/src/runtime/vdom/AsyncVDOMBuilder.js +46 -51
- package/src/runtime/vdom/VComment.js +3 -3
- package/src/runtime/vdom/VDocumentFragment.js +3 -3
- package/src/runtime/vdom/VElement.js +17 -13
- package/src/runtime/vdom/VFragment.js +1 -1
- package/src/runtime/vdom/VNode.js +2 -2
- package/src/runtime/vdom/VText.js +3 -3
- package/src/runtime/vdom/helpers/attrs.js +1 -1
- package/src/runtime/vdom/helpers/const.js +2 -2
- package/src/runtime/vdom/helpers/v-element.js +1 -1
- package/src/runtime/vdom/helpers/v-text.js +1 -1
- package/src/runtime/vdom/index.js +21 -23
- package/src/runtime/vdom/morphdom/fragment.js +8 -7
- package/src/runtime/vdom/morphdom/index.js +19 -9
- package/src/runtime/vdom/morphdom/specialElHandlers.js +6 -6
- package/src/runtime/vdom/parse-html.js +4 -4
- package/src/runtime/vdom/preserve-attrs.js +1 -1
- package/src/runtime/vdom/vdom.js +5 -7
- package/src/taglib/taglib-finder/index.js +1 -1
- package/src/taglib/taglib-loader/Tag.js +5 -5
- package/src/taglib/taglib-loader/Taglib.js +2 -2
- package/src/taglib/taglib-loader/json-file-reader.js +1 -1
- package/src/taglib/taglib-loader/loadAttributeFromProps.js +1 -1
- package/src/taglib/taglib-loader/loadTagFromProps.js +5 -6
- package/src/taglib/taglib-loader/tag-def-from-code.js +2 -1
- package/src/taglib/taglib-lookup/TaglibLookup.js +2 -2
- package/src/taglib/taglib-lookup/index.js +1 -1
- package/dist/core-tags/core/await/client-reorder-browser.js +0 -1
- package/dist/core-tags/core/await/client-reorder-runtime.min.js +0 -5
- package/dist/core-tags/core/await/client-reorder.js +0 -11
- package/dist/core-tags/core/await/package.json +0 -6
- package/dist/index-browser.js +0 -4
- package/dist/loader/index.js +0 -7
- package/dist/loader/package.json +0 -5
- package/dist/node-require/index-browser.js +0 -1
- package/dist/package.json +0 -5
- package/dist/runtime/components/beginComponent-browser.js +0 -12
- package/dist/runtime/components/endComponent.js +0 -11
- package/dist/runtime/components/index-browser.js +0 -14
- package/dist/runtime/components/init-components.js +0 -1
- package/dist/runtime/components/legacy/package.json +0 -6
- package/dist/runtime/components/package.json +0 -12
- package/dist/runtime/components/registry-browser.js +0 -73
- package/dist/runtime/html/Template.js +0 -63
- package/dist/runtime/package.json +0 -5
- package/dist/runtime/setImmediate.js +0 -19
- package/src/core-tags/core/await/client-reorder-browser.js +0 -1
- package/src/core-tags/core/await/client-reorder-runtime.min.js +0 -1
- package/src/core-tags/core/await/client-reorder.js +0 -14
- package/src/core-tags/core/await/package.json +0 -6
- package/src/index-browser.js +0 -3
- package/src/loader/index.js +0 -7
- package/src/loader/package.json +0 -5
- package/src/node-require/index-browser.js +0 -1
- package/src/package.json +0 -5
- package/src/runtime/components/index-browser.js +0 -15
- package/src/runtime/components/init-components.js +0 -1
- package/src/runtime/components/legacy/index-browser.js +0 -73
- package/src/runtime/components/legacy/package.json +0 -6
- package/src/runtime/components/package.json +0 -12
- package/src/runtime/components/registry-browser.js +0 -103
- package/src/runtime/html/Template.js +0 -62
- package/src/runtime/package.json +0 -5
- package/src/runtime/setImmediate.js +0 -21
- /package/dist/{runtime/components/endComponent-browser.js → node_modules/@internal/components-endComponent/index-browser.js} +0 -0
- /package/dist/{core-tags/components/init-components-tag-browser.js → node_modules/@internal/init-components-tag/index-browser.js} +0 -0
- /package/dist/{loader → node_modules/@internal/loader}/index-browser.js +0 -0
- /package/src/{runtime/components/endComponent-browser.js → node_modules/@internal/components-endComponent/index-browser.js} +0 -0
- /package/src/{core-tags/components/init-components-tag-browser.js → node_modules/@internal/init-components-tag/index-browser.js} +0 -0
- /package/src/{loader → node_modules/@internal/loader}/index-browser.js +0 -0
- /package/src/{core-tags/components/preserve-tag-browser.js → node_modules/@internal/preserve-tag/index-browser.js} +0 -0
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
var EventEmitter = require("events-light");
|
|
4
4
|
var StringWriter = require("./StringWriter");
|
|
5
5
|
var BufferedWriter = require("./BufferedWriter");
|
|
6
|
-
var defaultDocument = typeof document != "undefined" && document;
|
|
7
6
|
var RenderResult = require("../RenderResult");
|
|
8
7
|
var attrsHelper = require("./helpers/attrs");
|
|
9
8
|
var markoAttr = require("./helpers/data-marko");
|
|
10
9
|
var escapeXmlHelper = require("./helpers/escape-xml");
|
|
11
10
|
var parseHTML = require("../vdom/parse-html");
|
|
12
11
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
|
13
|
-
var escapeXmlString = escapeXmlHelper.
|
|
12
|
+
var escapeXmlString = escapeXmlHelper.bo_;
|
|
14
13
|
var selfClosingTags = require("self-closing-tags");
|
|
15
14
|
|
|
16
15
|
function noop() {}
|
|
@@ -38,7 +37,7 @@ function State(root, stream, writer, events) {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
function escapeEndingComment(text) {
|
|
41
|
-
return text.replace(
|
|
40
|
+
return text.replace(/(--!?)>/g, "$1>");
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
function AsyncStream(global, writer, parentOut) {
|
|
@@ -90,11 +89,12 @@ function AsyncStream(global, writer, parentOut) {
|
|
|
90
89
|
|
|
91
90
|
this._elStack = undefined; // Array
|
|
92
91
|
|
|
93
|
-
this.
|
|
92
|
+
this.t_ = null; // ComponentsContext
|
|
94
93
|
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
94
|
+
this.aa_ = null;
|
|
95
|
+
this.ab_ = null;
|
|
96
|
+
this.bc_ = null;
|
|
97
|
+
this.bp_ = false;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
AsyncStream.DEFAULT_TIMEOUT = 10000;
|
|
@@ -110,8 +110,8 @@ AsyncStream.enableAsyncStackTrace = function () {
|
|
|
110
110
|
|
|
111
111
|
var proto = AsyncStream.prototype = {
|
|
112
112
|
constructor: AsyncStream,
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
E_: typeof document === "object" && document,
|
|
114
|
+
bq_: true,
|
|
115
115
|
|
|
116
116
|
sync: function () {
|
|
117
117
|
this._sync = true;
|
|
@@ -135,7 +135,7 @@ var proto = AsyncStream.prototype = {
|
|
|
135
135
|
return this;
|
|
136
136
|
},
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
aj_: function () {
|
|
139
139
|
return this._state.writer.toString();
|
|
140
140
|
},
|
|
141
141
|
|
|
@@ -143,14 +143,14 @@ var proto = AsyncStream.prototype = {
|
|
|
143
143
|
* Legacy...
|
|
144
144
|
*/
|
|
145
145
|
getOutput: function () {
|
|
146
|
-
return this.
|
|
146
|
+
return this.aj_();
|
|
147
147
|
},
|
|
148
148
|
|
|
149
149
|
toString: function () {
|
|
150
150
|
return this._state.writer.toString();
|
|
151
151
|
},
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
br_: function () {
|
|
154
154
|
this._result = this._result || new RenderResult(this);
|
|
155
155
|
return this._result;
|
|
156
156
|
},
|
|
@@ -201,6 +201,7 @@ var proto = AsyncStream.prototype = {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
this._lastCount++;
|
|
204
|
+
newStream.bp_ = true;
|
|
204
205
|
}
|
|
205
206
|
|
|
206
207
|
name = options.name;
|
|
@@ -238,7 +239,7 @@ var proto = AsyncStream.prototype = {
|
|
|
238
239
|
if (state.writer.end) {
|
|
239
240
|
state.writer.end();
|
|
240
241
|
} else {
|
|
241
|
-
state.events.emit("finish", this.
|
|
242
|
+
state.events.emit("finish", this.br_());
|
|
242
243
|
}
|
|
243
244
|
},
|
|
244
245
|
|
|
@@ -290,7 +291,7 @@ var proto = AsyncStream.prototype = {
|
|
|
290
291
|
}
|
|
291
292
|
|
|
292
293
|
if (remaining === 0) {
|
|
293
|
-
parentOut._handleChildDone();
|
|
294
|
+
parentOut._handleChildDone(this);
|
|
294
295
|
} else if (remaining - this._lastCount === 0) {
|
|
295
296
|
this._emitLast();
|
|
296
297
|
}
|
|
@@ -299,7 +300,7 @@ var proto = AsyncStream.prototype = {
|
|
|
299
300
|
return this;
|
|
300
301
|
},
|
|
301
302
|
|
|
302
|
-
_handleChildDone: function () {
|
|
303
|
+
_handleChildDone: function (childOut) {
|
|
303
304
|
var remaining = --this._remaining;
|
|
304
305
|
|
|
305
306
|
if (remaining === 0) {
|
|
@@ -307,10 +308,16 @@ var proto = AsyncStream.prototype = {
|
|
|
307
308
|
if (parentOut === undefined) {
|
|
308
309
|
this._doFinish();
|
|
309
310
|
} else {
|
|
310
|
-
parentOut._handleChildDone();
|
|
311
|
+
parentOut._handleChildDone(this);
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
if (childOut.bp_) {
|
|
315
|
+
this._lastCount--;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (remaining - this._lastCount === 0) {
|
|
319
|
+
this._emitLast();
|
|
311
320
|
}
|
|
312
|
-
} else if (remaining - this._lastCount === 0) {
|
|
313
|
-
this._emitLast();
|
|
314
321
|
}
|
|
315
322
|
},
|
|
316
323
|
|
|
@@ -345,7 +352,7 @@ var proto = AsyncStream.prototype = {
|
|
|
345
352
|
var state = this._state;
|
|
346
353
|
|
|
347
354
|
if (event === "finish" && state.finished === true) {
|
|
348
|
-
callback(this.
|
|
355
|
+
callback(this.br_());
|
|
349
356
|
} else if (event === "last") {
|
|
350
357
|
this.onLast(callback);
|
|
351
358
|
} else {
|
|
@@ -359,7 +366,7 @@ var proto = AsyncStream.prototype = {
|
|
|
359
366
|
var state = this._state;
|
|
360
367
|
|
|
361
368
|
if (event === "finish" && state.finished === true) {
|
|
362
|
-
callback(this.
|
|
369
|
+
callback(this.br_());
|
|
363
370
|
} else if (event === "last") {
|
|
364
371
|
this.onLast(callback);
|
|
365
372
|
} else {
|
|
@@ -382,23 +389,22 @@ var proto = AsyncStream.prototype = {
|
|
|
382
389
|
},
|
|
383
390
|
|
|
384
391
|
_emitLast: function () {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
if (this._last) {
|
|
393
|
+
var i = 0;
|
|
394
|
+
var lastArray = this._last;
|
|
395
|
+
this._last = undefined;
|
|
396
|
+
(function next() {
|
|
397
|
+
if (i === lastArray.length) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
var lastCallback = lastArray[i++];
|
|
401
|
+
lastCallback(next);
|
|
395
402
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
403
|
+
if (lastCallback.length === 0) {
|
|
404
|
+
next();
|
|
405
|
+
}
|
|
406
|
+
})();
|
|
399
407
|
}
|
|
400
|
-
|
|
401
|
-
next();
|
|
402
408
|
},
|
|
403
409
|
|
|
404
410
|
emit: function (type, arg) {
|
|
@@ -482,11 +488,15 @@ var proto = AsyncStream.prototype = {
|
|
|
482
488
|
return newOut;
|
|
483
489
|
},
|
|
484
490
|
|
|
485
|
-
|
|
486
|
-
var str = "<" + tagName + markoAttr(this, componentDef, props, key) + attrsHelper(elementAttrs)
|
|
491
|
+
bn_: function (tagName, elementAttrs, key, componentDef, props) {
|
|
492
|
+
var str = "<" + tagName + markoAttr(this, componentDef, props, key) + attrsHelper(elementAttrs);
|
|
487
493
|
|
|
488
|
-
if (selfClosingTags.indexOf(tagName)
|
|
489
|
-
str += "
|
|
494
|
+
if (selfClosingTags.voidElements.indexOf(tagName) !== -1) {
|
|
495
|
+
str += ">";
|
|
496
|
+
} else if (selfClosingTags.svgElements.indexOf(tagName) !== -1) {
|
|
497
|
+
str += "/>";
|
|
498
|
+
} else {
|
|
499
|
+
str += "></" + tagName + ">";
|
|
490
500
|
}
|
|
491
501
|
|
|
492
502
|
this.write(str);
|
|
@@ -502,7 +512,7 @@ var proto = AsyncStream.prototype = {
|
|
|
502
512
|
this.write(str);
|
|
503
513
|
},
|
|
504
514
|
|
|
505
|
-
|
|
515
|
+
bl_: function (name, elementAttrs, key, componentDef, props) {
|
|
506
516
|
var str = "<" + name + markoAttr(this, componentDef, props, key) + attrsHelper(elementAttrs) + ">";
|
|
507
517
|
|
|
508
518
|
this.write(str);
|
|
@@ -557,17 +567,16 @@ var proto = AsyncStream.prototype = {
|
|
|
557
567
|
}
|
|
558
568
|
},
|
|
559
569
|
|
|
560
|
-
|
|
570
|
+
ai_: function (host) {
|
|
561
571
|
var node = this._node;
|
|
562
|
-
var nextEl;
|
|
563
|
-
var fragment;
|
|
564
|
-
var html = this.H_();
|
|
565
|
-
|
|
566
|
-
if (!doc) {
|
|
567
|
-
doc = this._c_;
|
|
568
|
-
}
|
|
569
572
|
|
|
570
573
|
if (!node) {
|
|
574
|
+
var nextEl;
|
|
575
|
+
var fragment;
|
|
576
|
+
var html = this.aj_();
|
|
577
|
+
if (!host) host = this.E_;
|
|
578
|
+
var doc = host.ownerDocument || host;
|
|
579
|
+
|
|
571
580
|
if (html) {
|
|
572
581
|
node = parseHTML(html);
|
|
573
582
|
|
|
@@ -607,15 +616,15 @@ var proto = AsyncStream.prototype = {
|
|
|
607
616
|
},
|
|
608
617
|
|
|
609
618
|
c: function (componentDef, key, customEvents) {
|
|
610
|
-
this.
|
|
611
|
-
this.
|
|
612
|
-
this.
|
|
619
|
+
this.aa_ = componentDef;
|
|
620
|
+
this.ab_ = key;
|
|
621
|
+
this.bc_ = customEvents;
|
|
613
622
|
}
|
|
614
623
|
};
|
|
615
624
|
|
|
616
625
|
// alias:
|
|
617
626
|
proto.w = proto.write;
|
|
618
|
-
proto.
|
|
627
|
+
proto.bm_ = proto.endElement;
|
|
619
628
|
|
|
620
629
|
module.exports = AsyncStream;
|
|
621
630
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
const immediate = require("@internal/set-immediate");
|
|
4
|
+
const setImmediate = immediate.af_;
|
|
5
|
+
const clearImmediate = immediate.ag_;
|
|
3
6
|
const StringWriter = require("./StringWriter");
|
|
4
7
|
|
|
5
8
|
/**
|
|
@@ -17,7 +20,7 @@ function BufferedWriter(wrappedStream) {
|
|
|
17
20
|
BufferedWriter.prototype = Object.assign({
|
|
18
21
|
scheduleFlush() {
|
|
19
22
|
if (!this._scheduled) {
|
|
20
|
-
this._scheduled = setImmediate(flush, this);
|
|
23
|
+
this._scheduled = setImmediate(flush.bind(0, this));
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
|
|
@@ -38,6 +41,7 @@ function flush(writer) {
|
|
|
38
41
|
writer._wrapped.flush();
|
|
39
42
|
}
|
|
40
43
|
}
|
|
44
|
+
|
|
41
45
|
clearImmediate(writer._scheduled);
|
|
42
46
|
writer._scheduled = null;
|
|
43
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var escapeDoubleQuotes = require("./helpers/escape-quotes").
|
|
3
|
+
var escapeDoubleQuotes = require("./helpers/escape-quotes").o_;
|
|
4
4
|
|
|
5
5
|
function StringWriter() {
|
|
6
6
|
this._content = "";
|
|
@@ -26,7 +26,11 @@ StringWriter.prototype = {
|
|
|
26
26
|
|
|
27
27
|
merge: function (otherWriter) {
|
|
28
28
|
this._content += otherWriter._content;
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
if (otherWriter._scripts) {
|
|
31
|
+
this._scripts = this._scripts ? this._scripts + ";" + otherWriter._scripts : otherWriter._scripts;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
if (otherWriter._data) {
|
|
31
35
|
if (this._data) {
|
|
32
36
|
for (const key in otherWriter._data) {
|
|
@@ -49,7 +53,7 @@ StringWriter.prototype = {
|
|
|
49
53
|
},
|
|
50
54
|
|
|
51
55
|
toString: function () {
|
|
52
|
-
this.state.events.emit("
|
|
56
|
+
this.state.events.emit("p_", this);
|
|
53
57
|
let str = this._content;
|
|
54
58
|
if (this._scripts) {
|
|
55
59
|
const outGlobal = this.state.root.global;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var attrHelper = require("./attr");
|
|
4
|
-
var notEmptyAttr = attrHelper.
|
|
5
|
-
var isEmptyAttrValue = attrHelper.
|
|
4
|
+
var notEmptyAttr = attrHelper.bs_;
|
|
5
|
+
var isEmptyAttrValue = attrHelper.bt_;
|
|
6
6
|
var classHelper = require("./class-attr");
|
|
7
7
|
var styleHelper = require("./style-attr");
|
|
8
8
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
|
4
|
-
var escapeDoubleQuotes = escapeQuoteHelpers.
|
|
5
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
|
4
|
+
var escapeDoubleQuotes = escapeQuoteHelpers.o_;
|
|
5
|
+
var escapeSingleQuotes = escapeQuoteHelpers.bu_;
|
|
6
6
|
var complain;
|
|
7
7
|
|
|
8
8
|
module.exports = maybeEmptyAttr;
|
|
9
9
|
|
|
10
|
-
maybeEmptyAttr.
|
|
11
|
-
maybeEmptyAttr.
|
|
10
|
+
maybeEmptyAttr.bs_ = notEmptyAttr;
|
|
11
|
+
maybeEmptyAttr.bt_ = isEmpty;
|
|
12
12
|
|
|
13
13
|
function maybeEmptyAttr(name, value) {
|
|
14
14
|
if (isEmpty(value)) {
|
|
@@ -6,11 +6,11 @@ var dynamicAttrHelper = require("./_dynamic-attr");
|
|
|
6
6
|
module.exports = function attrs(arg) {
|
|
7
7
|
switch (typeof arg) {
|
|
8
8
|
case "object":
|
|
9
|
-
var
|
|
9
|
+
var result = "";
|
|
10
10
|
for (var attrName in arg) {
|
|
11
|
-
|
|
11
|
+
result += dynamicAttrHelper(attrName, arg[attrName]);
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return result;
|
|
14
14
|
case "string":
|
|
15
15
|
return arg;
|
|
16
16
|
// eslint-disable-next-line no-constant-condition
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
|
4
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
|
5
|
-
var escapeDoubleQuotes = escapeQuoteHelpers.
|
|
4
|
+
var escapeSingleQuotes = escapeQuoteHelpers.bu_;
|
|
5
|
+
var escapeDoubleQuotes = escapeQuoteHelpers.o_;
|
|
6
6
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
7
7
|
// var FLAG_HAS_RENDER_BODY = 2;
|
|
8
|
-
// var FLAG_IS_LEGACY = 4;
|
|
9
|
-
// var FLAG_OLD_HYDRATE_NO_CREATE = 8;
|
|
10
8
|
|
|
11
9
|
module.exports = function dataMarko(out, componentDef, props, key) {
|
|
12
10
|
var result = "";
|
|
13
|
-
var willNotRerender = out.
|
|
11
|
+
var willNotRerender = out.t_.y_ || componentDef.w_ && (componentDef.x_ & FLAG_WILL_RERENDER_IN_BROWSER) === 0;
|
|
14
12
|
|
|
15
13
|
if (willNotRerender) {
|
|
16
14
|
if (props) {
|
|
@@ -22,7 +20,7 @@ module.exports = function dataMarko(out, componentDef, props, key) {
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
if (key && key[0] === "@") {
|
|
25
|
-
result += ' data-marko-key="' + escapeDoubleQuotes(componentDef.
|
|
23
|
+
result += ' data-marko-key="' + escapeDoubleQuotes(componentDef.aN_(key) + " " + componentDef.id) + '"';
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -4,9 +4,9 @@ exports.d = function (value) {
|
|
|
4
4
|
return escapeDoubleQuotes(value + "", 0);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
exports.
|
|
7
|
+
exports.o_ = escapeDoubleQuotes;
|
|
8
8
|
|
|
9
|
-
exports.
|
|
9
|
+
exports.bu_ = escapeSingleQuotes;
|
|
10
10
|
|
|
11
11
|
function escapeSingleQuotes(value, startPos) {
|
|
12
12
|
return escapeQuote(value, startPos, "'", "'");
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
globalThis.Marko = {
|
|
4
|
+
Component: function () {}
|
|
5
|
+
};
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Method is for internal usage only. This method
|
|
@@ -8,26 +10,27 @@ var Template;
|
|
|
8
10
|
* it is used to create a new Template instance.
|
|
9
11
|
* @private
|
|
10
12
|
*/
|
|
11
|
-
exports.t = function createTemplate(
|
|
12
|
-
return new Template(
|
|
13
|
+
exports.t = function createTemplate(typeName) {
|
|
14
|
+
return new Template(typeName);
|
|
13
15
|
};
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
function Template(typeName) {
|
|
18
|
+
this.path = this.bv_ = typeName;
|
|
19
|
+
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
Template = require("./Template");
|
|
21
|
+
Template.prototype.stream = require("@internal/create-readable");
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
return new AsyncStream(globalData, parent, state, buffer);
|
|
22
|
-
}
|
|
23
|
+
var AsyncStream = require("./AsyncStream");
|
|
23
24
|
|
|
24
25
|
exports.createWriter = function (writer) {
|
|
25
26
|
return new AsyncStream(null, writer);
|
|
26
27
|
};
|
|
27
|
-
|
|
28
28
|
exports.Template = Template;
|
|
29
|
-
exports.bo_ = createOut;
|
|
30
29
|
exports.AsyncStream = AsyncStream;
|
|
31
30
|
exports.enableAsyncStackTrace = AsyncStream.enableAsyncStackTrace;
|
|
32
31
|
|
|
33
|
-
require("../createOut").
|
|
32
|
+
require("../createOut").bf_(Template.prototype.createOut = function createOut(globalData, writer, parentOut, buffer) {
|
|
33
|
+
return new AsyncStream(globalData, writer, parentOut, buffer);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
require("../renderable")(Template.prototype);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defaultCreateOut = require("./createOut");
|
|
2
|
-
var setImmediate = require("
|
|
2
|
+
var setImmediate = require("@internal/set-immediate").af_;
|
|
3
3
|
var extend = require("raptor-util/extend");
|
|
4
4
|
|
|
5
5
|
function safeRender(renderFunc, finalData, finalOut, shouldEnd) {
|
|
@@ -67,7 +67,7 @@ module.exports = function (target, renderer) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
render(localData, out);
|
|
70
|
-
return out.
|
|
70
|
+
return out.br_();
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -93,7 +93,7 @@ module.exports = function (target, renderer) {
|
|
|
93
93
|
var finalData;
|
|
94
94
|
var globalData;
|
|
95
95
|
var render = renderFunc || this._;
|
|
96
|
-
var shouldBuffer = this.
|
|
96
|
+
var shouldBuffer = this._W_;
|
|
97
97
|
var shouldEnd = true;
|
|
98
98
|
|
|
99
99
|
if (data) {
|
|
@@ -105,7 +105,7 @@ module.exports = function (target, renderer) {
|
|
|
105
105
|
finalData = {};
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
if (out && out.
|
|
108
|
+
if (out && out.bq_) {
|
|
109
109
|
finalOut = out;
|
|
110
110
|
shouldEnd = false;
|
|
111
111
|
extend(out.global, globalData);
|
|
@@ -122,7 +122,7 @@ module.exports = function (target, renderer) {
|
|
|
122
122
|
|
|
123
123
|
if (callback) {
|
|
124
124
|
finalOut.on("finish", function () {
|
|
125
|
-
callback(null, finalOut.
|
|
125
|
+
callback(null, finalOut.br_(), finalOut);
|
|
126
126
|
}).once("error", callback);
|
|
127
127
|
}
|
|
128
128
|
|