marko 5.39.3 → 5.39.5
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.
|
@@ -6,14 +6,12 @@ var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
|
6
6
|
var kAssets = Symbol();
|
|
7
7
|
var kBlockIndex = Symbol();
|
|
8
8
|
var kDeferIndex = Symbol();
|
|
9
|
-
var kOriginal = Symbol();
|
|
10
9
|
var assetFlush;
|
|
11
10
|
|
|
12
11
|
exports.withPageAssets = function withPageAssets(typeId, template, runtime) {
|
|
13
12
|
assetFlush = runtime;
|
|
14
|
-
var render = template[kOriginal] || (template[kOriginal] = template._);
|
|
15
13
|
var flushBeforeInput = { renderBody: flush };
|
|
16
|
-
template
|
|
14
|
+
return createFacade(template, function (input, out) {
|
|
17
15
|
var hasAssets = !!out.global[kAssets];
|
|
18
16
|
var key = out.ad_;
|
|
19
17
|
var def = out.ac_;
|
|
@@ -32,15 +30,12 @@ exports.withPageAssets = function withPageAssets(typeId, template, runtime) {
|
|
|
32
30
|
flushHereAndAfter(flushBeforeInput, out);
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
return template;
|
|
33
|
+
template._(input, out);
|
|
34
|
+
});
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
exports.withLoadAssets = function withLoadAssets(typeId, template, triggers) {
|
|
41
|
-
|
|
42
|
-
var render = template[kOriginal] = template._;
|
|
43
|
-
template._ = function (input, out) {
|
|
38
|
+
return createFacade(template, function (input, out) {
|
|
44
39
|
var key = out.ad_;
|
|
45
40
|
var def = out.ac_;
|
|
46
41
|
addAsset(out.global, typeId, triggers);
|
|
@@ -50,16 +45,23 @@ exports.withLoadAssets = function withLoadAssets(typeId, template, triggers) {
|
|
|
50
45
|
flush(out);
|
|
51
46
|
out.ef();
|
|
52
47
|
out.bf(key, def.s_, true);
|
|
53
|
-
|
|
48
|
+
template._(input, out);
|
|
54
49
|
out.ef();
|
|
55
50
|
} else {
|
|
56
51
|
flush(out);
|
|
57
|
-
|
|
52
|
+
template._(input, out);
|
|
58
53
|
}
|
|
59
|
-
};
|
|
60
|
-
return template;
|
|
54
|
+
});
|
|
61
55
|
};
|
|
62
56
|
|
|
57
|
+
function createFacade(template, render) {
|
|
58
|
+
// Under hot reload the template's `_` is an accessor, which a normal
|
|
59
|
+
// assignment through the facade's prototype chain would invoke (storing
|
|
60
|
+
// the wrapped render as the template's own render fn), so the facade's
|
|
61
|
+
// render is defined as an own property instead.
|
|
62
|
+
return Object.create(template, { _: { value: render } });
|
|
63
|
+
}
|
|
64
|
+
|
|
63
65
|
exports.flushHead = function flushHead(out) {
|
|
64
66
|
if (out.global[kAssets]) {
|
|
65
67
|
flush(out);
|
|
@@ -9,6 +9,8 @@ const triggerRegExp = /\s*([\w-]+)\s*([^?|]+?)?\s*(?:\?([^|]*?))?\s*(?:\||$)/g;
|
|
|
9
9
|
const loadTagsByFile = new WeakMap();
|
|
10
10
|
|
|
11
11
|
function analyzeLoadImport(importDecl, tagEntry) {
|
|
12
|
+
if (!importDecl.node.attributes?.length) return;
|
|
13
|
+
|
|
12
14
|
const loadAttrValuePath = importDecl.
|
|
13
15
|
get("attributes").
|
|
14
16
|
find(
|
package/dist/translator.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
"use strict";exports.__esModule = true;exports.translate = exports.transform = exports.taglibs = exports.tagDiscoveryDirs = exports.preferAPI = exports.getRuntimeEntryFiles = exports.analyze = void 0;var tagsAPI = _interopRequireWildcard(require("@marko/runtime-tags/translator"));
|
|
1
|
+
"use strict";exports.__esModule = true;exports.version = exports.translate = exports.transform = exports.taglibs = exports.tagDiscoveryDirs = exports.preferAPI = exports.getRuntimeEntryFiles = exports.analyze = void 0;var tagsAPI = _interopRequireWildcard(require("@marko/runtime-tags/translator"));
|
|
2
2
|
|
|
3
3
|
var classAPI = _interopRequireWildcard(require("./translator/index"));function _interopRequireWildcard(e, t) {if ("function" == typeof WeakMap) var r = new WeakMap(),n = new WeakMap();return (_interopRequireWildcard = function (e, t) {if (!t && e && e.__esModule) return e;var o,i,f = { __proto__: null, default: e };if (null === e || "object" != typeof e && "function" != typeof e) return f;if (o = t ? n : r) {if (o.has(e)) return o.get(e);o.set(e, f);}for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);return f;})(e, t);}
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
|
+
version,
|
|
6
7
|
preferAPI,
|
|
7
8
|
tagDiscoveryDirs,
|
|
8
9
|
transform,
|
|
@@ -10,4 +11,4 @@ const {
|
|
|
10
11
|
translate,
|
|
11
12
|
taglibs,
|
|
12
13
|
getRuntimeEntryFiles
|
|
13
|
-
} = tagsAPI.createInteropTranslator(classAPI);exports.getRuntimeEntryFiles = getRuntimeEntryFiles;exports.taglibs = taglibs;exports.translate = translate;exports.analyze = analyze;exports.transform = transform;exports.tagDiscoveryDirs = tagDiscoveryDirs;exports.preferAPI = preferAPI;
|
|
14
|
+
} = tagsAPI.createInteropTranslator(classAPI);exports.getRuntimeEntryFiles = getRuntimeEntryFiles;exports.taglibs = taglibs;exports.translate = translate;exports.analyze = analyze;exports.transform = transform;exports.tagDiscoveryDirs = tagDiscoveryDirs;exports.preferAPI = preferAPI;exports.version = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.5",
|
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"front-end",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@marko/compiler": "^5.39.64",
|
|
73
|
-
"@marko/runtime-tags": "^6.1.
|
|
73
|
+
"@marko/runtime-tags": "^6.1.5",
|
|
74
74
|
"app-module-path": "^2.2.0",
|
|
75
75
|
"argly": "^1.2.0",
|
|
76
76
|
"browser-refresh-client": "1.1.4",
|
|
@@ -6,14 +6,12 @@ var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
|
6
6
|
var kAssets = Symbol();
|
|
7
7
|
var kBlockIndex = Symbol();
|
|
8
8
|
var kDeferIndex = Symbol();
|
|
9
|
-
var kOriginal = Symbol();
|
|
10
9
|
var assetFlush;
|
|
11
10
|
|
|
12
11
|
exports.withPageAssets = function withPageAssets(typeId, template, runtime) {
|
|
13
12
|
assetFlush = runtime;
|
|
14
|
-
var render = template[kOriginal] || (template[kOriginal] = template._);
|
|
15
13
|
var flushBeforeInput = { renderBody: flush };
|
|
16
|
-
template
|
|
14
|
+
return createFacade(template, function (input, out) {
|
|
17
15
|
var hasAssets = !!out.global[kAssets];
|
|
18
16
|
var key = out.___assignedKey;
|
|
19
17
|
var def = out.___assignedComponentDef;
|
|
@@ -32,15 +30,12 @@ exports.withPageAssets = function withPageAssets(typeId, template, runtime) {
|
|
|
32
30
|
flushHereAndAfter(flushBeforeInput, out);
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
return template;
|
|
33
|
+
template._(input, out);
|
|
34
|
+
});
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
exports.withLoadAssets = function withLoadAssets(typeId, template, triggers) {
|
|
41
|
-
|
|
42
|
-
var render = (template[kOriginal] = template._);
|
|
43
|
-
template._ = function (input, out) {
|
|
38
|
+
return createFacade(template, function (input, out) {
|
|
44
39
|
var key = out.___assignedKey;
|
|
45
40
|
var def = out.___assignedComponentDef;
|
|
46
41
|
addAsset(out.global, typeId, triggers);
|
|
@@ -50,16 +45,23 @@ exports.withLoadAssets = function withLoadAssets(typeId, template, triggers) {
|
|
|
50
45
|
flush(out);
|
|
51
46
|
out.ef();
|
|
52
47
|
out.bf(key, def.___component, true);
|
|
53
|
-
|
|
48
|
+
template._(input, out);
|
|
54
49
|
out.ef();
|
|
55
50
|
} else {
|
|
56
51
|
flush(out);
|
|
57
|
-
|
|
52
|
+
template._(input, out);
|
|
58
53
|
}
|
|
59
|
-
};
|
|
60
|
-
return template;
|
|
54
|
+
});
|
|
61
55
|
};
|
|
62
56
|
|
|
57
|
+
function createFacade(template, render) {
|
|
58
|
+
// Under hot reload the template's `_` is an accessor, which a normal
|
|
59
|
+
// assignment through the facade's prototype chain would invoke (storing
|
|
60
|
+
// the wrapped render as the template's own render fn), so the facade's
|
|
61
|
+
// render is defined as an own property instead.
|
|
62
|
+
return Object.create(template, { _: { value: render } });
|
|
63
|
+
}
|
|
64
|
+
|
|
63
65
|
exports.flushHead = function flushHead(out) {
|
|
64
66
|
if (out.global[kAssets]) {
|
|
65
67
|
flush(out);
|
|
@@ -9,6 +9,8 @@ const triggerRegExp = /\s*([\w-]+)\s*([^?|]+?)?\s*(?:\?([^|]*?))?\s*(?:\||$)/g;
|
|
|
9
9
|
const loadTagsByFile = new WeakMap();
|
|
10
10
|
|
|
11
11
|
export function analyzeLoadImport(importDecl, tagEntry) {
|
|
12
|
+
if (!importDecl.node.attributes?.length) return;
|
|
13
|
+
|
|
12
14
|
const loadAttrValuePath = importDecl
|
|
13
15
|
.get("attributes")
|
|
14
16
|
.find(
|