Skip to content

Commit fb6131f

Browse files
committed
fix(compiler): skip type-only signal imports in nativeReadOptions
Type-only imports (import type { ... } and import { type ... }) from octane/signals modules were incorrectly enabling native read mode in nativeReadOptions. This caused native memoization, read-scope wrapping, and return-JSX compilation for modules with no runtime signal use, breaking non-DOM renderers. Add importKind checks consistent with analyzeNativeReadDiagnostics: - Skip declarations where importKind is 'type' - Require at least one non-type specifier
1 parent 0dcc53c commit fb6131f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/octane/src/compiler/native-read-diagnostics.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export function nativeReadOptions(ast, options) {
7979
if (
8080
((node.type === 'Identifier' || node.type === 'JSXIdentifier') && node.name.endsWith('$')) ||
8181
(node.type === 'ImportDeclaration' &&
82-
(node.source?.value === SIGNALS_MODULE || LOCAL_MODULES.has(node.source?.value))) ||
82+
node.importKind !== 'type' &&
83+
(node.source?.value === SIGNALS_MODULE || LOCAL_MODULES.has(node.source?.value)) &&
84+
(node.specifiers ?? []).some((s) => s.importKind !== 'type')) ||
8385
((node.type === 'MemberExpression' || node.type === 'OptionalMemberExpression') &&
8486
String(propertyName(node.property, node.computed) ?? '').endsWith('$')) ||
8587
(node.type === 'Property' &&

0 commit comments

Comments
 (0)