marko 4.26.5 → 4.28.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/CHANGELOG.md +2510 -0
- package/README.md +1 -1
- package/bin/markoc.js +15 -15
- package/dist/compiler/CompileContext.js +1 -0
- package/dist/compiler/ast/CustomTag.js +2 -2
- package/dist/core-tags/components/TransformHelper/convertToComponent.js +1 -1
- package/dist/core-tags/components/TransformHelper/handleLegacyBind.js +0 -4
- package/dist/core-tags/core/await/renderer.js +0 -4
- package/dist/core-tags/migrate/all-tags/body-only-if.js +0 -1
- package/dist/core-tags/migrate/all-tags/control-flow-directives.js +0 -1
- package/dist/core-tags/migrate/all-tags/dynamic-attributes.js +1 -2
- package/dist/core-tags/migrate/all-tags/include-directive.js +0 -2
- package/dist/core-tags/migrate/all-tags/legacy-nested-tag.js +0 -2
- package/dist/core-tags/migrate/all-tags/marko-init.js +0 -2
- package/dist/core-tags/migrate/all-tags/modifier-key.js +0 -2
- package/dist/core-tags/migrate/all-tags/ref.js +1 -3
- package/dist/core-tags/migrate/all-tags/w-bind.js +0 -2
- package/dist/core-tags/migrate/all-tags/w-body.js +0 -2
- package/dist/core-tags/migrate/all-tags/w-config.js +0 -2
- package/dist/core-tags/migrate/all-tags/w-for.js +0 -3
- package/dist/core-tags/migrate/all-tags/w-id.js +1 -4
- package/dist/core-tags/migrate/all-tags/w-on.js +1 -4
- package/dist/core-tags/migrate/all-tags/w-preserve-attrs.js +0 -2
- package/dist/core-tags/migrate/all-tags/w-preserve.js +1 -3
- package/dist/core-tags/migrate/all-tags/widget-in-attrs.js +2 -11
- package/dist/core-tags/migrate/all-templates/non-standard-template-literals.js +0 -4
- package/dist/core-tags/migrate/all-templates/render-calls.js +0 -2
- package/dist/core-tags/migrate/assign-tag.js +0 -2
- package/dist/core-tags/migrate/async-fragment-tag.js +0 -2
- package/dist/core-tags/migrate/async-fragments-tag.js +0 -2
- package/dist/core-tags/migrate/await-tag.js +0 -7
- package/dist/core-tags/migrate/class-tag.js +0 -2
- package/dist/core-tags/migrate/component-globals-tag.js +0 -2
- package/dist/core-tags/migrate/for-tag.js +0 -2
- package/dist/core-tags/migrate/include-tag.js +0 -1
- package/dist/core-tags/migrate/invoke-tag.js +0 -2
- package/dist/core-tags/migrate/layout-placeholder-tag.js +0 -1
- package/dist/core-tags/migrate/layout-put-tag.js +0 -1
- package/dist/core-tags/migrate/layout-use-tag.js +0 -1
- package/dist/core-tags/migrate/macro-body-tag.js +0 -2
- package/dist/core-tags/migrate/macro-tag.js +0 -2
- package/dist/core-tags/migrate/unless-tag.js +0 -1
- package/dist/core-tags/migrate/var-tag.js +0 -2
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +0 -10
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +0 -4
- package/dist/node_modules/@internal/components-registry/index-browser.js +2 -0
- package/dist/runtime/RenderResult.js +0 -3
- package/dist/runtime/components/Component.js +0 -6
- package/dist/runtime/components/ComponentDef.js +0 -3
- package/dist/runtime/components/ServerComponent.js +0 -4
- package/dist/runtime/components/legacy/defineComponent-legacy.js +0 -3
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +0 -6
- package/dist/runtime/components/legacy/index.js +3 -1
- package/dist/runtime/helpers/dynamic-tag.js +3 -0
- package/dist/runtime/helpers/for-of.js +3 -1
- package/dist/runtime/helpers/interop-require.js +3 -0
- package/dist/runtime/html/helpers/attr.js +0 -4
- package/dist/runtime/html/helpers/attrs.js +0 -2
- package/dist/runtime/html/helpers/merge-attrs.js +0 -3
- package/dist/runtime/vdom/VElement.js +0 -3
- package/dist/runtime/vdom/helpers/attrs.js +0 -2
- package/dist/taglib/taglib-finder/index.js +1 -1
- package/dist/taglib/taglib-loader/Taglib.js +2 -1
- package/dist/taglib/taglib-loader/index.js +2 -2
- package/dist/taglib/taglib-loader/loadTagFromProps.js +15 -0
- package/dist/taglib/taglib-loader/loadTaglibFromFile.js +2 -2
- package/dist/taglib/taglib-loader/loadTaglibFromProps.js +12 -0
- package/docs/10-awesome-marko-features.md +1 -1
- package/docs/body-content.md +3 -3
- package/docs/class-components.md +6 -6
- package/docs/express.md +1 -1
- package/docs/fastify.md +4 -4
- package/docs/hapi.md +3 -3
- package/docs/http.md +1 -1
- package/docs/huncwot.md +1 -1
- package/docs/installing.md +2 -2
- package/docs/koa.md +2 -2
- package/docs/lasso.md +1 -1
- package/docs/marko-4-upgrade.md +1 -1
- package/docs/marko-v4.md +4 -4
- package/docs/marko-vs-react.md +2 -2
- package/docs/rendering.md +6 -6
- package/docs/server-side-rendering.md +3 -3
- package/docs/webpack.md +16 -16
- package/docs/why-is-marko-fast.md +3 -3
- package/package.json +1 -2
- package/src/compiler/Builder.js +13 -13
- package/src/compiler/CodeGenerator.js +2 -2
- package/src/compiler/CodeWriter.js +1 -1
- package/src/compiler/CompileContext.js +31 -30
- package/src/compiler/Compiler.js +3 -3
- package/src/compiler/HtmlJsParser.js +4 -4
- package/src/compiler/Migrator.js +2 -2
- package/src/compiler/Normalizer.js +5 -5
- package/src/compiler/Parser.js +11 -11
- package/src/compiler/Walker.js +1 -1
- package/src/compiler/ast/ArrayExpression.js +1 -1
- package/src/compiler/ast/BinaryExpression.js +1 -1
- package/src/compiler/ast/ConditionalExpression.js +1 -1
- package/src/compiler/ast/CustomTag.js +14 -14
- package/src/compiler/ast/Declaration.js +2 -2
- package/src/compiler/ast/DocumentType.js +2 -2
- package/src/compiler/ast/ForEach.js +1 -1
- package/src/compiler/ast/ForEachProp.js +1 -1
- package/src/compiler/ast/ForRange.js +1 -1
- package/src/compiler/ast/HtmlAttribute/html/generateCode.js +4 -4
- package/src/compiler/ast/HtmlAttribute/vdom/generateCode.js +2 -2
- package/src/compiler/ast/HtmlAttributeCollection.js +3 -3
- package/src/compiler/ast/HtmlComment.js +1 -1
- package/src/compiler/ast/HtmlElement/html/EndTag.js +1 -1
- package/src/compiler/ast/HtmlElement/html/StartTag.js +3 -3
- package/src/compiler/ast/HtmlElement/html/generateCode.js +5 -5
- package/src/compiler/ast/HtmlElement/index.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/generateCode.js +3 -3
- package/src/compiler/ast/If.js +1 -1
- package/src/compiler/ast/LogicalExpression.js +1 -1
- package/src/compiler/ast/MemberExpression.js +1 -1
- package/src/compiler/ast/NewExpression.js +1 -1
- package/src/compiler/ast/Node.js +4 -4
- package/src/compiler/ast/ObjectExpression.js +2 -2
- package/src/compiler/ast/Property.js +1 -1
- package/src/compiler/ast/SequenceExpression.js +1 -1
- package/src/compiler/ast/TemplateLiteral.js +1 -1
- package/src/compiler/ast/TemplateRoot.js +3 -3
- package/src/compiler/ast/Text/index.js +1 -1
- package/src/compiler/ast/UnaryExpression.js +1 -1
- package/src/compiler/ast/UpdateExpression.js +1 -1
- package/src/compiler/config.js +1 -1
- package/src/compiler/index.js +5 -5
- package/src/compiler/modules.js +2 -2
- package/src/compiler/util/UniqueVars.js +4 -4
- package/src/compiler/util/convertRawJavaScriptAst.js +1 -1
- package/src/compiler/util/javaScriptReservedWords.js +1 -1
- package/src/compiler/util/macros.js +1 -1
- package/src/compiler/util/mergeProps.js +3 -3
- package/src/compiler/util/parseJavaScriptArgs.js +1 -1
- package/src/compiler/util/parseJavaScriptParams.js +1 -1
- package/src/compiler/util/parseRawJavaScriptAst.js +1 -1
- package/src/compiler/util/removeComments.js +6 -6
- package/src/compiler/util/tokenizer.js +3 -3
- package/src/compiler/util/vdom/VDOMOptimizer.js +2 -2
- package/src/core-tags/cache/cached-fragment-tag.js +2 -2
- package/src/core-tags/cache/default-cache-manager.js +2 -2
- package/src/core-tags/components/TransformHelper/ComponentArgsCompiler.js +3 -3
- package/src/core-tags/components/TransformHelper/assignComponentId.js +3 -3
- package/src/core-tags/components/TransformHelper/convertToComponent.js +7 -5
- package/src/core-tags/components/TransformHelper/getComponentFiles.js +1 -1
- package/src/core-tags/components/TransformHelper/handleComponentEvents.js +3 -3
- package/src/core-tags/components/TransformHelper/handleComponentPreserve.js +7 -7
- package/src/core-tags/components/TransformHelper/handleLegacyBind.js +2 -8
- package/src/core-tags/components/TransformHelper/handleRootNodes.js +14 -14
- package/src/core-tags/components/TransformHelper/handleScopedAttrs.js +1 -1
- package/src/core-tags/components/TransformHelper/index.js +1 -1
- package/src/core-tags/components/component-tag.js +1 -1
- package/src/core-tags/components/components-transformer.js +2 -2
- package/src/core-tags/components/util/generateRegisterComponentCode.js +2 -2
- package/src/core-tags/components/widget-types-tag.js +2 -2
- package/src/core-tags/core/await/AsyncValue.js +1 -1
- package/src/core-tags/core/await/renderer.js +3 -12
- package/src/core-tags/core/await/reorderer-renderer.js +1 -1
- package/src/core-tags/core/core-transformer.js +5 -5
- package/src/core-tags/core/html-comment-tag.js +1 -1
- package/src/core-tags/core/import-tag.js +1 -1
- package/src/core-tags/core/util/parseImport.js +8 -8
- package/src/core-tags/html/normalize-script-text.js +1 -1
- package/src/core-tags/migrate/all-tags/body-only-if.js +4 -5
- package/src/core-tags/migrate/all-tags/control-flow-directives.js +2 -5
- package/src/core-tags/migrate/all-tags/dynamic-attributes.js +1 -4
- package/src/core-tags/migrate/all-tags/include-directive.js +0 -4
- package/src/core-tags/migrate/all-tags/index.js +2 -2
- package/src/core-tags/migrate/all-tags/legacy-nested-tag.js +0 -5
- package/src/core-tags/migrate/all-tags/marko-init.js +2 -8
- package/src/core-tags/migrate/all-tags/modifier-key.js +1 -7
- package/src/core-tags/migrate/all-tags/params.js +1 -1
- package/src/core-tags/migrate/all-tags/ref.js +1 -5
- package/src/core-tags/migrate/all-tags/w-bind.js +8 -12
- package/src/core-tags/migrate/all-tags/w-body.js +3 -7
- package/src/core-tags/migrate/all-tags/w-config.js +1 -5
- package/src/core-tags/migrate/all-tags/w-for.js +1 -8
- package/src/core-tags/migrate/all-tags/w-id.js +1 -8
- package/src/core-tags/migrate/all-tags/w-on.js +2 -9
- package/src/core-tags/migrate/all-tags/w-preserve-attrs.js +1 -5
- package/src/core-tags/migrate/all-tags/w-preserve.js +3 -7
- package/src/core-tags/migrate/all-tags/widget-in-attrs.js +4 -17
- package/src/core-tags/migrate/all-templates/index.js +2 -2
- package/src/core-tags/migrate/all-templates/non-standard-template-literals.js +6 -12
- package/src/core-tags/migrate/all-templates/render-calls.js +4 -8
- package/src/core-tags/migrate/all-templates/widget-data-is-state.js +2 -2
- package/src/core-tags/migrate/all-templates/widget-get-template-data.js +2 -2
- package/src/core-tags/migrate/assign-tag.js +2 -6
- package/src/core-tags/migrate/async-fragment-tag.js +2 -6
- package/src/core-tags/migrate/async-fragments-tag.js +0 -4
- package/src/core-tags/migrate/await-tag.js +8 -23
- package/src/core-tags/migrate/class-tag.js +0 -4
- package/src/core-tags/migrate/component-globals-tag.js +0 -4
- package/src/core-tags/migrate/for-tag.js +12 -16
- package/src/core-tags/migrate/include-tag.js +2 -5
- package/src/core-tags/migrate/invoke-tag.js +2 -6
- package/src/core-tags/migrate/layout-placeholder-tag.js +0 -3
- package/src/core-tags/migrate/layout-put-tag.js +0 -3
- package/src/core-tags/migrate/layout-use-tag.js +0 -3
- package/src/core-tags/migrate/macro-body-tag.js +0 -5
- package/src/core-tags/migrate/macro-tag.js +5 -10
- package/src/core-tags/migrate/unless-tag.js +0 -3
- package/src/core-tags/migrate/util/addIdScopedAttr.js +1 -1
- package/src/core-tags/migrate/util/import-tag.js +6 -6
- package/src/core-tags/migrate/util/parseFor.js +20 -20
- package/src/core-tags/migrate/util/renderCallToDynamicTag.js +7 -7
- package/src/core-tags/migrate/var-tag.js +4 -8
- package/src/express.js +1 -1
- package/src/hot-reload.js +3 -3
- package/src/node-require/index.js +1 -1
- package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +2 -53
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +0 -10
- package/src/node_modules/@internal/components-registry/index-browser.js +2 -0
- package/src/runtime/RenderResult.js +3 -16
- package/src/runtime/components/Component.js +2 -23
- package/src/runtime/components/ComponentDef.js +2 -8
- package/src/runtime/components/ComponentsContext.js +1 -1
- package/src/runtime/components/ServerComponent.js +0 -6
- package/src/runtime/components/State.js +2 -2
- package/src/runtime/components/attach-detach.js +1 -1
- package/src/runtime/components/dom-data.js +1 -1
- package/src/runtime/components/legacy/defineComponent-legacy.js +0 -5
- package/src/runtime/components/legacy/defineRenderer-legacy.js +0 -16
- package/src/runtime/components/legacy/dependencies/index.js +10 -10
- package/src/runtime/components/legacy/index.js +5 -0
- package/src/runtime/components/legacy/renderer-legacy.js +1 -1
- package/src/runtime/components/update-manager.js +1 -1
- package/src/runtime/dom-insert.js +1 -1
- package/src/runtime/helpers/_weak-map.js +1 -1
- package/src/runtime/helpers/bind-component.js +1 -1
- package/src/runtime/helpers/dynamic-tag.js +3 -0
- package/src/runtime/helpers/for-of.js +1 -6
- package/src/runtime/helpers/interop-require.js +3 -0
- package/src/runtime/html/AsyncStream.js +5 -5
- package/src/runtime/html/BufferedWriter.js +1 -1
- package/src/runtime/html/StringWriter.js +1 -1
- package/src/runtime/html/helpers/attr.js +0 -9
- package/src/runtime/html/helpers/attrs.js +0 -6
- package/src/runtime/html/helpers/merge-attrs.js +0 -8
- package/src/runtime/html/index.js +1 -1
- package/src/runtime/renderable.js +1 -1
- package/src/runtime/vdom/AsyncVDOMBuilder.js +2 -2
- package/src/runtime/vdom/VComment.js +1 -1
- package/src/runtime/vdom/VComponent.js +1 -1
- package/src/runtime/vdom/VDocumentFragment.js +1 -1
- package/src/runtime/vdom/VElement.js +4 -11
- package/src/runtime/vdom/VFragment.js +1 -1
- package/src/runtime/vdom/VNode.js +1 -1
- package/src/runtime/vdom/VText.js +1 -1
- package/src/runtime/vdom/helpers/attrs.js +0 -7
- package/src/runtime/vdom/index.js +1 -1
- package/src/runtime/vdom/morphdom/fragment.js +1 -1
- package/src/runtime/vdom/morphdom/specialElHandlers.js +1 -1
- package/src/taglib/taglib-finder/index.js +6 -6
- package/src/taglib/taglib-loader/Tag.js +8 -8
- package/src/taglib/taglib-loader/Taglib.js +3 -2
- package/src/taglib/taglib-loader/index.js +2 -2
- package/src/taglib/taglib-loader/loadAttributeFromProps.js +1 -1
- package/src/taglib/taglib-loader/loadTagFromProps.js +29 -14
- package/src/taglib/taglib-loader/loadTaglibFromFile.js +2 -2
- package/src/taglib/taglib-loader/loadTaglibFromProps.js +27 -9
- package/src/taglib/taglib-loader/scanTagsDir.js +6 -6
- package/src/taglib/taglib-lookup/TaglibLookup.js +8 -8
|
@@ -11,7 +11,7 @@ function getRootDeps(template, context) {
|
|
|
11
11
|
attachDepsAndComponentsToTemplate(template, context);
|
|
12
12
|
|
|
13
13
|
var deps = (template.___depsArray = Object.keys(template.___deps).map(
|
|
14
|
-
key => template.___deps[key]
|
|
14
|
+
(key) => template.___deps[key]
|
|
15
15
|
));
|
|
16
16
|
var initModule = getInitModule(template.path, template.___components);
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ function getRootDeps(template, context) {
|
|
|
20
20
|
deps.push({
|
|
21
21
|
type: "require",
|
|
22
22
|
path: require.resolve("../../boot"),
|
|
23
|
-
run: true
|
|
23
|
+
run: true,
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
// these dependencies should be last
|
|
@@ -59,7 +59,7 @@ function attachDepsAndComponentsToTemplate(target, context) {
|
|
|
59
59
|
var root = nodePath.dirname(template.path);
|
|
60
60
|
|
|
61
61
|
if (meta.deps) {
|
|
62
|
-
meta.deps.forEach(dep => {
|
|
62
|
+
meta.deps.forEach((dep) => {
|
|
63
63
|
dep = resolveDep(dep, root, context);
|
|
64
64
|
deps[dep.virtualPath || dep.path] = dep;
|
|
65
65
|
});
|
|
@@ -69,12 +69,12 @@ function attachDepsAndComponentsToTemplate(target, context) {
|
|
|
69
69
|
var resolveFrom = (context && context.resolveFrom) || defaultResolveFrom;
|
|
70
70
|
components[meta.id] = {
|
|
71
71
|
id: meta.id,
|
|
72
|
-
path: resolveFrom(root, meta.component)
|
|
72
|
+
path: resolveFrom(root, meta.component),
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
if (meta.tags) {
|
|
77
|
-
meta.tags.forEach(tagPath => {
|
|
77
|
+
meta.tags.forEach((tagPath) => {
|
|
78
78
|
var resolveFrom = context.resolveFrom || defaultResolveFrom;
|
|
79
79
|
var tag = resolveFrom(root, tagPath);
|
|
80
80
|
var ext = nodePath.extname(tag);
|
|
@@ -100,13 +100,13 @@ function getInitModule(path, components) {
|
|
|
100
100
|
var module = null;
|
|
101
101
|
|
|
102
102
|
if (components) {
|
|
103
|
-
components = Object.keys(components).map(key => components[key]);
|
|
103
|
+
components = Object.keys(components).map((key) => components[key]);
|
|
104
104
|
|
|
105
105
|
if (components.length) {
|
|
106
106
|
var root = nodePath.dirname(path);
|
|
107
107
|
var virtualPath = path + ".init.js";
|
|
108
108
|
var registrations = components.map(
|
|
109
|
-
component =>
|
|
109
|
+
(component) =>
|
|
110
110
|
`components.register('${component.id}', require('.${
|
|
111
111
|
nodePath.sep
|
|
112
112
|
}${nodePath.relative(root, component.path)}'));`
|
|
@@ -128,8 +128,8 @@ function getInitModule(path, components) {
|
|
|
128
128
|
} else {
|
|
129
129
|
return code;
|
|
130
130
|
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -167,7 +167,7 @@ function parseDependencyString(string) {
|
|
|
167
167
|
var match = /^(?:([\w-]+)(?::\s*|\s+))?(.*?(?:\.(\w+))?)$/.exec(string);
|
|
168
168
|
return {
|
|
169
169
|
type: match[1] || match[3],
|
|
170
|
-
path: match[2]
|
|
170
|
+
path: match[2],
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line no-constant-condition
|
|
2
|
+
if ("MARKO_DEBUG") {
|
|
3
|
+
require("complain")("marko-widgets is deprecated. When upgrading to Marko 5 ensure marko-widgets@8 is installed for compatibility.");
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
module.exports = require("@internal/components-entry-legacy");
|
|
@@ -5,6 +5,7 @@ var changeCase = require("./_change-case");
|
|
|
5
5
|
var ComponentsContext = require("../components/ComponentsContext");
|
|
6
6
|
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
7
7
|
var ComponentDef = require("../components/ComponentDef");
|
|
8
|
+
var interopRequire = require("./interop-require");
|
|
8
9
|
var w10NOOP = require("warp10/constants").NOOP;
|
|
9
10
|
var RENDER_BODY_TO_JSON = function () {
|
|
10
11
|
return w10NOOP;
|
|
@@ -66,6 +67,8 @@ module.exports = function dynamicTag(
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
tag = interopRequire(tag);
|
|
71
|
+
|
|
69
72
|
var renderer =
|
|
70
73
|
tag._ ||
|
|
71
74
|
(tag.renderer ? tag.renderer.renderer || tag.renderer : tag.render);
|
|
@@ -9,12 +9,7 @@ module.exports = function forOf(array, callback) {
|
|
|
9
9
|
var i;
|
|
10
10
|
|
|
11
11
|
if (array == null) {
|
|
12
|
-
//
|
|
13
|
-
if ("MARKO_DEBUG") {
|
|
14
|
-
complain(
|
|
15
|
-
"Passing a non iterable to a <for> loop is deprecated. Prefer to use an <if> around the loop instead."
|
|
16
|
-
);
|
|
17
|
-
}
|
|
12
|
+
// ignore
|
|
18
13
|
} else if (Array.isArray(array)) {
|
|
19
14
|
for (i = 0; i < array.length; i++) {
|
|
20
15
|
callback(array[i], i, array);
|
|
@@ -23,7 +23,7 @@ var voidWriter = {
|
|
|
23
23
|
},
|
|
24
24
|
toString: function () {
|
|
25
25
|
return "";
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
function State(root, stream, writer, events) {
|
|
@@ -237,7 +237,7 @@ var proto = (AsyncStream.prototype = {
|
|
|
237
237
|
writer: newStream, // Legacy
|
|
238
238
|
parentWriter: this, // Legacy
|
|
239
239
|
out: newStream,
|
|
240
|
-
parentOut: this
|
|
240
|
+
parentOut: this,
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
return newStream;
|
|
@@ -498,7 +498,7 @@ var proto = (AsyncStream.prototype = {
|
|
|
498
498
|
newOut.on("error", this.emit.bind(this, "error"));
|
|
499
499
|
this._state.events.emit("beginDetachedAsync", {
|
|
500
500
|
out: newOut,
|
|
501
|
-
parentOut: this
|
|
501
|
+
parentOut: this,
|
|
502
502
|
});
|
|
503
503
|
return newOut;
|
|
504
504
|
},
|
|
@@ -655,7 +655,7 @@ var proto = (AsyncStream.prototype = {
|
|
|
655
655
|
this.___assignedComponentDef = componentDef;
|
|
656
656
|
this.___assignedKey = key;
|
|
657
657
|
this.___assignedCustomEvents = customEvents;
|
|
658
|
-
}
|
|
658
|
+
},
|
|
659
659
|
});
|
|
660
660
|
|
|
661
661
|
// alias:
|
|
@@ -669,6 +669,6 @@ function getNonMarkoStack(error) {
|
|
|
669
669
|
.toString()
|
|
670
670
|
.split("\n")
|
|
671
671
|
.slice(1)
|
|
672
|
-
.filter(line => !/\/node_modules\/marko\//.test(line))
|
|
672
|
+
.filter((line) => !/\/node_modules\/marko\//.test(line))
|
|
673
673
|
.join("\n");
|
|
674
674
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
|
4
4
|
var escapeDoubleQuotes = escapeQuoteHelpers.___escapeDoubleQuotes;
|
|
5
5
|
var escapeSingleQuotes = escapeQuoteHelpers.___escapeSingleQuotes;
|
|
6
|
-
var complain = "MARKO_DEBUG" && require("complain");
|
|
7
6
|
|
|
8
7
|
module.exports = maybeEmptyAttr;
|
|
9
8
|
|
|
@@ -30,14 +29,6 @@ function notEmptyAttr(name, value) {
|
|
|
30
29
|
switch (value.toString) {
|
|
31
30
|
case Object.prototype.toString:
|
|
32
31
|
case Array.prototype.toString:
|
|
33
|
-
// eslint-disable-next-line no-constant-condition
|
|
34
|
-
if ("MARKO_DEBUG") {
|
|
35
|
-
complain(
|
|
36
|
-
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead.",
|
|
37
|
-
{ locationIndex: 2 }
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
32
|
return " " + name + singleQuote(JSON.stringify(value), 2);
|
|
42
33
|
case RegExp.prototype.toString:
|
|
43
34
|
return " " + name + guessQuotes(value.source);
|
|
@@ -12,12 +12,6 @@ module.exports = function attrs(arg) {
|
|
|
12
12
|
}
|
|
13
13
|
return result;
|
|
14
14
|
case "string":
|
|
15
|
-
// eslint-disable-next-line no-constant-condition
|
|
16
|
-
if ("MARKO_DEBUG") {
|
|
17
|
-
complain(
|
|
18
|
-
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
15
|
return arg;
|
|
22
16
|
default:
|
|
23
17
|
return "";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
3
|
var dynamicAttrHelper = require("./_dynamic-attr");
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -13,13 +12,6 @@ module.exports = function mergeAttrs() {
|
|
|
13
12
|
for (var i = arguments.length, last = i - 1; i--; ) {
|
|
14
13
|
var source = arguments[i];
|
|
15
14
|
if (typeof source === "string") {
|
|
16
|
-
// eslint-disable-next-line no-constant-condition
|
|
17
|
-
if ("MARKO_DEBUG") {
|
|
18
|
-
complain(
|
|
19
|
-
"Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead."
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
15
|
if (source[0] !== " ") {
|
|
24
16
|
result += " " + source;
|
|
25
17
|
} else {
|
|
@@ -293,7 +293,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
293
293
|
|
|
294
294
|
state.___events.emit("beginAsync", {
|
|
295
295
|
out: asyncOut,
|
|
296
|
-
parentOut: this
|
|
296
|
+
parentOut: this,
|
|
297
297
|
});
|
|
298
298
|
|
|
299
299
|
return asyncOut;
|
|
@@ -443,7 +443,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
443
443
|
this.___assignedComponentDef = componentDef;
|
|
444
444
|
this.___assignedKey = key;
|
|
445
445
|
this.___assignedCustomEvents = customEvents;
|
|
446
|
-
}
|
|
446
|
+
},
|
|
447
447
|
});
|
|
448
448
|
|
|
449
449
|
proto.e = proto.element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* jshint newcap:false */
|
|
2
2
|
|
|
3
|
-
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
3
|
var domData = require("../components/dom-data");
|
|
5
4
|
var componentsUtil = require("@internal/components-util");
|
|
6
5
|
var vElementByDOMNode = domData.___vElementByDOMNode;
|
|
@@ -15,7 +14,7 @@ var NS_MATH = "http://www.w3.org/1998/Math/MathML";
|
|
|
15
14
|
var NS_SVG = "http://www.w3.org/2000/svg";
|
|
16
15
|
var DEFAULT_NS = {
|
|
17
16
|
svg: NS_SVG,
|
|
18
|
-
math: NS_MATH
|
|
17
|
+
math: NS_MATH,
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
var FLAG_SIMPLE_ATTRS = 1;
|
|
@@ -34,12 +33,6 @@ function convertAttrValue(type, value) {
|
|
|
34
33
|
switch (value.toString) {
|
|
35
34
|
case Object.prototype.toString:
|
|
36
35
|
case Array.prototype.toString:
|
|
37
|
-
// eslint-disable-next-line no-constant-condition
|
|
38
|
-
if ("MARKO_DEBUG") {
|
|
39
|
-
complain(
|
|
40
|
-
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead."
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
36
|
return JSON.stringify(value);
|
|
44
37
|
case RegExp.prototype.toString:
|
|
45
38
|
return value.source;
|
|
@@ -212,7 +205,7 @@ VElement.prototype = {
|
|
|
212
205
|
// different namespaces
|
|
213
206
|
var value = this.___attributes[name];
|
|
214
207
|
return value != null && value !== false;
|
|
215
|
-
}
|
|
208
|
+
},
|
|
216
209
|
};
|
|
217
210
|
|
|
218
211
|
inherit(VElement, VNode);
|
|
@@ -224,7 +217,7 @@ var proto = (VElementClone.prototype = VElement.prototype);
|
|
|
224
217
|
get: function () {
|
|
225
218
|
var value = this.___attributes[name];
|
|
226
219
|
return value !== false && value != null;
|
|
227
|
-
}
|
|
220
|
+
},
|
|
228
221
|
});
|
|
229
222
|
});
|
|
230
223
|
|
|
@@ -240,7 +233,7 @@ defineProperty(proto, "___value", {
|
|
|
240
233
|
this.___attributes.type === "radio"
|
|
241
234
|
? "on"
|
|
242
235
|
: "";
|
|
243
|
-
}
|
|
236
|
+
},
|
|
244
237
|
});
|
|
245
238
|
|
|
246
239
|
VElement.___removePreservedAttributes = function (attrs) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
3
|
var classHelper = require("../../helpers/class-value");
|
|
5
4
|
var styleHelper = require("../../helpers/style-value");
|
|
6
5
|
var parseHTML = require("../parse-html");
|
|
@@ -10,12 +9,6 @@ var parseHTML = require("../parse-html");
|
|
|
10
9
|
*/
|
|
11
10
|
module.exports = function (attributes) {
|
|
12
11
|
if (typeof attributes === "string") {
|
|
13
|
-
// eslint-disable-next-line no-constant-condition
|
|
14
|
-
if ("MARKO_DEBUG") {
|
|
15
|
-
complain(
|
|
16
|
-
"Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
12
|
return parseAttrs(attributes);
|
|
20
13
|
}
|
|
21
14
|
|
|
@@ -36,19 +36,19 @@ function getAllDependencyNames(pkg) {
|
|
|
36
36
|
var map = {};
|
|
37
37
|
|
|
38
38
|
if (pkg.dependencies) {
|
|
39
|
-
Object.keys(pkg.dependencies).forEach(name => {
|
|
39
|
+
Object.keys(pkg.dependencies).forEach((name) => {
|
|
40
40
|
map[name] = true;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if (pkg.peerDependencies) {
|
|
45
|
-
Object.keys(pkg.peerDependencies).forEach(name => {
|
|
45
|
+
Object.keys(pkg.peerDependencies).forEach((name) => {
|
|
46
46
|
map[name] = true;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (pkg.devDependencies) {
|
|
51
|
-
Object.keys(pkg.devDependencies).forEach(name => {
|
|
51
|
+
Object.keys(pkg.devDependencies).forEach((name) => {
|
|
52
52
|
map[name] = true;
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -75,7 +75,7 @@ function find(dirname, registeredTaglibs) {
|
|
|
75
75
|
added[taglib.id] = true;
|
|
76
76
|
found.push(taglib);
|
|
77
77
|
},
|
|
78
|
-
foundTaglibPackages: {}
|
|
78
|
+
foundTaglibPackages: {},
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
var rootDirname = process.cwd(); // Don't search up past this directory
|
|
@@ -119,11 +119,11 @@ function find(dirname, registeredTaglibs) {
|
|
|
119
119
|
|
|
120
120
|
if (rootPkg) {
|
|
121
121
|
// Now look for `marko.json` from installed packages
|
|
122
|
-
getAllDependencyNames(rootPkg).forEach(name => {
|
|
122
|
+
getAllDependencyNames(rootPkg).forEach((name) => {
|
|
123
123
|
if (!excludedPackages[name]) {
|
|
124
124
|
let taglibPath = resolveFrom(rootPkg.__dirname, name + "/marko.json");
|
|
125
125
|
if (taglibPath) {
|
|
126
|
-
var taglib = taglibLoader.loadTaglibFromFile(taglibPath);
|
|
126
|
+
var taglib = taglibLoader.loadTaglibFromFile(taglibPath, true);
|
|
127
127
|
helper.addTaglib(taglib);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -98,24 +98,24 @@ class Tag {
|
|
|
98
98
|
attr.filePath = this.filePath;
|
|
99
99
|
if (attr.name === "key" && !this.isCoreTag()) {
|
|
100
100
|
complain("@key property is deprecated", {
|
|
101
|
-
location: this.filePath
|
|
101
|
+
location: this.filePath,
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//
|
|
105
105
|
if (attr.setFlag && attr.setFlag !== "hasComponentEvents") {
|
|
106
106
|
complain(`${attr.name} - : set-flag property is deprecated`, {
|
|
107
|
-
location: this.filePath
|
|
107
|
+
location: this.filePath,
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
if (attr.type === "template") {
|
|
111
111
|
complain(`${attr.name} - attribute template type is deprecated`, {
|
|
112
|
-
location: this.filePath
|
|
112
|
+
location: this.filePath,
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
if (attr.type === "path") {
|
|
117
117
|
complain(`${attr.name} - attribute path type is deprecated`, {
|
|
118
|
-
location: this.filePath
|
|
118
|
+
location: this.filePath,
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -137,7 +137,7 @@ class Tag {
|
|
|
137
137
|
complain(
|
|
138
138
|
'The default "targetProperty" for "@*" attribute definitions is changing from "*" to "null" (merged in with the rest of the input) in a future Marko release. In order to avoid an issue upgrading, please explicitly define the "targetProperty".',
|
|
139
139
|
{
|
|
140
|
-
location: this.filePath
|
|
140
|
+
location: this.filePath,
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
attr.targetProperty = "*";
|
|
@@ -186,13 +186,13 @@ class Tag {
|
|
|
186
186
|
*/
|
|
187
187
|
addNestedVariable(nestedVariable) {
|
|
188
188
|
complain("addNestedVariable is deprecated. Use tag parameters instead.", {
|
|
189
|
-
location: this.filePath
|
|
189
|
+
location: this.filePath,
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
if (!this.nestedVariables) {
|
|
193
193
|
this.nestedVariables = {
|
|
194
194
|
__noMerge: true,
|
|
195
|
-
vars: []
|
|
195
|
+
vars: [],
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -220,7 +220,7 @@ class Tag {
|
|
|
220
220
|
this.bodyFunction = {
|
|
221
221
|
__noMerge: true,
|
|
222
222
|
name: name,
|
|
223
|
-
params: params
|
|
223
|
+
params: params,
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
@@ -27,9 +27,10 @@ function handleImport(taglib, importedTaglib) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
class Taglib {
|
|
30
|
-
constructor(filePath) {
|
|
30
|
+
constructor(filePath, isFromPackageJson) {
|
|
31
31
|
ok(filePath, '"filePath" expected');
|
|
32
32
|
this.filePath = this.path /* deprecated */ = this.id = filePath;
|
|
33
|
+
this.isFromPackageJson = isFromPackageJson === true;
|
|
33
34
|
this.dirname = path.dirname(this.filePath);
|
|
34
35
|
this.tags = {};
|
|
35
36
|
this.textTransformers = [];
|
|
@@ -109,7 +110,7 @@ class Taglib {
|
|
|
109
110
|
textTransformers: this.textTransformers,
|
|
110
111
|
attributes: this.attributes,
|
|
111
112
|
patternAttributes: this.patternAttributes,
|
|
112
|
-
imports: this.imports
|
|
113
|
+
imports: this.imports,
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
}
|
|
@@ -8,8 +8,8 @@ function loadTaglibFromProps(taglib, taglibProps) {
|
|
|
8
8
|
return loaders.loadTaglibFromProps(taglib, taglibProps);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function loadTaglibFromFile(filePath) {
|
|
12
|
-
return loaders.loadTaglibFromFile(filePath);
|
|
11
|
+
function loadTaglibFromFile(filePath, isFromPackageJson) {
|
|
12
|
+
return loaders.loadTaglibFromFile(filePath, isFromPackageJson);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function loadTaglibFromDir(filePath) {
|