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
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
var EventEmitter = require("events-light");
|
|
2
2
|
var vdom = require("./vdom");
|
|
3
|
-
var VElement = vdom.
|
|
4
|
-
var VDocumentFragment = vdom.
|
|
5
|
-
var VComment = vdom.
|
|
6
|
-
var VText = vdom.
|
|
7
|
-
var VComponent = vdom.
|
|
8
|
-
var VFragment = vdom.
|
|
9
|
-
var virtualizeHTML = vdom.
|
|
3
|
+
var VElement = vdom.bw_;
|
|
4
|
+
var VDocumentFragment = vdom.bx_;
|
|
5
|
+
var VComment = vdom.by_;
|
|
6
|
+
var VText = vdom.bz_;
|
|
7
|
+
var VComponent = vdom.bA_;
|
|
8
|
+
var VFragment = vdom.bB_;
|
|
9
|
+
var virtualizeHTML = vdom.bC_;
|
|
10
10
|
var RenderResult = require("../RenderResult");
|
|
11
|
-
var defaultDocument = vdom.bw_;
|
|
12
11
|
var morphdom = require("./morphdom");
|
|
13
12
|
var attrsHelper = require("./helpers/attrs");
|
|
14
13
|
|
|
@@ -16,9 +15,9 @@ var EVENT_UPDATE = "update";
|
|
|
16
15
|
var EVENT_FINISH = "finish";
|
|
17
16
|
|
|
18
17
|
function State(tree) {
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
18
|
+
this.bD_ = new EventEmitter();
|
|
19
|
+
this.bE_ = tree;
|
|
20
|
+
this.bF_ = false;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
|
@@ -29,60 +28,60 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
|
|
29
28
|
var state;
|
|
30
29
|
|
|
31
30
|
if (parentOut) {
|
|
32
|
-
state = parentOut.
|
|
31
|
+
state = parentOut.C_;
|
|
33
32
|
} else {
|
|
34
33
|
state = new State(parentNode);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
36
|
+
this.bG_ = 1;
|
|
37
|
+
this.bH_ = 0;
|
|
38
|
+
this.bI_ = null;
|
|
39
|
+
this.bJ_ = parentOut;
|
|
41
40
|
|
|
42
41
|
this.data = {};
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
42
|
+
this.C_ = state;
|
|
43
|
+
this.ac_ = parentNode;
|
|
45
44
|
this.global = globalData || {};
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
45
|
+
this.bK_ = [parentNode];
|
|
46
|
+
this.bL_ = false;
|
|
47
|
+
this.bM_ = undefined;
|
|
48
|
+
this.t_ = null;
|
|
49
|
+
|
|
50
|
+
this.aa_ = null;
|
|
51
|
+
this.ab_ = null;
|
|
52
|
+
this.bc_ = null;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
var proto = AsyncVDOMBuilder.prototype = {
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
bq_: true,
|
|
57
|
+
E_: typeof document === "object" && document,
|
|
59
58
|
|
|
60
59
|
bc: function (component, key, ownerComponent) {
|
|
61
60
|
var vComponent = new VComponent(component, key, ownerComponent);
|
|
62
|
-
return this.
|
|
61
|
+
return this.bN_(vComponent, 0, true);
|
|
63
62
|
},
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
bd_: function (component, key, ownerComponent) {
|
|
66
65
|
var vComponent = new VComponent(component, key, ownerComponent, true);
|
|
67
|
-
this.
|
|
66
|
+
this.bN_(vComponent, 0);
|
|
68
67
|
},
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
this.
|
|
69
|
+
bN_: function (child, childCount, pushToStack) {
|
|
70
|
+
this.ac_.bO_(child);
|
|
72
71
|
if (pushToStack === true) {
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
72
|
+
this.bK_.push(child);
|
|
73
|
+
this.ac_ = child;
|
|
75
74
|
}
|
|
76
75
|
return childCount === 0 ? this : child;
|
|
77
76
|
},
|
|
78
77
|
|
|
79
78
|
element: function (tagName, attrs, key, component, childCount, flags, props) {
|
|
80
79
|
var element = new VElement(tagName, attrs, key, component, childCount, flags, props);
|
|
81
|
-
return this.
|
|
80
|
+
return this.bN_(element, childCount);
|
|
82
81
|
},
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
return this.element(tagName, attrsHelper(attrs), key, componentDef.
|
|
83
|
+
bn_: function (tagName, attrs, key, componentDef, props) {
|
|
84
|
+
return this.element(tagName, attrsHelper(attrs), key, componentDef.v_, 0, 0, props);
|
|
86
85
|
},
|
|
87
86
|
|
|
88
87
|
n: function (node, component) {
|
|
@@ -90,13 +89,13 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
90
89
|
// and a node can only have one parent node.
|
|
91
90
|
var clone = node.__();
|
|
92
91
|
this.node(clone);
|
|
93
|
-
clone.
|
|
92
|
+
clone._N_ = component;
|
|
94
93
|
|
|
95
94
|
return this;
|
|
96
95
|
},
|
|
97
96
|
|
|
98
97
|
node: function (node) {
|
|
99
|
-
this.
|
|
98
|
+
this.ac_.bO_(node);
|
|
100
99
|
return this;
|
|
101
100
|
},
|
|
102
101
|
|
|
@@ -115,7 +114,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
115
114
|
text = text.toString();
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
this.
|
|
117
|
+
this.ac_.bO_(new VText(text, ownerComponent));
|
|
119
118
|
return this;
|
|
120
119
|
},
|
|
121
120
|
|
|
@@ -125,7 +124,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
125
124
|
|
|
126
125
|
html: function (html, ownerComponent) {
|
|
127
126
|
if (html != null) {
|
|
128
|
-
var vdomNode = virtualizeHTML(html,
|
|
127
|
+
var vdomNode = virtualizeHTML(html, ownerComponent);
|
|
129
128
|
this.node(vdomNode);
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -134,17 +133,17 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
134
133
|
|
|
135
134
|
beginElement: function (tagName, attrs, key, component, childCount, flags, props) {
|
|
136
135
|
var element = new VElement(tagName, attrs, key, component, childCount, flags, props);
|
|
137
|
-
this.
|
|
136
|
+
this.bN_(element, childCount, true);
|
|
138
137
|
return this;
|
|
139
138
|
},
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
return this.beginElement(tagName, attrsHelper(attrs), key, componentDef.
|
|
140
|
+
bl_: function (tagName, attrs, key, componentDef, props) {
|
|
141
|
+
return this.beginElement(tagName, attrsHelper(attrs), key, componentDef.v_, 0, 0, props);
|
|
143
142
|
},
|
|
144
143
|
|
|
145
144
|
bf: function (key, component, preserve) {
|
|
146
145
|
var fragment = new VFragment(key, component, preserve);
|
|
147
|
-
this.
|
|
146
|
+
this.bN_(fragment, null, true);
|
|
148
147
|
return this;
|
|
149
148
|
},
|
|
150
149
|
|
|
@@ -153,52 +152,52 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
153
152
|
},
|
|
154
153
|
|
|
155
154
|
endElement: function () {
|
|
156
|
-
var stack = this.
|
|
155
|
+
var stack = this.bK_;
|
|
157
156
|
stack.pop();
|
|
158
|
-
this.
|
|
157
|
+
this.ac_ = stack[stack.length - 1];
|
|
159
158
|
},
|
|
160
159
|
|
|
161
160
|
end: function () {
|
|
162
|
-
this.
|
|
161
|
+
this.ac_ = undefined;
|
|
163
162
|
|
|
164
|
-
var remaining = --this.
|
|
165
|
-
var parentOut = this.
|
|
163
|
+
var remaining = --this.bG_;
|
|
164
|
+
var parentOut = this.bJ_;
|
|
166
165
|
|
|
167
166
|
if (remaining === 0) {
|
|
168
167
|
if (parentOut) {
|
|
169
|
-
parentOut.
|
|
168
|
+
parentOut.bP_();
|
|
170
169
|
} else {
|
|
171
|
-
this.
|
|
170
|
+
this.bQ_();
|
|
172
171
|
}
|
|
173
|
-
} else if (remaining - this.
|
|
174
|
-
this.
|
|
172
|
+
} else if (remaining - this.bH_ === 0) {
|
|
173
|
+
this.bR_();
|
|
175
174
|
}
|
|
176
175
|
|
|
177
176
|
return this;
|
|
178
177
|
},
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
var remaining = --this.
|
|
179
|
+
bP_: function () {
|
|
180
|
+
var remaining = --this.bG_;
|
|
182
181
|
|
|
183
182
|
if (remaining === 0) {
|
|
184
|
-
var parentOut = this.
|
|
183
|
+
var parentOut = this.bJ_;
|
|
185
184
|
if (parentOut) {
|
|
186
|
-
parentOut.
|
|
185
|
+
parentOut.bP_();
|
|
187
186
|
} else {
|
|
188
|
-
this.
|
|
187
|
+
this.bQ_();
|
|
189
188
|
}
|
|
190
|
-
} else if (remaining - this.
|
|
191
|
-
this.
|
|
189
|
+
} else if (remaining - this.bH_ === 0) {
|
|
190
|
+
this.bR_();
|
|
192
191
|
}
|
|
193
192
|
},
|
|
194
193
|
|
|
195
|
-
|
|
196
|
-
var state = this.
|
|
197
|
-
state.
|
|
198
|
-
state.
|
|
194
|
+
bQ_: function () {
|
|
195
|
+
var state = this.C_;
|
|
196
|
+
state.bF_ = true;
|
|
197
|
+
state.bD_.emit(EVENT_FINISH, this.br_());
|
|
199
198
|
},
|
|
200
199
|
|
|
201
|
-
|
|
200
|
+
bR_: function () {
|
|
202
201
|
var lastArray = this._last;
|
|
203
202
|
|
|
204
203
|
var i = 0;
|
|
@@ -233,24 +232,24 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
233
232
|
},
|
|
234
233
|
|
|
235
234
|
beginAsync: function (options) {
|
|
236
|
-
if (this.
|
|
235
|
+
if (this.bL_) {
|
|
237
236
|
throw Error("Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942).");
|
|
238
237
|
}
|
|
239
238
|
|
|
240
|
-
var state = this.
|
|
239
|
+
var state = this.C_;
|
|
241
240
|
|
|
242
241
|
if (options) {
|
|
243
242
|
if (options.last) {
|
|
244
|
-
this.
|
|
243
|
+
this.bH_++;
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
246
|
|
|
248
|
-
this.
|
|
247
|
+
this.bG_++;
|
|
249
248
|
|
|
250
|
-
var documentFragment = this.
|
|
249
|
+
var documentFragment = this.ac_.bS_();
|
|
251
250
|
var asyncOut = new AsyncVDOMBuilder(this.global, documentFragment, this);
|
|
252
251
|
|
|
253
|
-
state.
|
|
252
|
+
state.bD_.emit("beginAsync", {
|
|
254
253
|
out: asyncOut,
|
|
255
254
|
parentOut: this
|
|
256
255
|
});
|
|
@@ -263,51 +262,51 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
263
262
|
},
|
|
264
263
|
|
|
265
264
|
flush: function () {
|
|
266
|
-
var events = this.
|
|
265
|
+
var events = this.C_.bD_;
|
|
267
266
|
|
|
268
267
|
if (events.listenerCount(EVENT_UPDATE)) {
|
|
269
268
|
events.emit(EVENT_UPDATE, new RenderResult(this));
|
|
270
269
|
}
|
|
271
270
|
},
|
|
272
271
|
|
|
273
|
-
|
|
274
|
-
return this.
|
|
272
|
+
aj_: function () {
|
|
273
|
+
return this.C_.bE_;
|
|
275
274
|
},
|
|
276
275
|
|
|
277
|
-
|
|
278
|
-
return this.
|
|
276
|
+
br_: function () {
|
|
277
|
+
return this.bT_ || (this.bT_ = new RenderResult(this));
|
|
279
278
|
},
|
|
280
279
|
|
|
281
280
|
on: function (event, callback) {
|
|
282
|
-
var state = this.
|
|
281
|
+
var state = this.C_;
|
|
283
282
|
|
|
284
|
-
if (event === EVENT_FINISH && state.
|
|
285
|
-
callback(this.
|
|
283
|
+
if (event === EVENT_FINISH && state.bF_) {
|
|
284
|
+
callback(this.br_());
|
|
286
285
|
} else if (event === "last") {
|
|
287
286
|
this.onLast(callback);
|
|
288
287
|
} else {
|
|
289
|
-
state.
|
|
288
|
+
state.bD_.on(event, callback);
|
|
290
289
|
}
|
|
291
290
|
|
|
292
291
|
return this;
|
|
293
292
|
},
|
|
294
293
|
|
|
295
294
|
once: function (event, callback) {
|
|
296
|
-
var state = this.
|
|
295
|
+
var state = this.C_;
|
|
297
296
|
|
|
298
|
-
if (event === EVENT_FINISH && state.
|
|
299
|
-
callback(this.
|
|
297
|
+
if (event === EVENT_FINISH && state.bF_) {
|
|
298
|
+
callback(this.br_());
|
|
300
299
|
} else if (event === "last") {
|
|
301
300
|
this.onLast(callback);
|
|
302
301
|
} else {
|
|
303
|
-
state.
|
|
302
|
+
state.bD_.once(event, callback);
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
return this;
|
|
307
306
|
},
|
|
308
307
|
|
|
309
308
|
emit: function (type, arg) {
|
|
310
|
-
var events = this.
|
|
309
|
+
var events = this.C_.bD_;
|
|
311
310
|
switch (arguments.length) {
|
|
312
311
|
case 1:
|
|
313
312
|
events.emit(type);
|
|
@@ -323,17 +322,17 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
323
322
|
},
|
|
324
323
|
|
|
325
324
|
removeListener: function () {
|
|
326
|
-
var events = this.
|
|
325
|
+
var events = this.C_.bD_;
|
|
327
326
|
events.removeListener.apply(events, arguments);
|
|
328
327
|
return this;
|
|
329
328
|
},
|
|
330
329
|
|
|
331
330
|
sync: function () {
|
|
332
|
-
this.
|
|
331
|
+
this.bL_ = true;
|
|
333
332
|
},
|
|
334
333
|
|
|
335
334
|
isSync: function () {
|
|
336
|
-
return this.
|
|
335
|
+
return this.bL_;
|
|
337
336
|
},
|
|
338
337
|
|
|
339
338
|
onLast: function (callback) {
|
|
@@ -348,20 +347,20 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
348
347
|
return this;
|
|
349
348
|
},
|
|
350
349
|
|
|
351
|
-
|
|
352
|
-
var node = this.
|
|
350
|
+
ai_: function (host) {
|
|
351
|
+
var node = this.bM_;
|
|
353
352
|
if (!node) {
|
|
354
|
-
var vdomTree = this.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
this.
|
|
358
|
-
morphdom(node, vdomTree,
|
|
353
|
+
var vdomTree = this.aj_();
|
|
354
|
+
|
|
355
|
+
if (!host) host = this.E_;
|
|
356
|
+
this.bM_ = node = vdomTree.bU_(host, null);
|
|
357
|
+
morphdom(node, vdomTree, host, this.t_);
|
|
359
358
|
}
|
|
360
359
|
return node;
|
|
361
360
|
},
|
|
362
361
|
|
|
363
|
-
toString: function (
|
|
364
|
-
var docFragment = this.
|
|
362
|
+
toString: function (host) {
|
|
363
|
+
var docFragment = this.ai_(host);
|
|
365
364
|
var html = "";
|
|
366
365
|
|
|
367
366
|
var child = docFragment.firstChild;
|
|
@@ -399,15 +398,15 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
399
398
|
isVDOM: true,
|
|
400
399
|
|
|
401
400
|
c: function (componentDef, key, customEvents) {
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
404
|
-
this.
|
|
401
|
+
this.aa_ = componentDef;
|
|
402
|
+
this.ab_ = key;
|
|
403
|
+
this.bc_ = customEvents;
|
|
405
404
|
}
|
|
406
405
|
};
|
|
407
406
|
|
|
408
407
|
proto.e = proto.element;
|
|
409
408
|
proto.be = proto.beginElement;
|
|
410
|
-
proto.ee = proto.
|
|
409
|
+
proto.ee = proto.bm_ = proto.endElement;
|
|
411
410
|
proto.t = proto.text;
|
|
412
411
|
proto.h = proto.w = proto.write = proto.html;
|
|
413
412
|
|
|
@@ -2,20 +2,20 @@ var VNode = require("./VNode");
|
|
|
2
2
|
var inherit = require("raptor-util/inherit");
|
|
3
3
|
|
|
4
4
|
function VComment(value, ownerComponent) {
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
5
|
+
this.bV_(-1 /* no children */, ownerComponent);
|
|
6
|
+
this.bW_ = value;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
VComment.prototype = {
|
|
10
|
-
|
|
10
|
+
bX_: 8,
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
var nodeValue = this.
|
|
14
|
-
return
|
|
12
|
+
bU_: function (host) {
|
|
13
|
+
var nodeValue = this.bW_;
|
|
14
|
+
return (host.ownerDocument || host).createComment(nodeValue);
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
__: function () {
|
|
18
|
-
return new VComment(this.
|
|
18
|
+
return new VComment(this.bW_);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -2,14 +2,14 @@ var VNode = require("./VNode");
|
|
|
2
2
|
var inherit = require("raptor-util/inherit");
|
|
3
3
|
|
|
4
4
|
function VComponent(component, key, ownerComponent, preserve) {
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
5
|
+
this.bV_(null /* childCount */, ownerComponent);
|
|
6
|
+
this.bY_ = key;
|
|
7
|
+
this.v_ = component;
|
|
8
|
+
this.ae_ = preserve;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
VComponent.prototype = {
|
|
12
|
-
|
|
12
|
+
bX_: 2
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
inherit(VComponent, VNode);
|
|
@@ -4,26 +4,26 @@ var extend = require("raptor-util/extend");
|
|
|
4
4
|
|
|
5
5
|
function VDocumentFragmentClone(other) {
|
|
6
6
|
extend(this, other);
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
7
|
+
this.bZ_ = null;
|
|
8
|
+
this.c__ = null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function VDocumentFragment(out) {
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
12
|
+
this.bV_(null /* childCount */);
|
|
13
|
+
this.u_ = out;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
VDocumentFragment.prototype = {
|
|
17
|
-
|
|
17
|
+
bX_: 11,
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
ca_: true,
|
|
20
20
|
|
|
21
21
|
__: function () {
|
|
22
22
|
return new VDocumentFragmentClone(this);
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
return
|
|
25
|
+
bU_: function (host) {
|
|
26
|
+
return (host.ownerDocument || host).createDocumentFragment();
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|