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 +1 @@
|
|
|
1
|
-
module.exports = function() {};
|
|
1
|
+
module.exports = function () {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
3
|
-
var isClientReorderSupported = require("./client-reorder").isSupported;
|
|
4
3
|
var AsyncValue = require("./AsyncValue");
|
|
5
4
|
|
|
6
5
|
function safeRenderBody(renderBody, targetOut, data) {
|
|
@@ -23,7 +22,7 @@ function requestData(provider, timeout) {
|
|
|
23
22
|
);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
var callback = function(err, data) {
|
|
25
|
+
var callback = function (err, data) {
|
|
27
26
|
if (err) {
|
|
28
27
|
asyncValue.___reject(err);
|
|
29
28
|
} else {
|
|
@@ -60,7 +59,7 @@ function requestData(provider, timeout) {
|
|
|
60
59
|
error = new Error(errorMsg);
|
|
61
60
|
}
|
|
62
61
|
if (timeout > 0) {
|
|
63
|
-
let timeoutId = setTimeout(function() {
|
|
62
|
+
let timeoutId = setTimeout(function () {
|
|
64
63
|
timeoutId = null;
|
|
65
64
|
if (!error) error = new Error(errorMsg);
|
|
66
65
|
error.code = "ERR_AWAIT_TIMEDOUT";
|
|
@@ -68,7 +67,7 @@ function requestData(provider, timeout) {
|
|
|
68
67
|
asyncValue.___reject(error);
|
|
69
68
|
}, timeout);
|
|
70
69
|
|
|
71
|
-
asyncValue.___done(function() {
|
|
70
|
+
asyncValue.___done(function () {
|
|
72
71
|
if (timeoutId != null) {
|
|
73
72
|
clearTimeout(timeoutId);
|
|
74
73
|
}
|
|
@@ -82,7 +81,9 @@ const LAST_OPTIONS = { last: true, name: "await:finish" };
|
|
|
82
81
|
|
|
83
82
|
module.exports = function awaitTag(input, out) {
|
|
84
83
|
var clientReorder =
|
|
85
|
-
|
|
84
|
+
typeof document === "undefined" &&
|
|
85
|
+
input.clientReorder === true &&
|
|
86
|
+
!out.isVDOM;
|
|
86
87
|
|
|
87
88
|
var name = input.name || input._name;
|
|
88
89
|
var timeout = input.timeout;
|
|
@@ -139,7 +140,7 @@ module.exports = function awaitTag(input, out) {
|
|
|
139
140
|
// - await:beforeRender
|
|
140
141
|
// - await:finish
|
|
141
142
|
//
|
|
142
|
-
asyncOut.emit = function(event) {
|
|
143
|
+
asyncOut.emit = function (event) {
|
|
143
144
|
if (event !== "finish" && event !== "error") {
|
|
144
145
|
// We don't want to proxy the finish and error events since those are
|
|
145
146
|
// very specific to the AsyncWriter associated with the await instance
|
|
@@ -192,7 +193,7 @@ module.exports = function awaitTag(input, out) {
|
|
|
192
193
|
// this event until after the code to move
|
|
193
194
|
// the async fragment into place has been written
|
|
194
195
|
let asyncLastOut = asyncOut.beginAsync(LAST_OPTIONS);
|
|
195
|
-
asyncOut.onLast(function() {
|
|
196
|
+
asyncOut.onLast(function () {
|
|
196
197
|
var oldWriter = asyncOut.writer;
|
|
197
198
|
// We swap out the writer so that writing will happen to our `asyncLastOut`
|
|
198
199
|
// even though we are still passing along the original `asyncOut`. We have
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var escapeDoubleQuotes =
|
|
4
|
+
require("../../../runtime/html/helpers/escape-quotes").___escapeDoubleQuotes;
|
|
4
5
|
|
|
5
|
-
module.exports = function(input, out) {
|
|
6
|
+
module.exports = function (input, out) {
|
|
6
7
|
// We cannot call beginSync() when using renderSync(). In this case we will
|
|
7
8
|
// ignore the await-reorderer tag.
|
|
8
9
|
if (out.isSync()) {
|
|
@@ -29,7 +30,7 @@ module.exports = function(input, out) {
|
|
|
29
30
|
name: "await-reorderer"
|
|
30
31
|
});
|
|
31
32
|
|
|
32
|
-
out.onLast(function(next) {
|
|
33
|
+
out.onLast(function (next) {
|
|
33
34
|
var awaitContext = global.___clientReorderContext;
|
|
34
35
|
var remaining;
|
|
35
36
|
|
|
@@ -47,19 +48,39 @@ module.exports = function(input, out) {
|
|
|
47
48
|
function handleAwait(awaitInfo) {
|
|
48
49
|
awaitInfo.out
|
|
49
50
|
.on("___toString", out.emit.bind(out, "___toString"))
|
|
50
|
-
.on("finish", function(result) {
|
|
51
|
+
.on("finish", function (result) {
|
|
51
52
|
if (!global._afRuntime) {
|
|
52
|
-
|
|
53
|
+
// Minified version of ./client-reorder-runtime.js
|
|
54
|
+
asyncOut.script(
|
|
55
|
+
`function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}}`
|
|
56
|
+
);
|
|
53
57
|
global._afRuntime = true;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if (global.cspNonce) {
|
|
61
|
+
asyncOut.write(
|
|
62
|
+
'<style nonce="' +
|
|
63
|
+
escapeDoubleQuotes(global.cspNonce) +
|
|
64
|
+
'">' +
|
|
65
|
+
"#af" +
|
|
66
|
+
awaitInfo.id +
|
|
67
|
+
"{display:none;}" +
|
|
68
|
+
"</style>" +
|
|
69
|
+
'<div id="af' +
|
|
70
|
+
awaitInfo.id +
|
|
71
|
+
'">' +
|
|
72
|
+
result.toString() +
|
|
73
|
+
"</div>"
|
|
74
|
+
);
|
|
75
|
+
} else {
|
|
76
|
+
asyncOut.write(
|
|
77
|
+
'<div id="af' +
|
|
78
|
+
awaitInfo.id +
|
|
79
|
+
'" style="display:none">' +
|
|
80
|
+
result.toString() +
|
|
81
|
+
"</div>"
|
|
82
|
+
);
|
|
83
|
+
}
|
|
63
84
|
|
|
64
85
|
asyncOut.script(
|
|
65
86
|
"$af(" +
|
|
@@ -81,14 +102,14 @@ module.exports = function(input, out) {
|
|
|
81
102
|
next();
|
|
82
103
|
}
|
|
83
104
|
})
|
|
84
|
-
.on("error", function(err) {
|
|
105
|
+
.on("error", function (err) {
|
|
85
106
|
asyncOut.error(err);
|
|
86
107
|
});
|
|
87
108
|
}
|
|
88
109
|
|
|
89
110
|
awaitContext.instances.forEach(handleAwait);
|
|
90
111
|
|
|
91
|
-
out.on("await:clientReorder", function(awaitInfo) {
|
|
112
|
+
out.on("await:clientReorder", function (awaitInfo) {
|
|
92
113
|
remaining++;
|
|
93
114
|
handleAwait(awaitInfo);
|
|
94
115
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var coreAttrHandlers = [
|
|
4
4
|
[
|
|
5
5
|
"marko-preserve-whitespace",
|
|
6
|
-
function(attr, node, el) {
|
|
6
|
+
function (attr, node, el) {
|
|
7
7
|
el.setPreserveWhitespace(true);
|
|
8
8
|
}
|
|
9
9
|
]
|
|
@@ -24,7 +24,7 @@ class AttributeTransformer {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
coreAttrHandlers.forEach(function(attrHandler) {
|
|
27
|
+
coreAttrHandlers.forEach(function (attrHandler) {
|
|
28
28
|
var name = attrHandler[0];
|
|
29
29
|
var func = attrHandler[1];
|
|
30
30
|
AttributeTransformer.prototype[name] = func;
|
|
@@ -41,8 +41,9 @@ module.exports = function migrator(elNode, context) {
|
|
|
41
41
|
let finalTarget = target;
|
|
42
42
|
|
|
43
43
|
if (!isMemberOrIdentifer) {
|
|
44
|
-
const complexIncludeIdentifierCount =
|
|
45
|
-
(context._complexIncludeIdentifierCount
|
|
44
|
+
const complexIncludeIdentifierCount =
|
|
45
|
+
(context._complexIncludeIdentifierCount =
|
|
46
|
+
(context._complexIncludeIdentifierCount || 0) + 1);
|
|
46
47
|
let identifierName = "includeTarget";
|
|
47
48
|
|
|
48
49
|
if (complexIncludeIdentifierCount !== 1) {
|
|
@@ -64,7 +64,8 @@ var tokenizer = require("../../../compiler/util/tokenizer").create([
|
|
|
64
64
|
}
|
|
65
65
|
]);
|
|
66
66
|
|
|
67
|
-
var inRegExp =
|
|
67
|
+
var inRegExp =
|
|
68
|
+
/^\s*([$A-Z_][0-9A-Z_$]*)(?:\s*,\s*([$A-Z_][0-9A-Z_$]*))?\s+in\s+/i;
|
|
68
69
|
|
|
69
70
|
function throwError(message) {
|
|
70
71
|
var error = new Error(message);
|
|
@@ -119,7 +120,7 @@ function createNumberExpression(str, errorMessage) {
|
|
|
119
120
|
* <varName> from <expression> to <expression> step <expression>
|
|
120
121
|
* <init>; <test>; <update>
|
|
121
122
|
*/
|
|
122
|
-
module.exports = function(str) {
|
|
123
|
+
module.exports = function (str) {
|
|
123
124
|
str = removeComments(str);
|
|
124
125
|
|
|
125
126
|
let depth = 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const CodeWriter = require("../../../compiler/CodeWriter");
|
|
2
2
|
const CodeGenerator = require("../../../compiler/CodeGenerator");
|
|
3
3
|
|
|
4
|
-
module.exports = function(node, context, options) {
|
|
4
|
+
module.exports = function (node, context, options) {
|
|
5
5
|
const codeGenerator = new CodeGenerator(context);
|
|
6
6
|
node = codeGenerator.generateCode(node);
|
|
7
7
|
const writer = new CodeWriter(
|
package/src/defineRenderer.js
CHANGED
package/src/express.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = function markoAppMiddleware() {
|
|
|
30
30
|
function patchResponse(response) {
|
|
31
31
|
response.marko =
|
|
32
32
|
response.marko ||
|
|
33
|
-
function(template, data) {
|
|
33
|
+
function (template, data) {
|
|
34
34
|
if (typeof template === "string") {
|
|
35
35
|
throw new Error(
|
|
36
36
|
"res.marko does not take a template name or path like res.render. " +
|
package/src/hot-reload.js
CHANGED
|
@@ -23,7 +23,7 @@ function cleaResolvePathCache() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var keys = Object.keys(modulePathCache);
|
|
26
|
-
keys.forEach(function(key) {
|
|
26
|
+
keys.forEach(function (key) {
|
|
27
27
|
delete modulePathCache[key];
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -42,7 +42,7 @@ function tryReloadTemplate(path) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
exports.enable = function(options) {
|
|
45
|
+
exports.enable = function (options) {
|
|
46
46
|
if (runtime.__hotReloadEnabled) {
|
|
47
47
|
// Marko has already been monkey-patched. Nothing to do!
|
|
48
48
|
return;
|
|
@@ -108,11 +108,11 @@ exports.enable = function(options) {
|
|
|
108
108
|
var actualRenderFunc;
|
|
109
109
|
|
|
110
110
|
Object.defineProperty(originalTemplate, "_", {
|
|
111
|
-
get: function() {
|
|
111
|
+
get: function () {
|
|
112
112
|
return actualRenderFunc;
|
|
113
113
|
},
|
|
114
114
|
|
|
115
|
-
set: function(renderFunc) {
|
|
115
|
+
set: function (renderFunc) {
|
|
116
116
|
actualRenderFunc = createHotReloadProxy(
|
|
117
117
|
renderFunc,
|
|
118
118
|
originalTemplate,
|
|
@@ -144,7 +144,7 @@ function normalizeExtension(extension) {
|
|
|
144
144
|
return extension;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
exports.handleFileModified = function(path, options) {
|
|
147
|
+
exports.handleFileModified = function (path, options) {
|
|
148
148
|
if (!fs.existsSync(path)) {
|
|
149
149
|
console.log(
|
|
150
150
|
"[marko/hot-reload] WARNING cannot resolve template path: ",
|
package/src/index.js
CHANGED
|
@@ -1,44 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
// the following development and legacy apis should not be included
|
|
4
|
-
// when bundling the server with a tool like webpack
|
|
5
|
-
if (!process.env.BUNDLE) {
|
|
6
|
-
if (process.env.MARKO_HOT_RELOAD) {
|
|
7
|
-
require("./hot-reload").enable();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// If process was launched with browser refresh then automatically
|
|
11
|
-
// enable browser-refresh
|
|
12
|
-
require("./browser-refresh").enable();
|
|
13
|
-
|
|
14
|
-
// Adds the template.getDependencies() method needed by older versions of lasso-marko
|
|
15
|
-
require("./runtime/components/legacy/dependencies/html");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function fixFlush() {
|
|
19
|
-
try {
|
|
20
|
-
var OutgoingMessage = require("http").OutgoingMessage;
|
|
21
|
-
if (
|
|
22
|
-
OutgoingMessage.prototype.flush &&
|
|
23
|
-
OutgoingMessage.prototype.flush.toString().indexOf("deprecated") !== -1
|
|
24
|
-
) {
|
|
25
|
-
// Yes, we are monkey-patching http. This method should never have been added and it was introduced on
|
|
26
|
-
// the iojs fork. It was quickly deprecated and I'm 99% sure no one is actually using it.
|
|
27
|
-
// See:
|
|
28
|
-
// - https://github.com/marko-js/async-writer/issues/3
|
|
29
|
-
// - https://github.com/nodejs/node/issues/2920
|
|
30
|
-
//
|
|
31
|
-
// This method causes problems since marko looks for the flush method and calls it found.
|
|
32
|
-
// The `res.flush()` method is introduced by the [compression](https://www.npmjs.com/package/compression)
|
|
33
|
-
// middleware, but, otherwise, it should typically not exist.
|
|
34
|
-
delete require("http").OutgoingMessage.prototype.flush;
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {
|
|
37
|
-
/* ignore error */
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
fixFlush();
|
|
42
|
-
|
|
43
3
|
exports.createOut = require("./runtime/createOut");
|
|
44
|
-
exports.load = require("
|
|
4
|
+
exports.load = require("@internal/loader");
|
|
@@ -7,6 +7,17 @@ const fs = require("fs");
|
|
|
7
7
|
const fsReadOptions = { encoding: "utf8" };
|
|
8
8
|
const MARKO_EXTENSIONS = Symbol("MARKO_EXTENSIONS");
|
|
9
9
|
|
|
10
|
+
if (process.env.MARKO_HOT_RELOAD) {
|
|
11
|
+
require("../hot-reload").enable();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// If process was launched with browser refresh then automatically
|
|
15
|
+
// enable browser-refresh
|
|
16
|
+
require("../browser-refresh").enable();
|
|
17
|
+
|
|
18
|
+
// Adds the template.getDependencies() method needed by older versions of lasso-marko
|
|
19
|
+
require("../runtime/components/legacy/dependencies/html");
|
|
20
|
+
|
|
10
21
|
function normalizeExtension(extension) {
|
|
11
22
|
if (extension.charAt(0) !== ".") {
|
|
12
23
|
extension = "." + extension;
|
|
@@ -140,6 +151,6 @@ install();
|
|
|
140
151
|
|
|
141
152
|
exports.install = install;
|
|
142
153
|
|
|
143
|
-
exports.getExtensions = function() {
|
|
154
|
+
exports.getExtensions = function () {
|
|
144
155
|
return require.extensions[MARKO_EXTENSIONS];
|
|
145
156
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const ComponentDef = require("
|
|
3
|
+
const ComponentDef = require("../../../runtime/components/ComponentDef");
|
|
4
4
|
|
|
5
5
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
6
6
|
// var FLAG_HAS_RENDER_BODY = 2;
|
|
7
|
-
// var FLAG_IS_LEGACY = 4;
|
|
8
7
|
var FLAG_OLD_HYDRATE_NO_CREATE = 8;
|
|
9
8
|
|
|
10
9
|
module.exports = function beginComponent(
|
|
@@ -36,6 +35,7 @@ module.exports = function beginComponent(
|
|
|
36
35
|
// On the server
|
|
37
36
|
if (!componentsContext.___isPreserved && ownerWillRerender) {
|
|
38
37
|
componentDef.___flags |= FLAG_WILL_RERENDER_IN_BROWSER;
|
|
38
|
+
componentDef._wrr = true;
|
|
39
39
|
return componentDef;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var BaseState;
|
|
5
5
|
var BaseComponent;
|
|
6
6
|
var inherit;
|
|
7
|
-
var jQuery = require("
|
|
8
|
-
var ready = require("
|
|
7
|
+
var jQuery = require("../../../runtime/components/jquery");
|
|
8
|
+
var ready = require("../../../runtime/components/ready");
|
|
9
9
|
|
|
10
10
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
11
11
|
var stateToJSONDef = {
|
|
@@ -23,7 +23,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
23
23
|
return def;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
var ComponentClass = function() {};
|
|
26
|
+
var ComponentClass = function () {};
|
|
27
27
|
var proto;
|
|
28
28
|
var legacyInit;
|
|
29
29
|
|
|
@@ -67,7 +67,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
67
67
|
proto.constructor = def.constructor = Component;
|
|
68
68
|
|
|
69
69
|
Object.defineProperty(proto, "state", {
|
|
70
|
-
get: function() {
|
|
70
|
+
get: function () {
|
|
71
71
|
var raw = this.___state && this.___state.___raw;
|
|
72
72
|
|
|
73
73
|
if (raw && !raw.toJSON) {
|
|
@@ -76,14 +76,12 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
76
76
|
|
|
77
77
|
return raw;
|
|
78
78
|
},
|
|
79
|
-
set: function(newState) {
|
|
79
|
+
set: function (newState) {
|
|
80
80
|
newState = newState || {};
|
|
81
81
|
// eslint-disable-next-line no-constant-condition
|
|
82
82
|
if ("MARKO_DEBUG") {
|
|
83
83
|
if (
|
|
84
|
-
Object.keys(newState)
|
|
85
|
-
.sort()
|
|
86
|
-
.join("") !==
|
|
84
|
+
Object.keys(newState).sort().join("") !==
|
|
87
85
|
Object.keys((this.___state && this.___state.___raw) || {})
|
|
88
86
|
.sort()
|
|
89
87
|
.join("")
|
|
@@ -98,17 +96,17 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
98
96
|
});
|
|
99
97
|
|
|
100
98
|
Object.defineProperty(proto, "__document", {
|
|
101
|
-
get: function() {
|
|
99
|
+
get: function () {
|
|
102
100
|
// eslint-disable-next-line no-constant-condition
|
|
103
101
|
if ("MARKO_DEBUG") {
|
|
104
102
|
complain("__document is deprecated");
|
|
105
103
|
}
|
|
106
|
-
return this.
|
|
104
|
+
return this.___host;
|
|
107
105
|
}
|
|
108
106
|
});
|
|
109
107
|
|
|
110
108
|
Object.defineProperty(proto, "el", {
|
|
111
|
-
get: function() {
|
|
109
|
+
get: function () {
|
|
112
110
|
// eslint-disable-next-line no-constant-condition
|
|
113
111
|
if ("MARKO_DEBUG") {
|
|
114
112
|
if (
|
|
@@ -130,27 +128,27 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
130
128
|
proto.___legacyOnRender = proto.onRender;
|
|
131
129
|
Object.defineProperty(proto, "onRender", {
|
|
132
130
|
get: noop,
|
|
133
|
-
set: function(v) {
|
|
131
|
+
set: function (v) {
|
|
134
132
|
proto.___legacyOnRender = v;
|
|
135
133
|
}
|
|
136
134
|
});
|
|
137
135
|
|
|
138
136
|
proto.___legacyOnUpdate = proto.onUpdate;
|
|
139
137
|
Object.defineProperty(proto, "onUpdate", {
|
|
140
|
-
get: function() {
|
|
138
|
+
get: function () {
|
|
141
139
|
return modernMountOrUpdate;
|
|
142
140
|
},
|
|
143
|
-
set: function(v) {
|
|
141
|
+
set: function (v) {
|
|
144
142
|
proto.___legacyOnUpdate = v;
|
|
145
143
|
}
|
|
146
144
|
});
|
|
147
145
|
|
|
148
146
|
proto.___legacyOnDestroy = proto.onDestroy;
|
|
149
147
|
Object.defineProperty(proto, "onDestroy", {
|
|
150
|
-
get: function() {
|
|
148
|
+
get: function () {
|
|
151
149
|
return modernOnDestory;
|
|
152
150
|
},
|
|
153
|
-
set: function(v) {
|
|
151
|
+
set: function (v) {
|
|
154
152
|
proto.___legacyOnDestroy = v;
|
|
155
153
|
}
|
|
156
154
|
});
|
|
@@ -165,7 +163,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
165
163
|
|
|
166
164
|
// convert legacy to modern
|
|
167
165
|
proto.___modernUpdate = proto.update;
|
|
168
|
-
proto.update = function() {
|
|
166
|
+
proto.update = function () {
|
|
169
167
|
if (this.___destroyed) {
|
|
170
168
|
// eslint-disable-next-line no-constant-condition
|
|
171
169
|
if ("MARKO_DEBUG") {
|
|
@@ -213,7 +211,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
213
211
|
if ("MARKO_DEBUG") {
|
|
214
212
|
Object.defineProperty(el, "__widget", {
|
|
215
213
|
configurable: true,
|
|
216
|
-
get: function() {
|
|
214
|
+
get: function () {
|
|
217
215
|
complain("__widget is deprecated");
|
|
218
216
|
return self;
|
|
219
217
|
}
|
|
@@ -279,14 +277,14 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
279
277
|
var createOut = renderer.createOut;
|
|
280
278
|
if (typeof renderer !== "function") {
|
|
281
279
|
var rendererObject = renderer;
|
|
282
|
-
renderer = function(input, out) {
|
|
280
|
+
renderer = function (input, out) {
|
|
283
281
|
var rendererFunc = rendererObject.renderer || rendererObject.render;
|
|
284
282
|
rendererFunc(input, out);
|
|
285
283
|
};
|
|
286
284
|
renderer.createOut = createOut;
|
|
287
285
|
}
|
|
288
286
|
|
|
289
|
-
renderer.render = function(input) {
|
|
287
|
+
renderer.render = function (input) {
|
|
290
288
|
var out = createOut();
|
|
291
289
|
renderer(input, out);
|
|
292
290
|
return out.end();
|
|
@@ -305,7 +303,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
305
303
|
// eslint-disable-next-line no-constant-condition
|
|
306
304
|
if ("MARKO_DEBUG") {
|
|
307
305
|
Object.defineProperty(Component, "_isWidget", {
|
|
308
|
-
get: function() {
|
|
306
|
+
get: function () {
|
|
309
307
|
complain("_isWidget is deprecated");
|
|
310
308
|
return true;
|
|
311
309
|
}
|
|
@@ -317,6 +315,6 @@ module.exports = function defineWidget(def, renderer) {
|
|
|
317
315
|
return Component;
|
|
318
316
|
};
|
|
319
317
|
|
|
320
|
-
BaseState = require("
|
|
321
|
-
BaseComponent = require("
|
|
318
|
+
BaseState = require("../../../runtime/components/State");
|
|
319
|
+
BaseComponent = require("../../../runtime/components/Component");
|
|
322
320
|
inherit = require("raptor-util/inherit");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = function defineWidget(def, renderer) {
|
|
2
|
+
if (def.___isComponent) {
|
|
3
|
+
return def;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (renderer) {
|
|
7
|
+
return {
|
|
8
|
+
___isComponent: true,
|
|
9
|
+
_isWidget: true,
|
|
10
|
+
renderer: renderer,
|
|
11
|
+
render: renderer.render,
|
|
12
|
+
renderSync: renderer.renderSync,
|
|
13
|
+
template: renderer.template
|
|
14
|
+
};
|
|
15
|
+
} else {
|
|
16
|
+
return { ___isComponent: true, _isWidget: true };
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var ComponentsContext = require("
|
|
3
|
+
var ComponentsContext = require("../../../runtime/components/ComponentsContext");
|
|
4
4
|
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
5
5
|
|
|
6
6
|
module.exports = function endComponent(out, componentDef) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var registry = require("@internal/components-registry");
|
|
2
|
+
|
|
3
|
+
exports.getComponentForEl = require("@internal/components-util").___getComponentForEl;
|
|
4
|
+
exports.init = registry.___initServerRendered;
|
|
5
|
+
exports.register = function (id, component) {
|
|
6
|
+
registry.r(id, function () {
|
|
7
|
+
return component;
|
|
8
|
+
});
|
|
9
|
+
};
|