@llui/vite-plugin 0.0.39 → 0.0.40
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/dist/transform.d.ts.map +1 -1
- package/dist/transform.js +37 -7
- package/dist/transform.js.map +1 -1
- package/package.json +1 -1
package/dist/transform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EAIpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAA2B,MAAM,sBAAsB,CAAA;AACrF,OAAO,EAAE,kBAAkB,EAAkB,MAAM,mBAAmB,CAAA;AA6KtE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5C,GAAG,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;IAC/C,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,kBAAk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wB,CACtC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,GAChE,MAAM,CAYR"}
|
package/dist/transform.js
CHANGED
|
@@ -1247,6 +1247,33 @@ function detectArrayOp(clause, stateName, modifiedFields, _structuralMask, _case
|
|
|
1247
1247
|
// tautology: every binding mask ANDed with zero is zero.
|
|
1248
1248
|
if (modifiedFields.length === 0)
|
|
1249
1249
|
return 'none';
|
|
1250
|
+
// The specialized methods (`reconcileClear`, `reconcileItems`,
|
|
1251
|
+
// `reconcileRemove`, `reconcileChanged`) only exist on `each` blocks.
|
|
1252
|
+
// Non-each blocks (`show`, `branch`, `scope`) leave them undefined,
|
|
1253
|
+
// so a method other than 0 (general reconcile) silently no-ops on
|
|
1254
|
+
// those blocks at runtime. If the case modifies fields BEYOND the
|
|
1255
|
+
// array op (e.g. `{ ...state, open: true, name: '', tags: [] }`),
|
|
1256
|
+
// any show/branch block whose mask intersects the case's dirty bits
|
|
1257
|
+
// would be selected for reconcile but then skipped by the no-op
|
|
1258
|
+
// method invocation — its `when`/`on` accessor never re-evaluates,
|
|
1259
|
+
// and the component appears structurally inert after mount.
|
|
1260
|
+
//
|
|
1261
|
+
// Conservative correctness: only emit a non-general method when the
|
|
1262
|
+
// array op is the SOLE field modification. With one modified field,
|
|
1263
|
+
// the only blocks selected by mask gating are ones that read that
|
|
1264
|
+
// single field — and the optimization is well-defined for that
|
|
1265
|
+
// narrow case (each blocks operating on the array). Multi-field
|
|
1266
|
+
// cases fall through to `'general'` (method=0), so every selected
|
|
1267
|
+
// block runs the standard `reconcile` path. We trade a niche
|
|
1268
|
+
// optimization (small benefit even when applicable) for guaranteed
|
|
1269
|
+
// structural reconciliation across the framework's primitive set.
|
|
1270
|
+
//
|
|
1271
|
+
// Sister of show-helper-reconcile.test.ts, which fixed the same
|
|
1272
|
+
// class of bug on the method=-1 path. Same architectural principle:
|
|
1273
|
+
// the compiler can't see every block in the view, so optimizations
|
|
1274
|
+
// that route around `reconcile` must be ironclad. When in doubt,
|
|
1275
|
+
// emit method=0 and let `_handleMsg`'s per-block mask gate filter.
|
|
1276
|
+
//
|
|
1250
1277
|
// Previously: if `(structuralMask & caseDirty) === 0`, return 'none'
|
|
1251
1278
|
// on the theory that no structural block's mask could intersect this
|
|
1252
1279
|
// case's dirty bits. That optimization was UNSAFE: `computeStructuralMask`
|
|
@@ -1266,13 +1293,9 @@ function detectArrayOp(clause, stateName, modifiedFields, _structuralMask, _case
|
|
|
1266
1293
|
// when `errors` changes — but the compiler was emitting `method = -1`
|
|
1267
1294
|
// (skip blocks entirely) for cases that only touch `errors`, and the
|
|
1268
1295
|
// error paragraphs would never mount.
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
// `if (!(block.mask & dirty)) continue` filters out uninterested
|
|
1273
|
-
// blocks at near-zero cost. We lose a micro-optimization but gain
|
|
1274
|
-
// correctness for every component that factors view helpers into
|
|
1275
|
-
// functions — which is the idiomatic pattern.
|
|
1296
|
+
if (modifiedFields.length !== 1)
|
|
1297
|
+
return 'general';
|
|
1298
|
+
const onlyField = modifiedFields[0];
|
|
1276
1299
|
// Look at the return expression's array field values
|
|
1277
1300
|
for (const stmt of clause.statements) {
|
|
1278
1301
|
const returnExpr = findReturnArray(stmt);
|
|
@@ -1289,6 +1312,13 @@ function detectArrayOp(clause, stateName, modifiedFields, _structuralMask, _case
|
|
|
1289
1312
|
: null;
|
|
1290
1313
|
if (!name)
|
|
1291
1314
|
continue;
|
|
1315
|
+
// The optimization only applies when the array op is on the
|
|
1316
|
+
// single tracked field. A `field: []` on a different field
|
|
1317
|
+
// (one not in modifiedFields, e.g. an untracked field) would
|
|
1318
|
+
// still no-op safely on each blocks via the mask gate, but to
|
|
1319
|
+
// keep the analysis tight we require an exact match.
|
|
1320
|
+
if (name !== onlyField)
|
|
1321
|
+
continue;
|
|
1292
1322
|
// Check for empty array literal: `field: []`
|
|
1293
1323
|
if (ts.isPropertyAssignment(prop) &&
|
|
1294
1324
|
ts.isArrayLiteralExpression(prop.initializer) &&
|