sinwan-compiler 0.2.9 → 0.2.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.
@@ -660,6 +660,10 @@ function createBindingDescriptor(expr, exprPath, options) {
660
660
  }
661
661
  const parent = exprPath.parentPath;
662
662
  if (parent && parent.isJSXAttribute && parent.isJSXAttribute()) {
663
+ const compInfo = getComponentExpressionInfo(exprPath);
664
+ if (compInfo.isComponent) {
665
+ return wrapExpression(expr);
666
+ }
663
667
  const attrName = parent.node.name.name;
664
668
  if (attrName === "style") {
665
669
  return t.callExpression(t.identifier("_$bindStyle"), [
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  runAnalyzeCli2,
5
5
  runCliIfMain2
6
- } from "./chunk-6dnsvgyf.js";
6
+ } from "./chunk-qj8m16x2.js";
7
7
  export {
8
8
  runAnalyzeCli2 as runAnalyzeCli,
9
9
  runCliIfMain2 as runCliIfMain
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  propagateReactiveProps2,
18
18
  wrapReactiveExpressions2,
19
19
  runAnalyzeCli2
20
- } from "./chunk-6dnsvgyf.js";
20
+ } from "./chunk-qj8m16x2.js";
21
21
 
22
22
  // src/transform.ts
23
23
  import { parse } from "@babel/parser";
package/docs/transform.md CHANGED
@@ -90,7 +90,7 @@ Not wrapped:
90
90
  **User components** (`<Label>`, `<Child title={…} />`):
91
91
 
92
92
  - **Children:** wrap reactive reads the same way as DOM text (`{count.value}`, `{checked.value ? "On" : "Off"}`) so `cc()` parents do not snapshot the value. Use a getter (`() => …`), never `_$bindText`, because the child may render nodes as well as strings. Render-prop functions (`{(v) => …}`) stay untouched.
93
- - **Props:** wrap a prop if it is known-reactive for that component (built-in registry, local call graph, analyzer metadata). For *unknown* imported components, still wrap **derived reads** (`htmlFor={id.value}`, `disabled={off.value}`) and leave **container pass-through** alone (`checked={checked}`, `user={user}`) so the child receives the signal or store proxy.
93
+ - **Props:** wrap a prop if it is known-reactive for that component (built-in registry, local call graph, analyzer metadata). For *unknown* imported components, still wrap **derived reads** (`htmlFor={id.value}`, `disabled={off.value}`) and leave **container pass-through** alone (`checked={checked}`, `user={user}`) so the child receives the signal or store proxy. With `explicitBindings`, component props stay **getters** (`each={() => …}`), never `_$bindAttr` — `For` / `Show` / `Label` call `resolve(prop)`, which does not unwrap bind descriptors.
94
94
 
95
95
  **Built-in control-flow** components wrap specific props, and they wrap reactive expression children (those children render directly):
96
96
 
@@ -141,6 +141,6 @@ transformJSX(code, "src/App.tsx", {
141
141
 
142
142
  - **`analyze` / `analyzeMetadata`** — cross-file reactive props. Invalid JSON is ignored (transform still succeeds).
143
143
  - **`resolveImport`** — maps `./Child` to an absolute file so imported components can use analyzer metadata. Without it, imported call sites are not wrapped at the parent.
144
- - **`explicitBindings`** — wrap with `_$bindText` / `_$bindAttr` / `_$bindStyle` / `_$bindClass` from `sinwan/renderer` instead of a bare `() => …`.
144
+ - **`explicitBindings`** — wrap **native** text/attrs with `_$bindText` / `_$bindAttr` / `_$bindStyle` / `_$bindClass`. Component props and component children stay `() => …` so `resolve(prop)` still sees a getter.
145
145
 
146
146
  Returns `{ code, map }` with a source map.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinwan-compiler",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Shared compiler core for Sinwan plugins",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",