@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/package.json
CHANGED
|
@@ -106,9 +106,17 @@ function buildTemplate(
|
|
|
106
106
|
|
|
107
107
|
let currentIndex = 0;
|
|
108
108
|
let current = template.components[0];
|
|
109
|
+
let status: BuildStatus = makeStatus(imports, map, current, options);
|
|
110
|
+
let first = true;
|
|
109
111
|
|
|
110
112
|
for (let chunk of template.script) {
|
|
111
113
|
if (chunk.script === "/* @params */") {
|
|
114
|
+
// Reset the status for each new function body
|
|
115
|
+
if (!first) {
|
|
116
|
+
status = makeStatus(imports, map, current, options);
|
|
117
|
+
}
|
|
118
|
+
first = false;
|
|
119
|
+
|
|
112
120
|
// TODO: Support other params, like the user setting $context
|
|
113
121
|
let params = [
|
|
114
122
|
`${current.markup ? "$parent" : "_$parent"}: ParentNode`,
|
|
@@ -137,7 +145,6 @@ function buildTemplate(
|
|
|
137
145
|
} else if (chunk.script === "/* @render */") {
|
|
138
146
|
if (current.markup) {
|
|
139
147
|
// Add the interface
|
|
140
|
-
let status = makeStatus(imports, map, current, options);
|
|
141
148
|
b.append("");
|
|
142
149
|
b.append("/* User interface */");
|
|
143
150
|
buildFragmentText(current.markup, status, b);
|
|
@@ -147,7 +154,6 @@ function buildTemplate(
|
|
|
147
154
|
} else if (chunk.script === "/* @head */") {
|
|
148
155
|
if (current.head) {
|
|
149
156
|
// Add the head tags
|
|
150
|
-
let status = makeStatus(imports, map, current, options);
|
|
151
157
|
b.append("");
|
|
152
158
|
b.append("/* Head */");
|
|
153
159
|
status.inHead = true;
|
|
@@ -161,7 +167,6 @@ function buildTemplate(
|
|
|
161
167
|
currentIndex += 1;
|
|
162
168
|
current = template.components[currentIndex];
|
|
163
169
|
} else {
|
|
164
|
-
let status = makeStatus(imports, map, current, options);
|
|
165
170
|
addMappedText("", chunk.script, "", chunk.range, status, b);
|
|
166
171
|
}
|
|
167
172
|
}
|