@sprlab/wccompiler 0.14.0 → 0.15.0

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.
Files changed (2) hide show
  1. package/lib/codegen.js +5 -1
  2. package/package.json +1 -1
package/lib/codegen.js CHANGED
@@ -1314,8 +1314,12 @@ export function generateComponent(parseResult, options = {}) {
1314
1314
  const propName = b.name.slice(propsObjectName.length + 1);
1315
1315
  ref = `this._s_${propName}()`;
1316
1316
  } else {
1317
+ // For method calls, ensure we have parentheses before transforming
1318
+ // b.name might be 'getCount' (from {{getCount()}} where baseName stripped the ())
1319
+ // We need to add () back so transformExpr can match and transform it
1320
+ const exprWithParens = b.name.includes('(') ? b.name : `${b.name}()`;
1317
1321
  // Use transformExpr for complex expressions (e.g. items().length, ternary)
1318
- ref = transformExpr(b.name, signalNames, computedNames, propsObjectName, propNames, emitsObjectName, constantNames, methodNames, modelVarMap);
1322
+ ref = transformExpr(exprWithParens, signalNames, computedNames, propsObjectName, propNames, emitsObjectName, constantNames, methodNames, modelVarMap);
1319
1323
  }
1320
1324
  lines.push(' this.__disposers.push(__effect(() => {');
1321
1325
  lines.push(` this.${b.varName}.textContent = ${ref} ?? '';`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprlab/wccompiler",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Zero-runtime compiler that transforms .wcc single-file components into native web components with signals-based reactivity",
5
5
  "type": "module",
6
6
  "exports": {