Skip to content

Commit 502c867

Browse files
committed
fix(compiler): use original imported name for dollar-hook signal site check in .tsrx
When a dollar-suffixed custom hook is aliased (e.g. `import { useUser$ as useUser }`), the .tsrx compilation path in compile.js was passing the local alias to customHookSignalSite instead of the original imported name. This caused the `name.endsWith('$')` check to fail, preventing h: site emission and collapsing distinct call sites onto one instance cell. The slot-hooks.js (plain .ts) path correctly used `node._octaneCustomHookCall` which carries the original imported name. Apply the same approach in compile.js by reading `n._octaneCustomHookCall` (stamped during annotation) with a fallback to localName for non-imported hooks.
1 parent 05aa67c commit 502c867

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/octane/src/compiler/compile.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20181,7 +20181,7 @@ function rewriteHookCalls(node, ctx, componentName, localRoot = false) {
2018120181
},
2018220182
forceSymbol,
2018320183
null,
20184-
isCustom ? customHookSignalSite(ctx, n, localName) : null,
20184+
isCustom ? customHookSignalSite(ctx, n, n._octaneCustomHookCall ?? localName) : null,
2018520185
);
2018620186
slot = symVar;
2018720187
}

0 commit comments

Comments
 (0)