@torpor/view 0.3.3 → 0.3.4
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 +6 -0
- package/dist/compile.cjs +5 -6
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +5 -6
- package/dist/compile.js.map +1 -1
- package/package.json +1 -1
- package/src/compile/build/client/buildCode.ts +8 -3
package/CHANGELOG.md
CHANGED
package/dist/compile.cjs
CHANGED
|
@@ -1729,7 +1729,11 @@ function buildTemplate(template, map, imports, b, options) {
|
|
|
1729
1729
|
if (/\$batch\b/.test(script)) imports.add("$batch");
|
|
1730
1730
|
let currentIndex = 0;
|
|
1731
1731
|
let current = template.components[0];
|
|
1732
|
+
let status = makeStatus(imports, map, current, options);
|
|
1733
|
+
let first = true;
|
|
1732
1734
|
for (let chunk of template.script) if (chunk.script === "/* @params */") {
|
|
1735
|
+
if (!first) status = makeStatus(imports, map, current, options);
|
|
1736
|
+
first = false;
|
|
1733
1737
|
let params = [
|
|
1734
1738
|
`${current.markup ? "$parent" : "_$parent"}: ParentNode`,
|
|
1735
1739
|
`${current.markup ? "$anchor" : "_$anchor"}: Node | null`,
|
|
@@ -1745,7 +1749,6 @@ function buildTemplate(template, map, imports, b, options) {
|
|
|
1745
1749
|
b.append("");
|
|
1746
1750
|
} else if (chunk.script === "/* @render */") {
|
|
1747
1751
|
if (current.markup) {
|
|
1748
|
-
let status = makeStatus(imports, map, current, options);
|
|
1749
1752
|
b.append("");
|
|
1750
1753
|
b.append("/* User interface */");
|
|
1751
1754
|
buildFragmentText(current.markup, status, b);
|
|
@@ -1754,7 +1757,6 @@ function buildTemplate(template, map, imports, b, options) {
|
|
|
1754
1757
|
}
|
|
1755
1758
|
} else if (chunk.script === "/* @head */") {
|
|
1756
1759
|
if (current.head) {
|
|
1757
|
-
let status = makeStatus(imports, map, current, options);
|
|
1758
1760
|
b.append("");
|
|
1759
1761
|
b.append("/* Head */");
|
|
1760
1762
|
status.inHead = true;
|
|
@@ -1765,10 +1767,7 @@ function buildTemplate(template, map, imports, b, options) {
|
|
|
1765
1767
|
b.append("/**/ });");
|
|
1766
1768
|
currentIndex += 1;
|
|
1767
1769
|
current = template.components[currentIndex];
|
|
1768
|
-
} else
|
|
1769
|
-
let status = makeStatus(imports, map, current, options);
|
|
1770
|
-
addMappedText("", chunk.script, "", chunk.range, status, b);
|
|
1771
|
-
}
|
|
1770
|
+
} else addMappedText("", chunk.script, "", chunk.range, status, b);
|
|
1772
1771
|
}
|
|
1773
1772
|
function makeStatus(imports, map, current, options) {
|
|
1774
1773
|
return {
|