@lark.js/mvc 0.0.8 → 0.0.10

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/webpack.cjs CHANGED
@@ -14861,7 +14861,7 @@ function convertArtExpression(code, debug, lineNo, blockStack = []) {
14861
14861
  const object = tokens[0];
14862
14862
  if (tokens.length > 1 && tokens[1] !== "as") {
14863
14863
  throw new Error(
14864
- `[@lark.js/mvc error] bad forIn syntax: {{${code}}}. Expected "as" keyword, got "${tokens[1]}". Usage: {{for-in obj as val [key]}}`
14864
+ `[@lark.js/mvc error] bad forIn syntax: {{${code}}}. Expected "as" keyword, got "${tokens[1]}". Usage: {{forIn obj as val [key]}}`
14865
14865
  );
14866
14866
  }
14867
14867
  const restTokens2 = tokens.slice(2);
@@ -15098,7 +15098,8 @@ function extractGlobalVars(source) {
15098
15098
  } catch {
15099
15099
  return fallbackExtractVariables(source);
15100
15100
  }
15101
- const globalExists = { ...BUILTIN_GLOBALS };
15101
+ const globalExists = {};
15102
+ for (const name of BUILTIN_GLOBALS) globalExists[name] = 1;
15102
15103
  const globalVars = /* @__PURE__ */ Object.create(null);
15103
15104
  const fnRange = [];
15104
15105
  walkAst(ast, {
@@ -15172,7 +15173,7 @@ function fallbackExtractVariables(source) {
15172
15173
  while ((m = ifRegExp.exec(source)) !== null) {
15173
15174
  vars.add(m[1]);
15174
15175
  }
15175
- return Array.from(vars).filter((v) => !BUILTIN_GLOBAL_SET.has(v));
15176
+ return Array.from(vars).filter((v) => !BUILTIN_GLOBALS.has(v));
15176
15177
  }
15177
15178
  function walkAst(ast, visitors) {
15178
15179
  function visit(node) {
@@ -15211,7 +15212,7 @@ function walkAst(ast, visitors) {
15211
15212
  function isAstNode(v) {
15212
15213
  return !!v && typeof v === "object" && typeof v.type === "string";
15213
15214
  }
15214
- var BUILTIN_GLOBALS = {
15215
+ var BUILTIN_GLOBALS = /* @__PURE__ */ new Set([
15215
15216
  // ─── Template runtime helpers (injected by compileToFunction) ───────
15216
15217
  //
15217
15218
  // These variables appear in the generated template function signature
@@ -15220,147 +15221,146 @@ var BUILTIN_GLOBALS = {
15220
15221
  // SPLITTER character constant (same as \x1e), used as namespace separator
15221
15222
  // for refData keys, event attribute encoding, and internal data structures.
15222
15223
  // Declared as: let $splitter='\x1e'
15223
- $splitter: 1,
15224
+ "$splitter",
15224
15225
  // Data — the data object passed from Updater to the template function.
15225
15226
  // User variables are destructured from $data at the top of the function:
15226
15227
  // let {name, age} = $data;
15227
15228
  // This is the first parameter of the generated arrow function.
15228
- $data: 1,
15229
+ "$data",
15229
15230
  // Null-safe toString: v => '' + (v == null ? '' : v)
15230
15231
  // Converts null/undefined to empty string, otherwise calls toString().
15231
15232
  // Wraps every {{!raw}} output to prevent "null" / "undefined" rendering.
15232
- $strSafe: 1,
15233
+ "$strSafe",
15233
15234
  // HTML entity encoder: v => $strSafe(v).replace(/[&<>"'`]/g, entityMap)
15234
15235
  // Encodes &, <, >, ", ', ` to HTML entities (&amp; &lt; etc.)
15235
15236
  // Applied to all {{=escaped}} and {{:binding}} outputs.
15236
- $encHtml: 1,
15237
+ "$encHtml",
15237
15238
  // HTML entity map — internal object used by $encHtml:
15238
15239
  // {'&':'amp','<':'gt','>':'gt','"':'#34','\'':'#39','`':'#96'}
15239
15240
  // Not a standalone function; referenced inside $encHtml's closure.
15240
- $entMap: 1,
15241
+ "$entMap",
15241
15242
  // HTML entity RegExp — internal regexp used by $encHtml:
15242
15243
  // /[&<>"'`]/g
15243
- $entReg: 1,
15244
+ "$entReg",
15244
15245
  // HTML entity replacer function — internal helper used by $encHtml:
15245
15246
  // m => '&' + $entMap[m] + ';'
15246
15247
  // Maps matched character to its entity string.
15247
- $entFn: 1,
15248
+ "$entFn",
15248
15249
  // Output buffer — the string accumulator for rendered HTML.
15249
15250
  // All template output is appended via $out += '...'.
15250
15251
  // Declared as: let $out = ''
15251
- $out: 1,
15252
+ "$out",
15252
15253
  // Reference lookup: (refData, value) => key
15253
15254
  // Finds or allocates a SPLITTER-prefixed key in refData for a given
15254
15255
  // object reference. Used by {{@ref}} operator for passing object
15255
15256
  // references to child views via v-lark attributes.
15256
- $refFn: 1,
15257
+ "$refFn",
15257
15258
  // URI encoder: v => encodeURIComponent($strSafe(v)).replace(/[!')(*]/g, extraMap)
15258
15259
  // Extends encodeURIComponent with encoding of ! ' ( ) *.
15259
15260
  // Applied to values in @event URL parameters and {{!uri}} contexts.
15260
- $encUri: 1,
15261
+ "$encUri",
15261
15262
  // URI encode map — internal object used by $encUri:
15262
15263
  // {'!':'%21','\'':'%27','(':'%28',')':'%29','*':'%2A'}
15263
- $uriMap: 1,
15264
+ "$uriMap",
15264
15265
  // URI encode replacer — internal helper used by $encUri:
15265
15266
  // m => $uriMap[m]
15266
- $uriFn: 1,
15267
+ "$uriFn",
15267
15268
  // URI encode regexp — internal regexp used by $encUri:
15268
15269
  // /[!')(*]/g
15269
- $uriReg: 1,
15270
+ "$uriReg",
15270
15271
  // Quote encoder: v => $strSafe(v).replace(/['"\\]/g, '\\$&')
15271
15272
  // Escapes quotes and backslashes for safe embedding in HTML attribute
15272
15273
  // values (e.g. data-json='...').
15273
- $encQuote: 1,
15274
+ "$encQuote",
15274
15275
  // Quote encode regexp — internal regexp used by $encQuote:
15275
15276
  // /['"\\]/g
15276
- $qReg: 1,
15277
+ "$qReg",
15277
15278
  // View ID — the unique identifier of the owning View instance.
15278
15279
  // Injected into @event attribute values at render time so that
15279
15280
  // EventDelegator can dispatch events to the correct View handler.
15280
15281
  // The \x1f placeholder in compiled output is replaced with '+$viewId+'.
15281
- $viewId: 1,
15282
+ "$viewId",
15282
15283
  // Debug: current expression text — stores the template expression being
15283
15284
  // evaluated, for error reporting. Only present in debug mode.
15284
15285
  // e.g. $dbgExpr='<%=user.name%>'
15285
- $dbgExpr: 1,
15286
+ "$dbgExpr",
15286
15287
  // Debug: original art syntax — stores the {{}} template syntax before
15287
15288
  // conversion, for error reporting. Only present in debug mode.
15288
15289
  // e.g. $dbgArt='{{=user.name}}'
15289
- $dbgArt: 1,
15290
+ "$dbgArt",
15290
15291
  // Debug: source line number — tracks the current line in the template
15291
15292
  // source, for error reporting. Only present in debug mode.
15292
- $dbgLine: 1,
15293
+ "$dbgLine",
15293
15294
  // RefData alias — fallback reference lookup table.
15294
15295
  // Defaults to $data when no explicit $refAlt is provided.
15295
15296
  // Ensures $refFn() does not crash when @ operator is used without refData.
15296
- $refAlt: 1,
15297
+ "$refAlt",
15297
15298
  // Temporary variable — used by the compiler for intermediate
15298
15299
  // expression results in generated code (e.g. loop variables,
15299
15300
  // conditional branches). Declared as: let $tmp
15300
- $tmp: 1,
15301
+ "$tmp",
15301
15302
  // JS literals
15302
- undefined: 1,
15303
- null: 1,
15304
- true: 1,
15305
- false: 1,
15306
- NaN: 1,
15307
- Infinity: 1,
15303
+ "undefined",
15304
+ "null",
15305
+ "true",
15306
+ "false",
15307
+ "NaN",
15308
+ "Infinity",
15308
15309
  // JS built-in globals
15309
- window: 1,
15310
- self: 1,
15311
- globalThis: 1,
15312
- document: 1,
15313
- console: 1,
15314
- JSON: 1,
15315
- Math: 1,
15316
- Intl: 1,
15317
- Promise: 1,
15318
- Symbol: 1,
15319
- Number: 1,
15320
- String: 1,
15321
- Boolean: 1,
15322
- Array: 1,
15323
- Object: 1,
15324
- Date: 1,
15325
- RegExp: 1,
15326
- Error: 1,
15327
- TypeError: 1,
15328
- RangeError: 1,
15329
- SyntaxError: 1,
15330
- Map: 1,
15331
- Set: 1,
15332
- WeakMap: 1,
15333
- WeakSet: 1,
15334
- Proxy: 1,
15335
- Reflect: 1,
15336
- ArrayBuffer: 1,
15337
- DataView: 1,
15338
- Float32Array: 1,
15339
- Float64Array: 1,
15340
- Int8Array: 1,
15341
- Int16Array: 1,
15342
- Int32Array: 1,
15343
- Uint8Array: 1,
15344
- Uint16Array: 1,
15345
- Uint32Array: 1,
15346
- Uint8ClampedArray: 1,
15310
+ "window",
15311
+ "self",
15312
+ "globalThis",
15313
+ "document",
15314
+ "console",
15315
+ "JSON",
15316
+ "Math",
15317
+ "Intl",
15318
+ "Promise",
15319
+ "Symbol",
15320
+ "Number",
15321
+ "String",
15322
+ "Boolean",
15323
+ "Array",
15324
+ "Object",
15325
+ "Date",
15326
+ "RegExp",
15327
+ "Error",
15328
+ "TypeError",
15329
+ "RangeError",
15330
+ "SyntaxError",
15331
+ "Map",
15332
+ "Set",
15333
+ "WeakMap",
15334
+ "WeakSet",
15335
+ "Proxy",
15336
+ "Reflect",
15337
+ "ArrayBuffer",
15338
+ "DataView",
15339
+ "Float32Array",
15340
+ "Float64Array",
15341
+ "Int8Array",
15342
+ "Int16Array",
15343
+ "Int32Array",
15344
+ "Uint8Array",
15345
+ "Uint16Array",
15346
+ "Uint32Array",
15347
+ "Uint8ClampedArray",
15347
15348
  // Functions
15348
- parseInt: 1,
15349
- parseFloat: 1,
15350
- isNaN: 1,
15351
- isFinite: 1,
15352
- encodeURIComponent: 1,
15353
- decodeURIComponent: 1,
15354
- encodeURI: 1,
15355
- decodeURI: 1,
15349
+ "parseInt",
15350
+ "parseFloat",
15351
+ "isNaN",
15352
+ "isFinite",
15353
+ "encodeURIComponent",
15354
+ "decodeURIComponent",
15355
+ "encodeURI",
15356
+ "decodeURI",
15356
15357
  // Babel helpers
15357
- arguments: 1,
15358
- this: 1,
15359
- require: 1,
15358
+ "arguments",
15359
+ "this",
15360
+ "require",
15360
15361
  // Lark framework
15361
- Lark: 1
15362
- };
15363
- var BUILTIN_GLOBAL_SET = new Set(Object.keys(BUILTIN_GLOBALS));
15362
+ "Lark"
15363
+ ]);
15364
15364
 
15365
15365
  // src/webpack.ts
15366
15366
  function larkMvcLoader(source) {
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  compileTemplate,
3
3
  extractGlobalVars
4
- } from "./chunk-3HSA7OHB.js";
4
+ } from "./chunk-SIQF4YLC.js";
5
5
 
6
6
  // src/webpack.ts
7
7
  function larkMvcLoader(source) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark.js/mvc",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "@lark.js/mvc - TypeScript MVC framework",
5
5
  "keywords": [
6
6
  "framework",
@@ -90,14 +90,14 @@
90
90
  "@rollup/plugin-commonjs": "^29.0.3",
91
91
  "@rollup/plugin-node-resolve": "^16.0.3",
92
92
  "@rollup/plugin-typescript": "^12.3.0",
93
- "@types/node": "^24.13.1",
93
+ "@types/node": "^24.13.2",
94
94
  "@vitest/coverage-v8": "4.1.6",
95
- "rollup": "^4.61.1",
95
+ "rollup": "^4.62.0",
96
96
  "rollup-plugin-dts": "^6.4.1",
97
97
  "tsup": "^8.5.1",
98
98
  "typescript": "^5.9.3",
99
99
  "vite": "^8.0.16",
100
- "vitest": "^4.1.8"
100
+ "vitest": "^4.1.9"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "vite": "^8.0.14"
package/src/client.d.ts CHANGED
@@ -50,9 +50,9 @@ declare global {
50
50
  }
51
51
 
52
52
  interface Element {
53
- /** VDOM diff cached compare key flag */
53
+ /** DOM diff cached compare key flag */
54
54
  compareKeyCached?: number | undefined;
55
- /** VDOM diff cached compare key */
55
+ /** DOM diff cached compare key */
56
56
  cachedCompareKey?: string | undefined;
57
57
  "v-lark"?: string | undefined;
58
58