@sprlab/wccompiler 0.5.2 → 0.5.3

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 +9 -2
  2. package/package.json +1 -1
package/lib/codegen.js CHANGED
@@ -761,9 +761,16 @@ export function generateComponent(parseResult, options = {}) {
761
761
  lines.push(` this.${b.varName}.textContent = this._c_${b.name}() ?? '';`);
762
762
  lines.push(' }));');
763
763
  } else {
764
- // method type — call the method
764
+ // method type — check if it's a props.x access pattern
765
+ let ref;
766
+ if (propsObjectName && b.name.startsWith(propsObjectName + '.')) {
767
+ const propName = b.name.slice(propsObjectName.length + 1);
768
+ ref = `this._s_${propName}()`;
769
+ } else {
770
+ ref = `this._${b.name}()`;
771
+ }
765
772
  lines.push(' this.__disposers.push(__effect(() => {');
766
- lines.push(` this.${b.varName}.textContent = this._${b.name}() ?? '';`);
773
+ lines.push(` this.${b.varName}.textContent = ${ref} ?? '';`);
767
774
  lines.push(' }));');
768
775
  }
769
776
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprlab/wccompiler",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
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
  "bin": {