what-compiler 0.10.0 → 0.11.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.
- package/dist/babel-plugin.js +243 -57
- package/dist/babel-plugin.js.map +2 -2
- package/dist/babel-plugin.min.js +1 -1
- package/dist/babel-plugin.min.js.map +3 -3
- package/dist/index.js +259 -59
- package/dist/index.js.map +2 -2
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +3 -3
- package/dist/vite-plugin.js +259 -59
- package/dist/vite-plugin.js.map +2 -2
- package/dist/vite-plugin.min.js +6 -6
- package/dist/vite-plugin.min.js.map +3 -3
- package/package.json +2 -2
- package/src/babel-plugin.js +433 -89
- package/src/vite-plugin.js +32 -1
package/dist/vite-plugin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/vite-plugin.js", "../src/babel-plugin.js", "../src/file-router.js", "../src/error-overlay.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * What Framework Vite Plugin\n *\n * 1. Transforms JSX via the What babel plugin\n * 2. Provides file-based routing via virtual:what-routes\n * 3. Watches pages directory for route changes\n * 4. HMR support: component files get granular hot-module replacement,\n * signal/utility files trigger full reload\n */\n\nimport path from 'path';\nimport { transformSync } from '@babel/core';\nimport whatBabelPlugin from './babel-plugin.js';\nimport { generateRoutesModule, scanPages } from './file-router.js';\nimport { setupErrorOverlay } from './error-overlay.js';\n\nconst VIRTUAL_ROUTES_ID = 'virtual:what-routes';\nconst RESOLVED_VIRTUAL_ID = '\\0' + VIRTUAL_ROUTES_ID;\n\n// Pattern: exported function starting with uppercase = component\nconst COMPONENT_EXPORT_RE = /export\\s+(?:default\\s+)?function\\s+([A-Z]\\w*)/;\n// Pattern: files that are likely signal/store/utility files\nconst UTILITY_FILE_RE = /(?:store|signal|state|context|util|helper|lib|config)\\b/i;\n\nexport default function whatVitePlugin(options = {}) {\n const {\n // File extensions to process\n include = /\\.[jt]sx$/,\n // Files to exclude\n exclude = /node_modules/,\n // Enable source maps\n sourceMaps = true,\n // Production optimizations\n production = process.env.NODE_ENV === 'production',\n // Pages directory (relative to project root)\n pages = 'src/pages',\n // HMR: enabled by default in dev, disabled in production\n hot = !production,\n } = options;\n\n let rootDir = '';\n let pagesDir = '';\n let server = null;\n let isDevMode = false;\n\n return {\n name: 'vite-plugin-what',\n\n configResolved(config) {\n rootDir = config.root;\n pagesDir = path.resolve(rootDir, pages);\n isDevMode = config.command === 'serve';\n },\n\n configureServer(devServer) {\n server = devServer;\n\n // Set up What-branded error overlay\n setupErrorOverlay(devServer);\n\n // Watch the pages directory for file additions/removals\n devServer.watcher.on('add', (file) => {\n if (file.startsWith(pagesDir)) {\n // Invalidate the virtual routes module\n const mod = devServer.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);\n if (mod) {\n devServer.moduleGraph.invalidateModule(mod);\n devServer.ws.send({ type: 'full-reload' });\n }\n }\n });\n\n devServer.watcher.on('unlink', (file) => {\n if (file.startsWith(pagesDir)) {\n const mod = devServer.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);\n if (mod) {\n devServer.moduleGraph.invalidateModule(mod);\n devServer.ws.send({ type: 'full-reload' });\n }\n }\n });\n },\n\n // Resolve virtual module\n resolveId(id) {\n if (id === VIRTUAL_ROUTES_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n },\n\n // Generate the routes module\n load(id) {\n if (id === RESOLVED_VIRTUAL_ID) {\n return generateRoutesModule(pagesDir, rootDir);\n }\n },\n\n // Transform JSX files\n transform(code, id) {\n // Check if we should process this file\n if (!include.test(id)) return null;\n if (exclude && exclude.test(id)) return null;\n\n try {\n const result = transformSync(code, {\n filename: id,\n sourceMaps,\n plugins: [\n [whatBabelPlugin, { production }]\n ],\n parserOpts: {\n plugins: ['jsx', 'typescript']\n }\n });\n\n if (!result || !result.code) {\n return null;\n }\n\n let outputCode = result.code;\n\n // HMR: append hot boundary code for component files in dev mode\n if (hot && isDevMode && !production) {\n const isComponentFile = isComponentModule(code, id);\n\n if (isComponentFile) {\n outputCode += generateHMRBoundary(id);\n }\n }\n\n return {\n code: outputCode,\n map: result.map\n };\n } catch (error) {\n // Enrich Babel errors with file context for the error overlay\n error.plugin = 'vite-plugin-what';\n if (!error.id) error.id = id;\n if (error.loc === undefined && error._loc) {\n error.loc = { file: id, line: error._loc.line, column: error._loc.column };\n }\n console.error(`[what] Error transforming ${id}:`, error.message);\n throw error;\n }\n },\n\n // HMR: detect component vs utility files and handle accordingly\n handleHotUpdate({ file, server: devServer, modules }) {\n if (!hot) return;\n\n // Only handle files we process\n if (!include.test(file)) return;\n if (exclude && exclude.test(file)) return;\n\n // Utility/signal/store files: trigger full reload\n // These files may export signals used across multiple components\n if (isUtilityFile(file)) {\n devServer.ws.send({ type: 'full-reload' });\n return [];\n }\n\n // Component files: let Vite handle HMR normally (our boundary code handles it)\n // Return undefined to let Vite's default HMR proceed\n return;\n },\n\n // Configure for development\n config(config, { mode }) {\n return {\n esbuild: {\n // Preserve JSX so our babel plugin handles it -- don't let esbuild transform it\n jsx: 'preserve',\n },\n optimizeDeps: {\n // Exclude framework packages from Vite's dependency pre-bundling.\n //\n // Bug class this prevents \u2014 \"dual module instance\":\n // The compiler emits `import { ... } from 'what-framework/render'`\n // (a subpath resolved to the source file). Meanwhile user code\n // imports `'what-framework'` (the package entry). If Vite\n // pre-bundles `'what-framework'` into an esbuild chunk under\n // node_modules/.vite, those two import paths resolve to two\n // *different* module instances. Module-scoped state \u2014 the\n // `componentStack` used by createComponent, effect ownership,\n // the signal subscriber registry \u2014 is duplicated, so a signal\n // created in user code never notifies effects created via the\n // compiler-emitted path, and `getCurrentComponent()` returns\n // undefined inside components mounted through compiler output.\n //\n // Why `exclude` is the right knob:\n // `include` would force pre-bundling of the package entry, which\n // does not resolve the subpath import the compiler emits \u2014 so the\n // split persists. Using `exclude` tells Vite to skip the optimizer\n // for these packages and serve them via the normal module graph,\n // where both the package entry and the `/render` subpath share\n // a single ESM module record.\n //\n // Regression symptom if this is removed:\n // Components mount but lifecycle hooks (onMount, onCleanup) and\n // shared store state silently no-op; effects don't re-run on\n // signal writes from user code; SSR/CSR hydration mismatches.\n exclude: ['what-framework', 'what-core', 'what-compiler', 'what-router'],\n }\n };\n }\n };\n}\n\n/**\n * Check if a file likely contains a component (has exported function starting with uppercase)\n */\nfunction isComponentModule(source, filePath) {\n // .jsx/.tsx files with component exports\n if (COMPONENT_EXPORT_RE.test(source)) return true;\n // Pages are always component files\n if (filePath.includes('/pages/') || filePath.includes('\\\\pages\\\\')) return true;\n return false;\n}\n\n/**\n * Check if a file is a utility/signal/store file (should trigger full reload)\n */\nfunction isUtilityFile(filePath) {\n const basename = path.basename(filePath, path.extname(filePath));\n return UTILITY_FILE_RE.test(basename);\n}\n\n/**\n * Generate HMR boundary code for a component file.\n * When the module is updated, Vite's HMR runtime calls import.meta.hot.accept(),\n * which re-runs the module. The component re-renders in place.\n */\nfunction generateHMRBoundary(filePath) {\n return `\n\n// --- What Framework HMR Boundary ---\nif (import.meta.hot) {\n import.meta.hot.accept((newModule) => {\n if (newModule) {\n // Signal to the What runtime that this module was hot-updated\n if (window.__WHAT_HMR_ACCEPT__) {\n window.__WHAT_HMR_ACCEPT__(${JSON.stringify(filePath)}, newModule);\n }\n }\n });\n}\n`;\n}\n\n// Named export for compatibility\nexport { whatVitePlugin as what };\n", "/**\n * What Framework Babel Plugin \u2014 Fine-Grained Only\n *\n * JSX \u2192 template() + insert() + effect() calls\n * Static HTML extracted to module-level templates, dynamic expressions wrapped in effects.\n * Components run ONCE. All reactivity is signal-driven.\n *\n * Output:\n * const _tmpl$1 = template('<div class=\"container\"><h1>Title</h1><p></p></div>');\n * function App() {\n * const _el$ = _tmpl$1();\n * insert(_el$.childNodes[1], () => desc());\n * return _el$;\n * }\n *\n * Template calls are hoisted to module scope \u2014 each unique HTML string gets one\n * top-level const. Component functions just clone: `const _el$ = _tmpl$1()`.\n */\n\nconst EVENT_MODIFIERS = new Set(['preventDefault', 'stopPropagation', 'once', 'capture', 'passive', 'self']);\nconst EVENT_OPTION_MODIFIERS = new Set(['once', 'capture', 'passive']);\nconst VOID_HTML_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr'\n]);\n\n// Events that use document-level delegation for performance.\n// The compiler emits `el.$$click = handler` instead of addEventListener.\n// A one-time document listener walks event.target upward to find the handler.\nconst DELEGATED_EVENTS = new Set([\n 'click', 'input', 'change', 'keydown', 'keyup', 'submit',\n 'focusin', 'focusout', 'mousedown', 'mouseup',\n]);\n\n// Known non-reactive call expressions \u2014 these should NOT be wrapped in effects\n// unless their arguments contain signal reads.\nconst SAFE_GLOBAL_CALLS = new Set([\n 'Math', 'Number', 'String', 'Boolean', 'parseInt', 'parseFloat',\n 'isNaN', 'isFinite', 'encodeURIComponent', 'decodeURIComponent',\n 'encodeURI', 'decodeURI', 'JSON', 'Date', 'Array', 'Object',\n 'console', 'RegExp',\n]);\n\n// Known signal-creating functions\nconst SIGNAL_CREATORS = new Set([\n 'useSignal', 'signal', 'computed', 'useComputed', 'useState', 'useReducer',\n 'createResource', 'useSWR', 'useQuery', 'useInfiniteQuery',\n]);\n\n// Normalize JSX text per React/Babel rules:\n// - Split on newlines, treat tabs as spaces.\n// - For interior lines: trim leading and trailing horizontal whitespace.\n// - For the first line: only trim trailing whitespace.\n// - For the last line: only trim leading whitespace.\n// - Skip lines that are entirely whitespace (don't add a separator space).\n// - Join the remaining non-empty lines with single spaces.\n//\n// This preserves leading/trailing single-line whitespace that sits next to\n// an expression like `{count} items` \u2014 without this, the space is eaten and\n// the rendered output reads `5items`.\nfunction normalizeJsxText(value) {\n // Single-line text (no newlines): preserve the original (just tabs->spaces).\n // This keeps the space in cases like `{a} {b}` where the JSXText is \" \".\n if (!/[\\r\\n]/.test(value)) {\n return value.replace(/\\t/g, ' ');\n }\n const lines = value.split(/\\r\\n|\\n|\\r/);\n let lastNonEmpty = -1;\n for (let i = 0; i < lines.length; i++) {\n if (/[^ \\t]/.test(lines[i])) lastNonEmpty = i;\n }\n if (lastNonEmpty === -1) return '';\n let out = '';\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i].replace(/\\t/g, ' ');\n const isFirst = i === 0;\n const isLast = i === lines.length - 1;\n if (!isFirst) line = line.replace(/^ +/, '');\n if (!isLast) line = line.replace(/ +$/, '');\n if (!line) continue;\n if (i !== lastNonEmpty) line += ' ';\n out += line;\n }\n return out;\n}\n\nexport default function whatBabelPlugin({ types: t }) {\n // =====================================================\n // Shared utilities\n // =====================================================\n\n // Warn-once tracking for unknown event modifier segments. Keyed by\n // `${filename}::${segment}` so each typo is reported at most once per file\n // per compile process. Without the filename in the key, the same typo in\n // two different files would silently warn for the first file only \u2014\n // problematic in long-running Vite dev servers.\n const _unknownModifierWarned = new Set();\n const _forInfoWarned = new Set();\n\n function hasEventModifiers(name, state) {\n // Any `__` in an `on*` attribute is intended as modifier syntax \u2014 even\n // if every segment is unknown. Returning false there would emit the\n // attribute as a plain delegated-event property (e.g.\n // `el.$$onclick__totalyWrong = handler`), which never fires. Instead,\n // always route through the modifier-handling branch so the parser can\n // warn about the typo and drop the unknown segments.\n if (!name.includes('__')) return false;\n if (!name.startsWith('on')) return false;\n const parts = name.split('__');\n const tail = parts.slice(1).filter(s => s !== '');\n if (tail.length === 0) return false;\n if (process.env.NODE_ENV !== 'production') {\n const unknown = tail.filter(m => !EVENT_MODIFIERS.has(m));\n const filename = (state && (state.filename || (state.file && state.file.opts && state.file.opts.filename))) || '<unknown>';\n for (const m of unknown) {\n const key = `${filename}::${m}`;\n if (!_unknownModifierWarned.has(key)) {\n _unknownModifierWarned.add(key);\n console.warn(\n `[what-compiler] Unknown event modifier \"__${m}\" in attribute \"${name}\" (${filename}). ` +\n `Known modifiers: ${[...EVENT_MODIFIERS].join(', ')}. ` +\n `Unknown segments are ignored.`\n );\n }\n }\n }\n return true;\n }\n\n function parseEventModifiers(name) {\n // Support both '|' (template strings) and '__' (JSX-safe) as modifier delimiters\n const delimiter = name.includes('|') ? '|' : '__';\n const parts = name.split(delimiter);\n const eventName = parts[0];\n const modifiers = parts.slice(1).filter(m => EVENT_MODIFIERS.has(m));\n return { eventName, modifiers };\n }\n\n function isBindingAttribute(name) {\n return name.startsWith('bind:');\n }\n\n function getBindingProperty(name) {\n return name.slice(5);\n }\n\n function isComponent(name) {\n return /^[A-Z]/.test(name);\n }\n\n function isVoidHtmlElement(name) {\n return VOID_HTML_ELEMENTS.has(String(name).toLowerCase());\n }\n\n function getAttributeValue(value) {\n if (!value) return t.booleanLiteral(true);\n if (t.isJSXExpressionContainer(value)) return value.expression;\n if (t.isStringLiteral(value)) return value;\n return t.stringLiteral(value.value || '');\n }\n\n function normalizeAttrName(attrName) {\n if (attrName === 'className') return 'class';\n if (attrName === 'htmlFor') return 'for';\n return attrName;\n }\n\n // Safely extract attribute name, handling JSXNamespacedName (e.g., client:idle, bind:value)\n function getAttrName(attr) {\n if (t.isJSXNamespacedName(attr.name)) {\n return `${attr.name.namespace.name}:${attr.name.name.name}`;\n }\n return typeof attr.name.name === 'string' ? attr.name.name : String(attr.name.name);\n }\n\n function createEventHandler(handler, modifiers) {\n if (modifiers.length === 0) return handler;\n\n let wrappedHandler = handler;\n\n for (const mod of modifiers) {\n switch (mod) {\n case 'preventDefault':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier('e'), t.identifier('preventDefault')),\n []\n )\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n ])\n );\n break;\n\n case 'stopPropagation':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier('e'), t.identifier('stopPropagation')),\n []\n )\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n ])\n );\n break;\n\n case 'self':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.ifStatement(\n t.binaryExpression(\n '===',\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.memberExpression(t.identifier('e'), t.identifier('currentTarget'))\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n )\n ])\n );\n break;\n\n case 'once':\n case 'capture':\n case 'passive':\n break;\n }\n }\n\n return wrappedHandler;\n }\n\n // =====================================================\n // Reactivity Detection \u2014 Signal-Aware\n // =====================================================\n\n // Check if an identifier is known to be a signal (from useSignal/signal/computed/useState)\n function isSignalIdentifier(name, signalNames) {\n return signalNames.has(name);\n }\n\n // Collect signal identifiers using Babel's scope analysis.\n // Walks the scope chain from the given path upward, collecting signals\n // defined in each lexical scope (function/block).\n function collectSignalNamesFromScope(path) {\n const signalNames = new Set();\n\n // Helper: extract signal names from a VariableDeclarator node\n function extractFromDeclarator(decl) {\n const init = decl.init;\n if (!init || !t.isCallExpression(init)) return;\n\n const callee = init.callee;\n let calleeName = '';\n if (t.isIdentifier(callee)) {\n calleeName = callee.name;\n } else if (t.isMemberExpression(callee) && t.isIdentifier(callee.property)) {\n calleeName = callee.property.name;\n }\n\n if (SIGNAL_CREATORS.has(calleeName)) {\n const id = decl.id;\n if (t.isIdentifier(id)) {\n signalNames.add(id.name);\n } else if (t.isArrayPattern(id)) {\n for (const el of id.elements) {\n if (t.isIdentifier(el)) signalNames.add(el.name);\n }\n } else if (t.isObjectPattern(id)) {\n for (const prop of id.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n signalNames.add(prop.value.name);\n }\n }\n }\n }\n }\n\n // Walk up the scope chain using Babel's scope API.\n let scope = path.scope;\n while (scope) {\n // Check all variable bindings in this scope.\n for (const binding of Object.values(scope.bindings)) {\n if (binding.path.isVariableDeclarator()) {\n extractFromDeclarator(binding.path.node);\n }\n }\n // Scan this scope's own function params (destructured props) ONCE per\n // scope \u2014 not once per binding. The old per-binding rescan made this\n // O(params \u00D7 bindings) per scope per JSXElement. (AUDIT-2026-06-06 H2)\n const fnNode = scope.path && scope.path.node;\n if (fnNode && fnNode.params) {\n for (const param of fnNode.params) {\n if (t.isObjectPattern(param)) {\n for (const prop of param.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n signalNames.add(prop.value.name);\n } else if (t.isRestElement(prop) && t.isIdentifier(prop.argument)) {\n signalNames.add(prop.argument.name);\n }\n }\n }\n }\n }\n scope = scope.parent;\n }\n\n return signalNames;\n }\n\n // Legacy wrapper for backward compat (used in collectSignalNames calls)\n function collectSignalNames(path) {\n return collectSignalNamesFromScope(path);\n }\n\n // Check if a call expression is a safe (non-reactive) global call\n function isSafeGlobalCall(expr) {\n if (!t.isCallExpression(expr)) return false;\n const callee = expr.callee;\n\n // Math.max(), Number.parseInt(), etc.\n if (t.isMemberExpression(callee) && t.isIdentifier(callee.object)) {\n return SAFE_GLOBAL_CALLS.has(callee.object.name);\n }\n\n // parseInt(), isNaN(), etc.\n if (t.isIdentifier(callee)) {\n return SAFE_GLOBAL_CALLS.has(callee.name);\n }\n\n return false;\n }\n\n // Check if an expression's reactivity is uncertain \u2014 e.g., a non-signal function call\n // whose arguments happen to contain signal reads. The function itself may not produce\n // a reactive result, so the compiler wraps it conservatively.\n function isUncertainReactive(expr, signalNames, importedIds) {\n if (!signalNames) return false;\n if (t.isCallExpression(expr)) {\n // Callee is a known signal \u2014 definitely reactive, not uncertain\n if (t.isIdentifier(expr.callee) && isSignalIdentifier(expr.callee.name, signalNames)) {\n return false;\n }\n // Imported identifier called as function \u2014 definitely reactive (not uncertain)\n if (importedIds && t.isIdentifier(expr.callee) && importedIds.has(expr.callee.name) &&\n !SAFE_GLOBAL_CALLS.has(expr.callee.name)) {\n return false;\n }\n // Callee is a member of a known signal \u2014 definitely reactive\n if (t.isMemberExpression(expr.callee) && t.isIdentifier(expr.callee.object) &&\n isSignalIdentifier(expr.callee.object.name, signalNames)) {\n return false;\n }\n // Safe global call (Math.max, etc.) with reactive args \u2014 still deterministic, not uncertain\n if (isSafeGlobalCall(expr)) return false;\n // Unknown function call \u2014 if args are reactive, the wrapping is uncertain\n if (expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds))) {\n return true;\n }\n }\n return false;\n }\n\n // Check if an expression is potentially reactive (reads a signal)\n // importedIds: Set of identifiers imported from other modules \u2014 any imported\n // function call is conservatively treated as potentially reactive since the\n // imported binding could be a signal from another file.\n function isPotentiallyReactive(expr, signalNames, importedIds) {\n if (!signalNames) signalNames = new Set();\n\n if (t.isCallExpression(expr)) {\n // If callee is a known signal identifier being called (signal read), it's reactive\n if (t.isIdentifier(expr.callee) && isSignalIdentifier(expr.callee.name, signalNames)) {\n return true;\n }\n // Imported identifier called as a function \u2014 conservatively reactive.\n // Handles: import { count } from './store'; ... {count()} in JSX\n if (importedIds && t.isIdentifier(expr.callee) && importedIds.has(expr.callee.name)) {\n // Exclude known safe globals that happen to also be imported\n if (!SAFE_GLOBAL_CALLS.has(expr.callee.name)) {\n return true;\n }\n }\n // member.call() \u2014 e.g., data(), isLoading()\n if (t.isMemberExpression(expr.callee)) {\n // Check if the object is a signal\n if (t.isIdentifier(expr.callee.object) && isSignalIdentifier(expr.callee.object.name, signalNames)) {\n return true;\n }\n }\n // Safe global calls like Math.max \u2014 only reactive if their args are\n if (isSafeGlobalCall(expr)) {\n return expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n // Unknown call \u2014 check if callee or args contain signal reads\n if (t.isIdentifier(expr.callee)) {\n // Could be a function that reads signals internally\n // Be conservative: if it's not a known safe call and not a signal, still check args\n return expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n // For any other call expression, check recursively\n return isPotentiallyReactive(expr.callee, signalNames, importedIds) ||\n expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n\n if (t.isIdentifier(expr)) {\n return isSignalIdentifier(expr.name, signalNames) ||\n (importedIds && importedIds.has(expr.name));\n }\n\n if (t.isMemberExpression(expr)) {\n return isPotentiallyReactive(expr.object, signalNames, importedIds);\n }\n\n if (t.isConditionalExpression(expr)) {\n return isPotentiallyReactive(expr.test, signalNames, importedIds) ||\n isPotentiallyReactive(expr.consequent, signalNames, importedIds) ||\n isPotentiallyReactive(expr.alternate, signalNames, importedIds);\n }\n\n if (t.isBinaryExpression(expr) || t.isLogicalExpression(expr)) {\n return isPotentiallyReactive(expr.left, signalNames, importedIds) ||\n isPotentiallyReactive(expr.right, signalNames, importedIds);\n }\n\n if (t.isUnaryExpression(expr)) {\n return isPotentiallyReactive(expr.argument, signalNames, importedIds);\n }\n\n if (t.isTemplateLiteral(expr)) {\n return expr.expressions.some(e => isPotentiallyReactive(e, signalNames, importedIds));\n }\n\n if (t.isObjectExpression(expr)) {\n return expr.properties.some(prop =>\n t.isObjectProperty(prop) && isPotentiallyReactive(prop.value, signalNames, importedIds)\n );\n }\n\n if (t.isArrayExpression(expr)) {\n return expr.elements.some(el => el && isPotentiallyReactive(el, signalNames, importedIds));\n }\n\n if (t.isArrowFunctionExpression(expr) || t.isFunctionExpression(expr)) {\n // Function expressions are not reactive themselves \u2014 they're callbacks\n return false;\n }\n\n return false;\n }\n\n // --- Auto-lower .map() to mapArray ---\n // Detects: source().map((item) => <Comp key={expr} .../>)\n // or wrapped in an arrow: () => source().map(...)\n // Also walks into ternary (cond ? a.map(...) : fallback) and\n // logical (cond && a.map(...)) expressions so React-style\n // conditional list patterns get keyed reconciliation.\n // Produces: _$mapArray(source, (item) => <Comp .../>, { key: item => expr })\n function tryLowerMapToMapArray(expr, state) {\n // Unwrap arrow function: () => source().map(...)\n let mapCall = expr;\n let wrappedInArrow = false;\n if (t.isArrowFunctionExpression(expr) && expr.params.length === 0) {\n mapCall = expr.body;\n wrappedInArrow = true;\n }\n\n // Walk into ternary: cond ? arr().map(...) : fallback\n if (t.isConditionalExpression(mapCall)) {\n const loweredCon = tryLowerMapCall(mapCall.consequent, state);\n const loweredAlt = tryLowerMapCall(mapCall.alternate, state);\n if (loweredCon || loweredAlt) {\n const result = t.conditionalExpression(\n mapCall.test,\n loweredCon || mapCall.consequent,\n loweredAlt || mapCall.alternate\n );\n return wrappedInArrow ? t.arrowFunctionExpression([], result) : result;\n }\n return null;\n }\n\n // Walk into logical: cond && arr().map(...)\n if (t.isLogicalExpression(mapCall) && (mapCall.operator === '&&' || mapCall.operator === '||')) {\n const loweredRight = tryLowerMapCall(mapCall.right, state);\n if (loweredRight) {\n const result = t.logicalExpression(mapCall.operator, mapCall.left, loweredRight);\n return wrappedInArrow ? t.arrowFunctionExpression([], result) : result;\n }\n return null;\n }\n\n // Direct .map() call\n const lowered = tryLowerMapCall(mapCall, state);\n return lowered;\n }\n\n // Core .map() lowering \u2014 extracted so it can be called per-branch\n function tryLowerMapCall(mapCall, state) {\n // Check: something.map(fn)\n if (!t.isCallExpression(mapCall)) return null;\n if (!t.isMemberExpression(mapCall.callee)) return null;\n if (!t.isIdentifier(mapCall.callee.property, { name: 'map' })) return null;\n if (mapCall.arguments.length < 1) return null;\n\n const mapFn = mapCall.arguments[0];\n if (!t.isArrowFunctionExpression(mapFn) && !t.isFunctionExpression(mapFn)) return null;\n\n // Get the map callback's return expression\n let returnExpr = null;\n if (t.isArrowFunctionExpression(mapFn)) {\n if (t.isExpression(mapFn.body)) {\n returnExpr = mapFn.body;\n } else if (t.isBlockStatement(mapFn.body)) {\n const ret = mapFn.body.body.find(s => t.isReturnStatement(s));\n if (ret) returnExpr = ret.argument;\n }\n } else if (t.isFunctionExpression(mapFn)) {\n const ret = mapFn.body.body.find(s => t.isReturnStatement(s));\n if (ret) returnExpr = ret.argument;\n }\n\n if (!returnExpr) return null;\n\n // Check if the return is JSX with a `key` prop\n if (!t.isJSXElement(returnExpr)) return null;\n const attrs = returnExpr.openingElement.attributes;\n let keyAttr = null;\n for (const attr of attrs) {\n if (t.isJSXAttribute(attr) && getAttrName(attr) === 'key') {\n keyAttr = attr;\n break;\n }\n }\n if (!keyAttr) {\n // JSX returned without a key \u2014 bail out, but warn at compile time so\n // users notice they're missing keyed reconciliation. Only warn in dev\n // (production builds are noiseless).\n if (process.env.NODE_ENV !== 'production') {\n const loc = returnExpr.loc;\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.warn(\n `[what-compiler] .map() returning JSX without a \\`key\\` prop at ${fileName}${lineInfo}. ` +\n `Without a key, the list cannot use keyed reconciliation \u2014 items are re-created on every update. ` +\n `Add key={...} to enable efficient updates.`\n );\n }\n return null;\n }\n\n // Extract the key expression\n const keyValue = getAttributeValue(keyAttr.value);\n if (!keyValue) return null;\n\n // Remove the key prop from the JSX element (mapArray handles keying, not the DOM)\n returnExpr.openingElement.attributes = attrs.filter(a => a !== keyAttr);\n\n // Build the source: the object before .map() \u2014 wrap in an arrow for reactive access\n const sourceObj = mapCall.callee.object;\n const source = t.arrowFunctionExpression([], sourceObj);\n\n // Build the key function: (item) => keyExpr.\n // Clone both the parameter and the key expression \u2014 the parameter is shared\n // with the user's map callback AST and keyValue may be referenced elsewhere\n // in the tree. Cloning insulates this new arrow from later mutations.\n const itemParam = mapFn.params[0] ? t.cloneNode(mapFn.params[0], true) : t.identifier('_item');\n const keyFn = t.arrowFunctionExpression([itemParam], t.cloneNode(keyValue, true));\n\n // Build: _$mapArray(source, mapFn, { key: keyFn, raw: true })\n // raw: true means mapFn receives the raw item value (not a signal accessor),\n // matching user-authored .map() semantics where `item.prop` accesses values directly.\n return t.callExpression(t.identifier('_$mapArray'), [\n source,\n mapFn,\n t.objectExpression([\n t.objectProperty(t.identifier('key'), keyFn),\n t.objectProperty(t.identifier('raw'), t.booleanLiteral(true))\n ])\n ]);\n }\n\n // =====================================================\n // Fine-Grained Mode (template + insert + effect)\n // =====================================================\n\n // Check if a JSX child is static (no expressions)\n function isStaticChild(child) {\n if (t.isJSXText(child)) return true;\n if (t.isJSXExpressionContainer(child)) return false;\n if (t.isJSXElement(child)) {\n const el = child.openingElement;\n const tagName = el.name.name;\n if (isComponent(tagName)) return false;\n for (const attr of el.attributes) {\n if (t.isJSXSpreadAttribute(attr)) return false;\n const value = attr.value;\n if (t.isJSXExpressionContainer(value)) return false;\n }\n return child.children.every(isStaticChild);\n }\n return false;\n }\n\n // Check if an attribute value is dynamic\n function isDynamicAttr(attr) {\n if (t.isJSXSpreadAttribute(attr)) return true;\n if (!attr.value) return false;\n return t.isJSXExpressionContainer(attr.value);\n }\n\n // Extract static HTML from JSX element for template()\n function extractStaticHTML(node) {\n if (t.isJSXText(node)) {\n const text = normalizeJsxText(node.value);\n return text ? escapeHTML(text) : '';\n }\n\n if (t.isJSXExpressionContainer(node)) {\n if (t.isJSXEmptyExpression(node.expression)) return '';\n return '<!--$-->';\n }\n\n if (!t.isJSXElement(node)) return '';\n\n const el = node.openingElement;\n const tagName = el.name.name;\n\n if (isComponent(tagName)) return '';\n\n let html = `<${tagName}`;\n\n for (const attr of el.attributes) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const name = getAttrName(attr);\n if (name === 'key') continue;\n if (name.startsWith('on') || name.startsWith('bind:') || name.includes('|')) continue;\n\n let domName = name;\n if (name === 'className') domName = 'class';\n if (name === 'htmlFor') domName = 'for';\n\n if (!attr.value) {\n html += ` ${domName}`;\n } else if (t.isStringLiteral(attr.value)) {\n html += ` ${domName}=\"${escapeAttr(attr.value.value)}\"`;\n } else if (t.isJSXExpressionContainer(attr.value)) {\n continue; // Dynamic attr \u2014 set via effect\n }\n }\n\n const selfClosing = node.openingElement.selfClosing;\n if (selfClosing && isVoidHtmlElement(tagName)) {\n html += '>';\n return html;\n }\n\n if (selfClosing) {\n html += `></${tagName}>`;\n return html;\n }\n\n html += '>';\n\n for (const child of node.children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) html += escapeHTML(text);\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n html += '<!--$-->';\n }\n } else if (t.isJSXElement(child)) {\n if (isComponent(child.openingElement.name.name)) {\n html += '<!--$-->';\n } else {\n html += extractStaticHTML(child);\n }\n }\n }\n\n html += `</${tagName}>`;\n return html;\n }\n\n function escapeHTML(str) {\n return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n }\n\n function escapeAttr(str) {\n return str.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');\n }\n\n // Analyze JSX tree and generate fine-grained output\n function transformElementFineGrained(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const tagName = openingElement.name.name;\n\n // Control flow components \u2014 check before generic isComponent since they start uppercase\n if (tagName === 'For') {\n return transformForFineGrained(path, state);\n }\n if (tagName === 'Show') {\n return transformShowFineGrained(path, state);\n }\n\n if (isComponent(tagName)) {\n return transformComponentFineGrained(path, state);\n }\n\n const attributes = openingElement.attributes;\n const children = node.children;\n\n // Check if this entire subtree is purely static\n const allChildrenStatic = children.every(isStaticChild);\n const allAttrsStatic = attributes.every(attr => !isDynamicAttr(attr));\n const noEvents = attributes.every(attr => {\n if (t.isJSXSpreadAttribute(attr)) return false;\n const name = getAttrName(attr);\n return !name?.startsWith('on') && !name?.startsWith('bind:');\n });\n\n if (allChildrenStatic && allAttrsStatic && noEvents) {\n // Fully static element \u2014 extract to template, return clone call\n const html = extractStaticHTML(node);\n if (html) {\n const tmplId = getOrCreateTemplate(state, html);\n state.needsTemplate = true;\n return t.callExpression(t.identifier(tmplId), []);\n }\n }\n\n // Mixed static/dynamic element \u2014 extract template, add effects for dynamic parts\n const html = extractStaticHTML(node);\n if (!html) {\n // Template extraction failed \u2014 emit a detailed compile warning and use h() as fallback\n const loc = node.loc;\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.warn(\n `[what-compiler] Could not extract template for <${tagName}> at ${fileName}${lineInfo}. ` +\n `Falling back to h() for this element. ` +\n `This element could not be statically analyzed. Consider simplifying the JSX.`\n );\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n const tmplId = getOrCreateTemplate(state, html);\n state.needsTemplate = true;\n\n const elId = state.nextVarId();\n\n // Build statements: _el$ = _tmpl$1()\n // NO IIFE wrapping \u2014 statements are inlined into the containing function\n const statements = [\n t.variableDeclaration('const', [\n t.variableDeclarator(t.identifier(elId), t.callExpression(t.identifier(tmplId), []))\n ])\n ];\n\n // Apply dynamic attributes and events\n applyDynamicAttrs(statements, elId, attributes, state);\n\n // Handle dynamic children\n applyDynamicChildren(statements, elId, children, node, state);\n\n // Instead of wrapping in an IIFE, store setup statements for hoisting.\n // The JSXElement visitor will insert them before the enclosing statement.\n if (!state._pendingSetup) state._pendingSetup = [];\n state._pendingSetup.push(...statements);\n return t.identifier(elId);\n }\n\n // Fallback: transform element using h() when template extraction fails\n function transformElementAsH(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const tagName = openingElement.name.name;\n const attributes = openingElement.attributes;\n const children = node.children;\n\n const props = [];\n for (const attr of attributes) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const attrName = getAttrName(attr);\n const value = getAttributeValue(attr.value);\n let domAttrName = normalizeAttrName(attrName);\n props.push(\n t.objectProperty(\n /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(domAttrName)\n ? t.identifier(domAttrName)\n : t.stringLiteral(domAttrName),\n value\n )\n );\n }\n\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformedChildren.push(child.expression);\n }\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformedChildren.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n const propsExpr = props.length > 0 ? t.objectExpression(props) : t.nullLiteral();\n return t.callExpression(t.identifier('h'), [t.stringLiteral(tagName), propsExpr, ...transformedChildren]);\n }\n\n function applyDynamicAttrs(statements, elId, attributes, state) {\n function buildSetPropCall(propName, valueExpr) {\n state.needsSetProp = true;\n return t.callExpression(t.identifier('_$setProp'), [\n t.identifier(elId),\n t.stringLiteral(propName),\n valueExpr\n ]);\n }\n\n for (const attr of attributes) {\n if (t.isJSXSpreadAttribute(attr)) {\n state.needsSpread = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$spread'), [t.identifier(elId), attr.argument])\n )\n );\n continue;\n }\n\n const attrName = getAttrName(attr);\n\n // Strip key prop \u2014 WhatFW has no virtual DOM, so key is meaningless (issue #6)\n if (attrName === 'key') continue;\n\n // Ref handling \u2014 assign element to ref object/callback\n if (attrName === 'ref') {\n const refExpr = getAttributeValue(attr.value);\n // Generate: typeof ref === 'function' ? ref(el) : ref.current = el\n statements.push(\n t.expressionStatement(\n t.conditionalExpression(\n t.binaryExpression('===',\n t.unaryExpression('typeof', refExpr),\n t.stringLiteral('function')\n ),\n t.callExpression(t.cloneNode(refExpr), [t.identifier(elId)]),\n t.assignmentExpression('=',\n t.memberExpression(t.cloneNode(refExpr), t.identifier('current')),\n t.identifier(elId)\n )\n )\n )\n );\n continue;\n }\n\n // Event handlers\n if (attrName.startsWith('on') && !attrName.includes('|') && !hasEventModifiers(attrName, state)) {\n const event = attrName.slice(2).toLowerCase();\n const handler = getAttributeValue(attr.value);\n\n if (DELEGATED_EVENTS.has(event)) {\n // Use event delegation: el.$$click = handler (matches runtime lookup)\n state.needsDelegation = true;\n if (!state.delegatedEvents) state.delegatedEvents = new Set();\n state.delegatedEvents.add(event);\n statements.push(\n t.expressionStatement(\n t.assignmentExpression('=',\n t.memberExpression(\n t.identifier(elId),\n t.identifier(`$$${event}`)\n ),\n handler\n )\n )\n );\n } else {\n // Non-delegated: use per-element addEventListener\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [t.stringLiteral(event), handler]\n )\n )\n );\n }\n continue;\n }\n\n // Event with modifiers (pipe '|' or JSX-safe double underscore '__')\n if (attrName.startsWith('on') && (attrName.includes('|') || hasEventModifiers(attrName, state))) {\n const { eventName, modifiers } = parseEventModifiers(attrName);\n const handler = getAttributeValue(attr.value);\n const wrappedHandler = createEventHandler(handler, modifiers);\n const event = eventName.slice(2).toLowerCase();\n\n const optionMods = modifiers.filter(m => EVENT_OPTION_MODIFIERS.has(m));\n const addEventArgs = [t.stringLiteral(event), wrappedHandler];\n if (optionMods.length > 0) {\n const optsProps = optionMods.map(m =>\n t.objectProperty(t.identifier(m), t.booleanLiteral(true))\n );\n addEventArgs.push(t.objectExpression(optsProps));\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n addEventArgs\n )\n )\n );\n continue;\n }\n\n // Binding\n if (isBindingAttribute(attrName)) {\n const bindProp = getBindingProperty(attrName);\n const signalExpr = attr.value.expression;\n state.needsEffect = true;\n\n if (bindProp === 'value') {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], t.assignmentExpression('=',\n t.memberExpression(t.identifier(elId), t.identifier('value')),\n t.callExpression(t.cloneNode(signalExpr), [])\n ))\n ])\n )\n );\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [\n t.stringLiteral('input'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('value')\n )]\n )\n )\n ]\n )\n )\n );\n } else if (bindProp === 'checked') {\n state.needsEffect = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], t.assignmentExpression('=',\n t.memberExpression(t.identifier(elId), t.identifier('checked')),\n t.callExpression(t.cloneNode(signalExpr), [])\n ))\n ])\n )\n );\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [\n t.stringLiteral('change'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('checked')\n )]\n )\n )\n ]\n )\n )\n );\n }\n continue;\n }\n\n // Dynamic attribute (expression)\n if (t.isJSXExpressionContainer(attr.value)) {\n const expr = attr.value.expression;\n const domName = normalizeAttrName(attrName);\n\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n state.needsEffect = true;\n // Auto-invoke bare signal/imported identifiers: value={name} -> name()\n const valueExpr = t.isIdentifier(expr) &&\n (isSignalIdentifier(expr.name, state.signalNames) ||\n (state.importedIdentifiers && state.importedIdentifiers.has(expr.name)))\n ? t.callExpression(expr, [])\n : expr;\n const effectCall = t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], buildSetPropCall(domName, valueExpr))\n ]);\n // In dev mode, add a leading comment when the effect wrapping is uncertain\n // (non-signal function call whose args happen to contain signal reads)\n if (isUncertainReactive(expr, state.signalNames, state.importedIdentifiers)) {\n t.addComment(effectCall, 'leading',\n ' @what-dev: effect wrapping may be unnecessary \u2014 expression contains a non-signal function call with reactive args ',\n false\n );\n }\n statements.push(t.expressionStatement(effectCall));\n } else {\n // Static expression (no signal calls) \u2014 set once\n statements.push(t.expressionStatement(buildSetPropCall(domName, expr)));\n }\n }\n }\n }\n\n function applyDynamicChildren(statements, elId, children, parentNode, state) {\n // Two-pass approach: first collect all children needing DOM references,\n // then pre-capture markers before any _$insert() calls shift indices.\n // This fixes issue #1: childNodes index shifting with multiple dynamic children.\n\n // --- Pass 1: Scan children and collect entries ---\n const entries = [];\n let childIndex = 0;\n\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) childIndex++;\n continue;\n }\n\n if (t.isJSXExpressionContainer(child)) {\n if (t.isJSXEmptyExpression(child.expression)) continue;\n entries.push({ type: 'expression', child, childIndex });\n childIndex++;\n continue;\n }\n\n if (t.isJSXElement(child)) {\n const childTag = child.openingElement.name.name;\n if (isComponent(childTag) || childTag === 'For' || childTag === 'Show') {\n entries.push({ type: 'component', child, childIndex });\n childIndex++;\n } else {\n const hasAnythingDynamic = child.openingElement.attributes.some(isDynamicAttr) ||\n child.openingElement.attributes.some(a => !t.isJSXSpreadAttribute(a) && getAttrName(a)?.startsWith('on')) ||\n !child.children.every(isStaticChild);\n\n entries.push({ type: 'static', child, childIndex, hasAnythingDynamic });\n childIndex++;\n }\n continue;\n }\n\n if (t.isJSXFragment(child)) {\n entries.push({ type: 'fragment', child });\n }\n }\n\n // --- Pre-capture marker references if needed ---\n // When there are multiple entries needing DOM refs and at least one _$insert(),\n // capture all markers upfront to avoid index shifting after DOM mutations.\n const entriesNeedingRef = entries.filter(e =>\n e.type === 'expression' || e.type === 'component' ||\n (e.type === 'static' && e.hasAnythingDynamic)\n );\n // Pre-capture whenever 2+ children need a DOM ref. Beyond preventing index\n // shift after insert() mutations, the shared O(n) cursor walk below replaces\n // per-child `el.firstChild.nextSibling\u2026`-from-root access, which was O(n\u00B2) in\n // both compile time and emitted size for elements with many dynamic\n // children. (AUDIT-2026-06-06 H2)\n const needsPreCapture = entriesNeedingRef.length >= 2;\n\n const markerVars = new Map(); // childIndex \u2192 variable name\n if (needsPreCapture) {\n // Chain each marker from the PREVIOUS captured cursor instead of\n // re-walking `el.firstChild.nextSibling\u2026` from the root for every child.\n // entriesNeedingRef is in ascending childIndex order, so the per-marker\n // deltas sum to O(n) total instead of O(n\u00B2). This was the dominant\n // quadratic in compile time and emitted-bundle size for large elements.\n // (AUDIT-2026-06-06 H2)\n let prevVar = null;\n let prevIndex = 0;\n for (const entry of entriesNeedingRef) {\n const idx = entry.childIndex;\n const markerVar = state.nextVarId();\n markerVars.set(idx, markerVar);\n let init;\n if (prevVar === null) {\n init = buildChildAccess(elId, idx);\n } else {\n init = t.identifier(prevVar);\n for (let i = prevIndex; i < idx; i++) {\n init = t.memberExpression(init, t.identifier('nextSibling'));\n }\n }\n statements.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(t.identifier(markerVar), init)\n ])\n );\n prevVar = markerVar;\n prevIndex = idx;\n }\n }\n\n // Helper: get a marker reference (pre-captured var or inline access)\n function getMarker(idx) {\n if (markerVars.has(idx)) {\n return t.identifier(markerVars.get(idx));\n }\n return buildChildAccess(elId, idx);\n }\n\n // --- Pass 2: Generate code using stable references ---\n for (const entry of entries) {\n if (entry.type === 'expression') {\n let expr = entry.child.expression;\n const marker = getMarker(entry.childIndex);\n state.needsInsert = true;\n\n // Auto-lower .map() to mapArray when the callback returns keyed JSX.\n // Pattern: source().map(item => <Comp key={...} />) or source().map((item, i) => ...)\n const mapResult = tryLowerMapToMapArray(expr, state);\n if (mapResult) {\n state.needsMapArray = true;\n // A bare _$mapArray(...) call is a self-managing inserter (it tracks\n // its source internally) and an arrow is already reactive \u2014 pass both\n // raw. But when lowering produced a ternary/logical wrapping the call\n // (e.g. cond ? _$mapArray(...) : fallback), the surrounding condition\n // must stay reactive, so wrap the whole expression in () => and let\n // _$insert re-evaluate it on change. Without this the condition is read\n // exactly once and never re-tracks. (AUDIT-2026-06-06 H1)\n const isBareMapArray = t.isCallExpression(mapResult) && t.isIdentifier(mapResult.callee) &&\n (mapResult.callee.name === '_$mapArray' || mapResult.callee.name === 'mapArray');\n const isArrowAlready = t.isArrowFunctionExpression(mapResult);\n const insertArg = (isBareMapArray || isArrowAlready)\n ? mapResult\n : t.arrowFunctionExpression([], mapResult);\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n insertArg,\n marker\n ])\n )\n );\n continue;\n }\n\n // mapArray() calls return self-managing inserters \u2014 pass directly, never wrap in () =>\n const isMapArrayCall = t.isCallExpression(expr) && t.isIdentifier(expr.callee) &&\n (expr.callee.name === 'mapArray' || expr.callee.name === '_$mapArray');\n if (isMapArrayCall) {\n state.needsMapArray = true;\n if (expr.callee.name === 'mapArray') expr.callee.name = '_$mapArray';\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr,\n marker\n ])\n )\n );\n continue;\n }\n\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n const insertCall = t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n t.arrowFunctionExpression([], expr),\n marker\n ]);\n if (isUncertainReactive(expr, state.signalNames, state.importedIdentifiers)) {\n t.addComment(insertCall, 'leading',\n ' @what-dev: reactive wrapping may be unnecessary \u2014 expression contains a non-signal function call with reactive args ',\n false\n );\n }\n statements.push(t.expressionStatement(insertCall));\n } else {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr,\n marker\n ])\n )\n );\n }\n continue;\n }\n\n if (entry.type === 'component') {\n const transformed = transformElementFineGrained({ node: entry.child }, state);\n const marker = getMarker(entry.childIndex);\n state.needsInsert = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n transformed,\n marker\n ])\n )\n );\n continue;\n }\n\n if (entry.type === 'static' && entry.hasAnythingDynamic) {\n // Static child with dynamic content \u2014 get element reference\n let childElRef;\n if (markerVars.has(entry.childIndex)) {\n childElRef = markerVars.get(entry.childIndex);\n } else {\n childElRef = state.nextVarId();\n statements.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier(childElRef),\n buildChildAccess(elId, entry.childIndex)\n )\n ])\n );\n }\n applyDynamicAttrs(statements, childElRef, entry.child.openingElement.attributes, state);\n applyDynamicChildren(statements, childElRef, entry.child.children, entry.child, state);\n continue;\n }\n\n if (entry.type === 'fragment') {\n for (const fChild of entry.child.children) {\n if (t.isJSXExpressionContainer(fChild) && !t.isJSXEmptyExpression(fChild.expression)) {\n state.needsInsert = true;\n const expr = fChild.expression;\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n t.arrowFunctionExpression([], expr)\n ])\n )\n );\n } else {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr\n ])\n )\n );\n }\n }\n }\n }\n }\n }\n\n function buildChildAccess(elId, index) {\n // Use firstChild/nextSibling chains instead of childNodes[N]\n // This is more robust with whitespace text nodes\n if (index === 0) {\n return t.memberExpression(t.identifier(elId), t.identifier('firstChild'));\n }\n // Chain .nextSibling for subsequent indices\n let expr = t.memberExpression(t.identifier(elId), t.identifier('firstChild'));\n for (let i = 0; i < index; i++) {\n expr = t.memberExpression(expr, t.identifier('nextSibling'));\n }\n return expr;\n }\n\n function transformComponentFineGrained(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const componentName = openingElement.name.name;\n const attributes = openingElement.attributes;\n const children = node.children;\n\n // Check for client: directive (islands)\n let clientDirective = null;\n const filteredAttrs = [];\n\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n // Handle both simple names and namespaced names (client:idle)\n let name;\n if (t.isJSXNamespacedName(attr.name)) {\n name = `${attr.name.namespace.name}:${attr.name.name.name}`;\n } else {\n name = attr.name.name;\n }\n if (name && typeof name === 'string' && name.startsWith('client:')) {\n const mode = name.slice(7);\n if (attr.value) {\n clientDirective = { type: mode, value: attr.value.value };\n } else {\n clientDirective = { type: mode };\n }\n continue;\n }\n }\n filteredAttrs.push(attr);\n }\n\n if (clientDirective) {\n state.needsCreateComponent = true;\n state.needsIsland = true;\n\n const islandProps = [\n t.objectProperty(t.identifier('component'), t.identifier(componentName)),\n t.objectProperty(t.identifier('mode'), t.stringLiteral(clientDirective.type)),\n ];\n\n if (clientDirective.value) {\n islandProps.push(\n t.objectProperty(t.identifier('mediaQuery'), t.stringLiteral(clientDirective.value))\n );\n }\n\n for (const attr of filteredAttrs) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const attrName = getAttrName(attr);\n const value = getAttributeValue(attr.value);\n islandProps.push(t.objectProperty(t.identifier(attrName), value));\n }\n\n return t.callExpression(\n t.identifier('_$createComponent'),\n [t.identifier('Island'), t.objectExpression(islandProps), t.arrayExpression([])]\n );\n }\n\n // Regular component \u2014 use _$createComponent to instantiate, component runs once\n state.needsCreateComponent = true;\n\n const props = [];\n let hasSpread = false;\n let spreadExpr = null;\n\n for (const attr of filteredAttrs) {\n if (t.isJSXSpreadAttribute(attr)) {\n hasSpread = true;\n spreadExpr = attr.argument;\n continue;\n }\n\n const attrName = getAttrName(attr);\n\n // Strip key prop \u2014 WhatFW has no virtual DOM, so key is meaningless (issue #6)\n if (attrName === 'key') continue;\n\n // Handle bind: attributes for components\n if (isBindingAttribute(attrName)) {\n const bindProp = getBindingProperty(attrName);\n const signalExpr = attr.value.expression;\n\n if (bindProp === 'value') {\n props.push(\n t.objectProperty(t.identifier('value'), t.callExpression(t.cloneNode(signalExpr), []))\n );\n props.push(\n t.objectProperty(\n t.identifier('onInput'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('value')\n )]\n )\n )\n )\n );\n } else if (bindProp === 'checked') {\n props.push(\n t.objectProperty(t.identifier('checked'), t.callExpression(t.cloneNode(signalExpr), []))\n );\n props.push(\n t.objectProperty(\n t.identifier('onChange'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('checked')\n )]\n )\n )\n )\n );\n }\n continue;\n }\n\n // Handle event modifiers on components\n if (attrName.startsWith('on') && (attrName.includes('|') || hasEventModifiers(attrName, state))) {\n const { eventName, modifiers } = parseEventModifiers(attrName);\n const handler = getAttributeValue(attr.value);\n const wrappedHandler = createEventHandler(handler, modifiers);\n props.push(t.objectProperty(t.identifier(eventName), wrappedHandler));\n continue;\n }\n\n const value = getAttributeValue(attr.value);\n\n props.push(\n t.objectProperty(\n /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(attrName)\n ? t.identifier(attrName)\n : t.stringLiteral(attrName),\n value\n )\n );\n }\n\n // Transform children\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformedChildren.push(child.expression);\n }\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformedChildren.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n let propsExpr;\n if (hasSpread) {\n if (props.length > 0) {\n propsExpr = t.callExpression(\n t.memberExpression(t.identifier('Object'), t.identifier('assign')),\n [t.objectExpression([]), spreadExpr, t.objectExpression(props)]\n );\n } else {\n propsExpr = spreadExpr;\n }\n } else if (props.length > 0) {\n propsExpr = t.objectExpression(props);\n } else {\n propsExpr = t.nullLiteral();\n }\n\n const childrenArray = transformedChildren.length > 0\n ? t.arrayExpression(transformedChildren)\n : t.arrayExpression([]);\n\n return t.callExpression(t.identifier('_$createComponent'), [t.identifier(componentName), propsExpr, childrenArray]);\n }\n\n function transformForFineGrained(path, state) {\n const { node } = path;\n const attributes = node.openingElement.attributes;\n const children = node.children;\n\n // <For each={data} key={item => item.id}>{(item) => <Row />}</For>\n // \u2192 mapArray(data, (item) => ..., { key: item => item.id })\n //\n // NOTE: <For> is supported but .map() with a key prop is the preferred\n // pattern for list rendering. The compiler auto-lowers .map() to\n // _$mapArray with raw mode, which is simpler and matches JS idioms.\n // <For> is useful when you need signal-wrapped item accessors (keyed\n // mode without raw), so that item updates don't recreate DOM nodes.\n if (process.env.NODE_ENV !== 'production') {\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n if (!_forInfoWarned.has(fileName)) {\n _forInfoWarned.add(fileName);\n const loc = node.loc;\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.info(\n `[what-compiler] <For> at ${fileName}${lineInfo}: consider using .map() with a key prop instead. ` +\n `The compiler auto-lowers .map() to efficient keyed reconciliation. ` +\n `<For> is only needed for signal-wrapped item accessors (advanced).`\n );\n }\n }\n\n let eachExpr = null;\n let keyExpr = null;\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n const name = getAttrName(attr);\n if (name === 'each') eachExpr = getAttributeValue(attr.value);\n else if (name === 'key') keyExpr = getAttributeValue(attr.value);\n }\n }\n\n if (!eachExpr) {\n console.warn('[what-compiler] <For> element missing \"each\" attribute.');\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n let renderFn = null;\n for (const child of children) {\n if (t.isJSXExpressionContainer(child) && !t.isJSXEmptyExpression(child.expression)) {\n renderFn = child.expression;\n break;\n }\n }\n\n if (!renderFn) {\n console.warn('[what-compiler] <For> element missing render function child.');\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n state.needsMapArray = true;\n const args = [eachExpr, renderFn];\n if (keyExpr) {\n args.push(t.objectExpression([\n t.objectProperty(t.identifier('key'), keyExpr)\n ]));\n }\n return t.callExpression(t.identifier('_$mapArray'), args);\n }\n\n function transformShowFineGrained(path, state) {\n // <Show when={cond} fallback={alt}>{content}</Show>\n // \u2192 () => cond() ? content : (fallback || null)\n // This compiles to a reactive expression that insert() wraps in an effect.\n const { node } = path;\n const attributes = node.openingElement.attributes;\n const children = node.children;\n\n let whenExpr = null;\n let fallbackExpr = null;\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n const name = getAttrName(attr);\n if (name === 'when') whenExpr = getAttributeValue(attr.value);\n else if (name === 'fallback') fallbackExpr = getAttributeValue(attr.value);\n }\n }\n\n if (!whenExpr) {\n // <Show> without a when prop has no defined semantics \u2014 fail loudly at\n // build time so the user fixes their source instead of seeing runtime\n // confusion. buildCodeFrameError pins the error to the JSX location.\n throw path.buildCodeFrameError(\n '<Show> requires a \"when\" prop. Example: <Show when={isOpen} fallback={null}>...</Show>'\n );\n }\n\n // Extract the content \u2014 either a render function child or static JSX children\n let contentExpr = null;\n for (const child of children) {\n if (t.isJSXExpressionContainer(child) && !t.isJSXEmptyExpression(child.expression)) {\n // Render function: {() => <div>...</div>} or {(value) => <div>{value}</div>}\n contentExpr = child.expression;\n break;\n }\n }\n\n if (!contentExpr) {\n // Static children \u2014 collect and transform them\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n }\n }\n if (transformedChildren.length === 1) {\n contentExpr = transformedChildren[0];\n } else if (transformedChildren.length > 1) {\n contentExpr = t.arrayExpression(transformedChildren);\n } else {\n contentExpr = t.nullLiteral();\n }\n }\n\n // Build:\n // () => { const _v = <condition>; return _v ? <consequent> : <alternate>; }\n // Hoisting into a local prevents double-evaluation of the `when` signal\n // (the consequent's render callback also needs the resolved value).\n //\n // `whenExpr` shape determines how we form the condition:\n // - call expression \u2192 use as-is <Show when={cond()}>\n // - arrow w/ expression body \u2192 use the body <Show when={() => x > 5}>\n // - identifier that looks like a signal/import <Show when={isOpen}>\n // \u2192 invoke it as accessor: isOpen()\n // - anything else (member, literal, logical, etc.) <Show when={user.isAdmin}>\n // \u2192 use the raw expression. Do NOT invoke \u2014\n // non-functions would throw at runtime.\n let condition;\n if (t.isCallExpression(whenExpr)) {\n condition = whenExpr;\n } else if (t.isArrowFunctionExpression(whenExpr) && t.isExpression(whenExpr.body)) {\n condition = whenExpr.body;\n } else if (\n t.isIdentifier(whenExpr) &&\n (\n (state.signalNames && isSignalIdentifier(whenExpr.name, state.signalNames)) ||\n (state.importedIdentifiers && state.importedIdentifiers.has(whenExpr.name))\n )\n ) {\n condition = t.callExpression(whenExpr, []);\n } else {\n // Plain boolean expression \u2014 member access, literal, logical, etc.\n condition = whenExpr;\n }\n\n const vId = path.scope\n ? path.scope.generateUidIdentifier('v')\n : t.identifier('_v');\n\n const consequent = t.isFunction(contentExpr)\n ? t.callExpression(contentExpr, [t.cloneNode(vId)])\n : contentExpr;\n const alternate = fallbackExpr || t.nullLiteral();\n\n return t.arrowFunctionExpression([], t.blockStatement([\n t.variableDeclaration('const', [\n t.variableDeclarator(vId, condition)\n ]),\n t.returnStatement(\n t.conditionalExpression(t.cloneNode(vId), consequent, alternate)\n )\n ]));\n }\n\n function transformFragmentFineGrained(path, state) {\n const { node } = path;\n const children = node.children;\n\n const transformed = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformed.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformed.push(child.expression);\n }\n } else if (t.isJSXElement(child)) {\n transformed.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformed.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n if (transformed.length === 1) return transformed[0];\n return t.arrayExpression(transformed);\n }\n\n // Template deduplication: same HTML string \u2192 same module-level const\n function getOrCreateTemplate(state, html) {\n if (state.templateMap.has(html)) {\n return state.templateMap.get(html);\n }\n const id = `_tmpl$${state.templateCount++}`;\n state.templateMap.set(html, id);\n state.templates.push({ id, html });\n return id;\n }\n\n // =====================================================\n // Plugin entry\n // =====================================================\n\n return {\n name: 'what-jsx-transform',\n\n visitor: {\n Program: {\n enter(path, state) {\n // Fine-grained mode state\n state.needsTemplate = false;\n state.needsInsert = false;\n state.needsEffect = false;\n state.needsMapArray = false;\n state.needsSpread = false;\n state.needsSetProp = false;\n state.needsH = false;\n state.needsCreateComponent = false;\n state.needsFragment = false;\n state.needsIsland = false;\n state.needsDelegation = false;\n state.delegatedEvents = new Set();\n state.templates = [];\n state.templateMap = new Map(); // html \u2192 template id (deduplication)\n state.templateCount = 0;\n state._varCounter = 0;\n state._pendingSetup = [];\n state.nextVarId = () => `_el$${state._varCounter++}`;\n\n // Collect signal names for smart reactivity detection\n state.signalNames = new Set();\n\n // --- Imported Signal Tracking ---\n // Only mark imports as potentially reactive if they come from known\n // reactive sources: what-framework, what-framework/*, relative paths\n // (user stores), or functions matching use*/create* naming conventions.\n // This prevents over-wrapping of utility imports (lodash, etc.).\n state.importedIdentifiers = new Set();\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node)) {\n const source = node.source.value;\n const isReactiveSource =\n source === 'what-framework' ||\n source.startsWith('what-framework/') ||\n source === 'what-core' ||\n source.startsWith('what-core/') ||\n source.startsWith('./') ||\n source.startsWith('../');\n\n for (const spec of node.specifiers) {\n let localName = null;\n if (t.isImportSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n } else if (t.isImportDefaultSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n } else if (t.isImportNamespaceSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n }\n\n if (localName) {\n // Mark as reactive if from a reactive source, or if the name\n // matches use*/create* conventions (hooks/signal creators)\n if (isReactiveSource || /^(use|create)[A-Z]/.test(localName)) {\n state.importedIdentifiers.add(localName);\n }\n }\n }\n }\n }\n\n path.traverse({\n VariableDeclarator(declPath) {\n const init = declPath.node.init;\n if (!init || !t.isCallExpression(init)) return;\n\n const callee = init.callee;\n let calleeName = '';\n if (t.isIdentifier(callee)) {\n calleeName = callee.name;\n } else if (t.isMemberExpression(callee) && t.isIdentifier(callee.property)) {\n calleeName = callee.property.name;\n }\n\n if (SIGNAL_CREATORS.has(calleeName)) {\n const id = declPath.node.id;\n if (t.isIdentifier(id)) {\n state.signalNames.add(id.name);\n } else if (t.isArrayPattern(id)) {\n for (const el of id.elements) {\n if (t.isIdentifier(el)) state.signalNames.add(el.name);\n }\n } else if (t.isObjectPattern(id)) {\n for (const prop of id.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n state.signalNames.add(prop.value.name);\n }\n }\n }\n }\n }\n });\n },\n\n exit(path, state) {\n // Insert template declarations at top of program (hoisted to module scope)\n for (const tmpl of state.templates.reverse()) {\n path.unshiftContainer('body',\n t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier(tmpl.id),\n t.callExpression(t.identifier('_$template'), [t.stringLiteral(tmpl.html)])\n )\n ])\n );\n }\n\n // Build fine-grained imports\n const fgSpecifiers = [];\n if (state.needsTemplate) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$template'), t.identifier('template'))\n );\n }\n if (state.needsInsert) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$insert'), t.identifier('insert'))\n );\n }\n if (state.needsEffect) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$effect'), t.identifier('effect'))\n );\n }\n if (state.needsMapArray) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$mapArray'), t.identifier('mapArray'))\n );\n }\n if (state.needsSpread) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$spread'), t.identifier('spread'))\n );\n }\n if (state.needsSetProp) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setProp'), t.identifier('setProp'))\n );\n }\n if (state.needsCreateComponent) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$createComponent'), t.identifier('_$createComponent'))\n );\n }\n if (state.needsDelegation) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$delegateEvents'), t.identifier('delegateEvents'))\n );\n }\n\n // Core imports (h/Fragment/Island for components)\n const coreSpecifiers = [];\n if (state.needsH) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('h'), t.identifier('h'))\n );\n }\n if (state.needsFragment) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('Fragment'), t.identifier('Fragment'))\n );\n }\n if (state.needsIsland) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('Island'), t.identifier('Island'))\n );\n }\n\n if (fgSpecifiers.length > 0) {\n let existingRenderImport = null;\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node) && (\n node.source.value === 'what-framework/render' ||\n node.source.value === 'what-core/render'\n )) {\n existingRenderImport = node;\n break;\n }\n }\n\n if (existingRenderImport) {\n const existingNames = new Set(\n existingRenderImport.specifiers\n .filter(s => t.isImportSpecifier(s))\n .map(s => s.imported.name)\n );\n for (const spec of fgSpecifiers) {\n if (!existingNames.has(spec.imported.name)) {\n existingRenderImport.specifiers.push(spec);\n }\n }\n } else {\n path.unshiftContainer('body',\n t.importDeclaration(fgSpecifiers, t.stringLiteral('what-framework/render'))\n );\n }\n }\n\n if (coreSpecifiers.length > 0) {\n addCoreImports(path, t, coreSpecifiers);\n }\n\n // Emit event delegation setup call if any delegated events were used\n if (state.needsDelegation && state.delegatedEvents && state.delegatedEvents.size > 0) {\n const eventArray = t.arrayExpression(\n [...state.delegatedEvents].map(e => t.stringLiteral(e))\n );\n path.pushContainer('body',\n t.expressionStatement(\n t.callExpression(t.identifier('_$delegateEvents'), [eventArray])\n )\n );\n }\n }\n },\n\n JSXElement(path, state) {\n // FIX-1: Use scope-aware signal detection instead of file-global.\n // Memoize per Babel scope: every JSXElement in the same scope yields the\n // same signal-name set, so without this the full scope-chain walk ran\n // once per element \u2014 O(n\u00B2) compile time for a large single component.\n // (AUDIT-2026-06-06 H2)\n const scope = path.scope;\n let cache = state._signalNamesCache;\n if (!cache) cache = state._signalNamesCache = new WeakMap();\n let names = cache.get(scope);\n if (!names) {\n names = collectSignalNamesFromScope(path);\n cache.set(scope, names);\n }\n state.signalNames = names;\n state._pendingSetup = [];\n const transformed = transformElementFineGrained(path, state);\n const pending = state._pendingSetup;\n state._pendingSetup = [];\n\n if (pending.length > 0) {\n // Find the enclosing statement to hoist setup before it,\n // but only if it's in the SAME function scope. Crossing into\n // an inner arrow/function (e.g., .map(item => <JSX/>)) would\n // hoist references to closure variables out of scope.\n let stmtPath = path;\n let crossedFunctionBoundary = false;\n while (stmtPath && !stmtPath.isStatement()) {\n if (stmtPath.isArrowFunctionExpression() || stmtPath.isFunctionExpression()) {\n crossedFunctionBoundary = true;\n }\n stmtPath = stmtPath.parentPath;\n }\n // We can safely hoist setup as siblings of `stmtPath` ONLY if\n // `stmtPath` lives inside a statement list (BlockStatement.body or\n // Program.body). For single-statement positions like\n // `if (cond) return <jsx/>;` or `while (x) return <jsx/>;`,\n // Babel's `insertBefore` wraps the parent into a block lazily and\n // multi-statement inserts end up split across scopes, leaving the\n // `_$insert(_el$N, ...)` call outside the block that declares\n // `const _el$N`. This is a TDZ/ReferenceError at runtime.\n //\n // To guarantee that ALL setup statements and the returned reference\n // share one lexical block, require that `stmtPath.listKey` points\n // at a statement list. Otherwise fall through to the IIFE path,\n // which is always safe.\n const inStatementList =\n stmtPath\n && stmtPath.isStatement()\n && (stmtPath.listKey === 'body' || stmtPath.listKey === 'consequent')\n && Array.isArray(stmtPath.container);\n if (inStatementList && !crossedFunctionBoundary) {\n // Same function scope \u2014 safe to hoist setup before the enclosing\n // statement. Works for return statements too: `insertBefore`\n // places setup above `return <jsx/>` without wrapping in an IIFE.\n stmtPath.insertBefore(pending);\n path.replaceWith(transformed);\n } else {\n // Crossed a function boundary or no enclosing statement found \u2014\n // fall back to IIFE so closure variables remain in scope.\n pending.push(t.returnStatement(transformed));\n path.replaceWith(\n t.callExpression(\n t.arrowFunctionExpression([], t.blockStatement(pending)),\n []\n )\n );\n }\n } else {\n path.replaceWith(transformed);\n }\n },\n\n JSXFragment(path, state) {\n const transformed = transformFragmentFineGrained(path, state);\n path.replaceWith(transformed);\n }\n }\n };\n}\n\nfunction addCoreImports(path, t, coreSpecifiers) {\n let existingImport = null;\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node) && (\n node.source.value === 'what-core' || node.source.value === 'what-framework'\n )) {\n existingImport = node;\n break;\n }\n }\n\n if (existingImport) {\n const existingNames = new Set(\n existingImport.specifiers\n .filter(s => t.isImportSpecifier(s))\n .map(s => s.imported.name)\n );\n for (const spec of coreSpecifiers) {\n if (!existingNames.has(spec.imported.name)) {\n existingImport.specifiers.push(spec);\n }\n }\n } else {\n const importDecl = t.importDeclaration(\n coreSpecifiers,\n t.stringLiteral('what-framework')\n );\n path.unshiftContainer('body', importDecl);\n }\n}\n", "/**\n * File-Based Router for What Framework\n *\n * Scans a pages directory and generates route configuration.\n *\n * File conventions:\n * src/pages/index.jsx \u2192 /\n * src/pages/about.jsx \u2192 /about\n * src/pages/blog/index.jsx \u2192 /blog\n * src/pages/blog/[slug].jsx \u2192 /blog/:slug\n * src/pages/[...path].jsx \u2192 catch-all\n * src/pages/_layout.jsx \u2192 layout for that directory\n * src/pages/(auth)/login.jsx \u2192 /login (group doesn't affect URL)\n * src/pages/api/users.js \u2192 API route: /api/users\n *\n * Page declarations (optional export in each page file):\n * export const page = {\n * mode: 'client', // default \u2014 SPA, JS required\n * mode: 'server', // SSR on every request\n * mode: 'static', // pre-rendered at build time\n * mode: 'hybrid', // static HTML shell + interactive islands\n * };\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nconst PAGE_EXTENSIONS = new Set(['.jsx', '.tsx', '.js', '.ts']);\nconst IGNORED_FILES = new Set(['_layout', '_error', '_loading', '_404']);\n\n/**\n * Scan a directory recursively and return all page files.\n */\nexport function scanPages(pagesDir) {\n const pages = [];\n const layouts = [];\n const apiRoutes = [];\n\n function walk(dir, urlPrefix = '') {\n if (!fs.existsSync(dir)) return;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n // Route groups: (name)/ \u2014 strip from URL\n const groupMatch = entry.name.match(/^\\((.+)\\)$/);\n if (groupMatch) {\n walk(fullPath, urlPrefix); // Same URL prefix\n continue;\n }\n\n // API directory\n if (entry.name === 'api' && urlPrefix === '') {\n walkApi(fullPath, '/api');\n continue;\n }\n\n walk(fullPath, urlPrefix + '/' + fileNameToSegment(entry.name));\n continue;\n }\n\n // Only process page extensions\n const ext = path.extname(entry.name);\n if (!PAGE_EXTENSIONS.has(ext)) continue;\n\n const baseName = path.basename(entry.name, ext);\n\n // Layout files\n if (baseName === '_layout') {\n layouts.push({\n filePath: fullPath,\n urlPrefix: urlPrefix || '/',\n });\n continue;\n }\n\n // Error/loading/404 boundaries (reserved names)\n if (IGNORED_FILES.has(baseName)) continue;\n\n // Convert file name to URL segment\n const urlSegment = fileNameToSegment(baseName);\n const routePath = baseName === 'index'\n ? (urlPrefix || '/')\n : urlPrefix + '/' + urlSegment;\n\n pages.push({\n filePath: fullPath,\n routePath: normalizePath(routePath),\n isDynamic: routePath.includes(':') || routePath.includes('*'),\n });\n }\n }\n\n function walkApi(dir, urlPrefix) {\n if (!fs.existsSync(dir)) return;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n walkApi(fullPath, urlPrefix + '/' + fileNameToSegment(entry.name));\n continue;\n }\n\n const ext = path.extname(entry.name);\n if (!PAGE_EXTENSIONS.has(ext)) continue;\n\n const baseName = path.basename(entry.name, ext);\n const segment = fileNameToSegment(baseName);\n const routePath = baseName === 'index'\n ? urlPrefix\n : urlPrefix + '/' + segment;\n\n apiRoutes.push({\n filePath: fullPath,\n routePath: normalizePath(routePath),\n });\n }\n }\n\n walk(pagesDir);\n\n // Sort: static routes first, then dynamic, then catch-all\n pages.sort((a, b) => {\n const aWeight = routeWeight(a.routePath);\n const bWeight = routeWeight(b.routePath);\n return aWeight - bWeight;\n });\n\n return { pages, layouts, apiRoutes };\n}\n\n/**\n * Convert a file name to a URL segment.\n * [slug] \u2192 :slug\n * [...path] \u2192 *path (catch-all)\n * about \u2192 about\n */\nfunction fileNameToSegment(name) {\n // Catch-all: [...param]\n const catchAll = name.match(/^\\[\\.\\.\\.(\\w+)\\]$/);\n if (catchAll) return '*' + catchAll[1];\n\n // Dynamic: [param]\n const dynamic = name.match(/^\\[(\\w+)\\]$/);\n if (dynamic) return ':' + dynamic[1];\n\n // Lowercase page names for URL consistency (About.jsx \u2192 /about)\n return name.toLowerCase();\n}\n\n/**\n * Normalize a route path.\n */\nfunction normalizePath(p) {\n // Remove double slashes\n let result = p.replace(/\\/+/g, '/');\n // Remove trailing slash (except root)\n if (result.length > 1 && result.endsWith('/')) {\n result = result.slice(0, -1);\n }\n return result || '/';\n}\n\n/**\n * Route weight for sorting \u2014 static routes first.\n */\nfunction routeWeight(path) {\n if (path.includes('*')) return 100; // Catch-all last\n if (path.includes(':')) return 10; // Dynamic middle\n return 0; // Static first\n}\n\n/**\n * Extract `export const page = { ... }` from a file's source code.\n * Uses simple regex \u2014 doesn't need a full parser for this.\n */\nexport function extractPageConfig(source) {\n // Match: export const page = { ... }\n // Handles single-line and simple multi-line objects\n const match = source.match(\n /export\\s+const\\s+page\\s*=\\s*(\\{[^}]*\\})/s\n );\n\n if (!match) {\n return { mode: 'client' }; // Default\n }\n\n try {\n // Simple evaluation of the object literal\n // Only supports string/boolean/number literals for safety\n const obj = match[1]\n .replace(/'/g, '\"')\n .replace(/(\\w+)\\s*:/g, '\"$1\":')\n .replace(/,\\s*}/g, '}')\n .replace(/\\/\\/[^\\n]*/g, ''); // Strip comments\n\n return { mode: 'client', ...JSON.parse(obj) };\n } catch {\n return { mode: 'client' };\n }\n}\n\n/**\n * Detect which named exports a page module declares. Functions (loader,\n * getStaticPaths) cannot live in `export const page` (JSON-only), so the codegen\n * imports them as live bindings instead. \\b anchors avoid false positives like\n * `loaderState` or `getStaticPathsHelper`.\n */\nexport function detectPageExports(source) {\n return {\n hasLoader: /export\\s+(?:async\\s+)?(?:const|let|var|function)\\s+loader\\b/.test(source),\n hasGetStaticPaths: /export\\s+(?:async\\s+)?(?:const|let|var|function)\\s+getStaticPaths\\b/.test(source),\n hasPageConfig: /export\\s+const\\s+page\\b/.test(source),\n };\n}\n\n/**\n * Generate the virtual routes module source code.\n * This is what gets imported as 'virtual:what-routes'.\n */\nexport function generateRoutesModule(pagesDir, rootDir) {\n const { pages, layouts, apiRoutes } = scanPages(pagesDir);\n\n const imports = [];\n const routeEntries = [];\n\n // Generate layout imports\n const layoutMap = new Map();\n layouts.forEach((layout, i) => {\n const varName = `_layout${i}`;\n const relPath = toImportPath(layout.filePath, rootDir);\n imports.push(`import ${varName} from '${relPath}';`);\n layoutMap.set(layout.urlPrefix, varName);\n });\n\n // Generate page imports and route entries\n pages.forEach((page, i) => {\n const varName = `_page${i}`;\n const relPath = toImportPath(page.filePath, rootDir);\n imports.push(`import ${varName} from '${relPath}';`);\n\n // Read file to extract page config + detect loader/getStaticPaths exports\n let pageConfig = { mode: 'client' };\n let detected = { hasLoader: false, hasGetStaticPaths: false, hasPageConfig: false };\n try {\n const source = fs.readFileSync(page.filePath, 'utf-8');\n pageConfig = extractPageConfig(source);\n detected = detectPageExports(source);\n } catch {}\n\n // Find matching layout (closest parent)\n const layoutVar = findLayout(page.routePath, layoutMap);\n\n const entry = {\n path: page.routePath,\n component: varName,\n mode: pageConfig.mode || 'client',\n layout: layoutVar || null,\n hasLoader: detected.hasLoader,\n };\n\n routeEntries.push(entry);\n });\n\n // Generate API route entries\n const apiEntries = [];\n apiRoutes.forEach((route, i) => {\n const varName = `_api${i}`;\n const relPath = toImportPath(route.filePath, rootDir);\n imports.push(`import * as ${varName} from '${relPath}';`);\n apiEntries.push({\n path: route.routePath,\n handlers: varName,\n });\n });\n\n // Build the module\n const lines = [\n '// Auto-generated by What Framework file router',\n '// Do not edit \u2014 changes will be overwritten',\n '',\n ...imports,\n '',\n 'export const routes = [',\n ...routeEntries.map(r =>\n ` { path: '${r.path}', component: ${r.component}, mode: '${r.mode}'${r.layout ? `, layout: ${r.layout}` : ''}${r.hasLoader ? ', hasLoader: true' : ''} },`\n ),\n '];',\n '',\n `export const apiRoutes = [`,\n ...apiEntries.map(r =>\n ` { path: '${r.path}', handlers: ${r.handlers} },`\n ),\n '];',\n '',\n // Export page modes for the build system\n 'export const pageModes = {',\n ...routeEntries.map(r =>\n ` '${r.path}': '${r.mode}',`\n ),\n '};',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Generate the SERVER routes module ('virtual:what-routes/server'). Same routes\n * as the client module PLUS live bindings for loader / getStaticPaths / page so\n * the deploy adapter can run them. The client module (above) deliberately omits\n * these so server loaders are never bundled into the browser.\n */\nexport function generateServerRoutesModule(pagesDir, rootDir) {\n const { pages, layouts, apiRoutes } = scanPages(pagesDir);\n\n const imports = [];\n const routeEntries = [];\n\n const layoutMap = new Map();\n layouts.forEach((layout, i) => {\n const varName = `_layout${i}`;\n imports.push(`import ${varName} from '${toImportPath(layout.filePath, rootDir)}';`);\n layoutMap.set(layout.urlPrefix, varName);\n });\n\n pages.forEach((page, i) => {\n const def = `_page${i}`;\n const ns = `_page${i}_ns`;\n const relPath = toImportPath(page.filePath, rootDir);\n\n let pageConfig = { mode: 'client' };\n let detected = { hasLoader: false, hasGetStaticPaths: false, hasPageConfig: false };\n try {\n const source = fs.readFileSync(page.filePath, 'utf-8');\n pageConfig = extractPageConfig(source);\n detected = detectPageExports(source);\n } catch {}\n\n const needsNs = detected.hasLoader || detected.hasGetStaticPaths || detected.hasPageConfig;\n if (needsNs) {\n imports.push(`import ${def}, * as ${ns} from '${relPath}';`);\n } else {\n imports.push(`import ${def} from '${relPath}';`);\n }\n\n routeEntries.push({\n path: page.routePath,\n component: def,\n ns,\n mode: pageConfig.mode || 'client',\n layout: findLayout(page.routePath, layoutMap) || null,\n ...detected,\n });\n });\n\n const apiEntries = [];\n apiRoutes.forEach((route, i) => {\n const varName = `_api${i}`;\n imports.push(`import * as ${varName} from '${toImportPath(route.filePath, rootDir)}';`);\n apiEntries.push({ path: route.routePath, handlers: varName });\n });\n\n const routeLine = (r) =>\n ` { path: '${r.path}', component: ${r.component}, mode: '${r.mode}'` +\n `${r.layout ? `, layout: ${r.layout}` : ''}` +\n `${r.hasLoader ? `, loader: ${r.ns}.loader` : ''}` +\n `${r.hasGetStaticPaths ? `, getStaticPaths: ${r.ns}.getStaticPaths` : ''}` +\n `${r.hasPageConfig ? `, page: ${r.ns}.page` : ''} },`;\n\n const lines = [\n '// Auto-generated by What Framework file router (server)',\n '// Do not edit \u2014 changes will be overwritten',\n '',\n ...imports,\n '',\n 'export const routes = [',\n ...routeEntries.map(routeLine),\n '];',\n '',\n 'export const apiRoutes = [',\n ...apiEntries.map(r => ` { path: '${r.path}', handlers: ${r.handlers} },`),\n '];',\n '',\n 'export const pageModes = {',\n ...routeEntries.map(r => ` '${r.path}': '${r.mode}',`),\n '};',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Convert absolute file path to a root-relative import path.\n */\nfunction toImportPath(filePath, rootDir) {\n const rel = path.relative(rootDir, filePath);\n // Ensure forward slashes and starts with /\n return '/' + rel.split(path.sep).join('/');\n}\n\n/**\n * Find the closest layout for a given route path.\n */\nfunction findLayout(routePath, layoutMap) {\n // Walk up from the route path to find the nearest layout\n const segments = routePath.split('/').filter(Boolean);\n\n while (segments.length > 0) {\n const prefix = '/' + segments.join('/');\n if (layoutMap.has(prefix)) return layoutMap.get(prefix);\n segments.pop();\n }\n\n // Check root layout\n if (layoutMap.has('/')) return layoutMap.get('/');\n return null;\n}\n", "/**\n * What Framework \u2014 Vite Error Overlay\n *\n * Custom error overlay injected during dev mode. Shows compiler transform errors\n * and runtime signal errors with What Framework branding and helpful context.\n *\n * This is client-side code that Vite injects into the page during development.\n *\n * Architecture: The overlay HTML template and all helper functions are inlined as\n * string literals into the custom element code. This avoids function-to-string\n * serialization (which is fragile with minifiers and bundlers).\n */\n\n// CSS for the overlay \u2014 scoped to avoid style conflicts\nconst OVERLAY_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 99999;\n font-family: ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;\n }\n\n .backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.66);\n }\n\n .panel {\n position: fixed;\n inset: 2rem;\n overflow: auto;\n background: #1a1a2e;\n border: 1px solid #2a2a4a;\n border-radius: 12px;\n box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);\n color: #e0e0e0;\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid #2a2a4a;\n background: #16163a;\n border-radius: 12px 12px 0 0;\n }\n\n .header-left {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n }\n\n .header-right {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .logo {\n width: 28px;\n height: 28px;\n background: linear-gradient(135deg, #2563eb, #1d4ed8);\n border-radius: 6px;\n display: grid;\n place-items: center;\n font-weight: 800;\n font-size: 14px;\n color: #fff;\n }\n\n .brand {\n font-size: 14px;\n font-weight: 600;\n color: #a0a0c0;\n }\n\n .tag {\n font-size: 11px;\n padding: 2px 8px;\n border-radius: 4px;\n font-weight: 600;\n }\n\n .tag-error {\n background: #3b1219;\n color: #f87171;\n }\n\n .tag-warning {\n background: #3b2f19;\n color: #fbbf24;\n }\n\n .close-btn, .copy-btn {\n background: none;\n border: 1px solid #3a3a5a;\n color: #a0a0c0;\n border-radius: 6px;\n padding: 4px 12px;\n cursor: pointer;\n font-family: inherit;\n font-size: 12px;\n }\n\n .close-btn:hover, .copy-btn:hover {\n background: #2a2a4a;\n color: #fff;\n }\n\n .copy-btn.copied {\n border-color: #22c55e;\n color: #22c55e;\n }\n\n .body {\n padding: 1.5rem;\n }\n\n .error-title {\n font-size: 16px;\n font-weight: 700;\n color: #f87171;\n margin: 0 0 0.5rem;\n }\n\n .error-message {\n font-size: 14px;\n color: #e0e0e0;\n margin: 0 0 1rem;\n line-height: 1.6;\n white-space: pre-wrap;\n }\n\n .file-path {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 12px;\n color: #818cf8;\n margin-bottom: 1rem;\n padding: 0.25rem 0;\n }\n\n .code-frame {\n background: #0d0d1a;\n border: 1px solid #2a2a4a;\n border-radius: 8px;\n overflow-x: auto;\n margin-bottom: 1rem;\n }\n\n .code-line {\n display: flex;\n padding: 0 1rem;\n font-size: 13px;\n line-height: 1.7;\n }\n\n .code-line.highlight {\n background: rgba(248, 113, 113, 0.1);\n }\n\n .line-number {\n color: #4a4a6a;\n min-width: 3ch;\n text-align: right;\n margin-right: 1rem;\n user-select: none;\n }\n\n .line-content {\n white-space: pre;\n }\n\n .tip {\n margin-top: 1rem;\n padding: 0.75rem 1rem;\n background: #1a2744;\n border: 1px solid #1e3a5f;\n border-radius: 8px;\n font-size: 13px;\n color: #93c5fd;\n line-height: 1.5;\n }\n\n .tip-label {\n font-weight: 700;\n color: #60a5fa;\n }\n\n .stack {\n margin-top: 1rem;\n font-size: 12px;\n color: #6a6a8a;\n white-space: pre-wrap;\n line-height: 1.5;\n }\n`;\n\n/**\n * Client-side overlay component \u2014 injected as a custom element string literal.\n * All helper functions are inlined directly to avoid function.toString() fragility.\n */\nconst OVERLAY_ELEMENT = `\nclass WhatErrorOverlay extends HTMLElement {\n constructor(err) {\n super();\n this.root = this.attachShadow({ mode: 'open' });\n this.root.innerHTML = '<style>${OVERLAY_STYLES}</style>';\n this._err = err;\n this.show(err);\n }\n\n // --- Inlined helper: escapeHTML ---\n _escapeHTML(str) {\n return String(str)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n }\n\n // --- Inlined helper: cleanStack ---\n _cleanStack(stack) {\n return stack\n .split('\\\\n')\n .filter(function(line) { return line.indexOf('node_modules') === -1; })\n .slice(0, 10)\n .join('\\\\n');\n }\n\n // --- Inlined helper: getTip ---\n _getTip(err) {\n var msg = (err.message || '').toLowerCase();\n\n if (msg.indexOf('infinite') !== -1 && msg.indexOf('effect') !== -1) {\n return 'An effect is writing to a signal it also reads. Use untrack() to read without subscribing, or move the write to a different effect.';\n }\n if (msg.indexOf('jsx') !== -1 && msg.indexOf('unexpected') !== -1) {\n return 'Make sure your vite.config includes the What compiler plugin: import what from \"what-compiler/vite\"';\n }\n if (msg.indexOf('not a function') !== -1 && msg.indexOf('signal') !== -1) {\n return 'Signals are functions: call sig() to read, sig(value) to write. Check you are not destructuring a signal.';\n }\n if (msg.indexOf('hydrat') !== -1) {\n return 'Hydration mismatches happen when SSR output differs from client render. Ensure server and client see the same initial state.';\n }\n // New tips for common mistakes\n if (msg.indexOf('signal') !== -1 && msg.indexOf('without') !== -1 && msg.indexOf('call') !== -1) {\n return 'Signals must be called to read their value. Use {count()} in JSX, not {count}. The parentheses trigger the reactive subscription.';\n }\n if (msg.indexOf('innerhtml') !== -1 && msg.indexOf('__html') !== -1) {\n return 'Raw innerHTML is blocked for security. Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.';\n }\n if ((msg.indexOf('innerhtml') !== -1 || msg.indexOf('xss') !== -1) && msg.indexOf('raw string') !== -1) {\n return 'Raw innerHTML is a security risk (XSS). Wrap your HTML in an object: innerHTML={{ __html: yourString }}.';\n }\n if (msg.indexOf('cleanup') !== -1 && (msg.indexOf('effect') !== -1 || msg.indexOf('listener') !== -1)) {\n return 'Effects that add event listeners or timers should return a cleanup function: effect(() => { el.addEventListener(...); return () => el.removeEventListener(...); })';\n }\n if (msg.indexOf('route') !== -1 && (msg.indexOf('not found') !== -1 || msg.indexOf('404') !== -1 || msg.indexOf('no match') !== -1)) {\n return 'No route matched the current URL. Check that your route paths are correct and you have a catch-all or 404 route defined.';\n }\n if (msg.indexOf('key') !== -1 && (msg.indexOf('missing') !== -1 || msg.indexOf('list') !== -1 || msg.indexOf('each') !== -1)) {\n return 'Lists need unique keys for efficient DOM updates. Add a key prop: items.map(item => <Item key={item.id} />)';\n }\n return '';\n }\n\n // --- Build overlay HTML ---\n _buildHTML(err) {\n var isCompilerError = err._isCompilerError || err.plugin === 'vite-plugin-what';\n var type = isCompilerError ? 'Compiler Error' : 'Runtime Error';\n var tagClass = isCompilerError ? 'tag-error' : 'tag-warning';\n\n var codeFrame = '';\n var rawFrame = err.frame || err._frame;\n if (rawFrame) {\n var lines = rawFrame.split('\\\\n');\n var frameLines = '';\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var isHighlight = line.trimStart().startsWith('>');\n var cleaned = line.replace(/^\\\\s*>\\\\s?/, ' ').replace(/^\\\\s{2}/, '');\n var match = cleaned.match(/^(\\\\s*\\\\d+)\\\\s*\\\\|(.*)$/);\n if (match) {\n frameLines += '<div class=\"code-line' + (isHighlight ? ' highlight' : '') + '\"><span class=\"line-number\">' + match[1].trim() + '</span><span class=\"line-content\">' + this._escapeHTML(match[2]) + '</span></div>';\n } else if (cleaned.trim().startsWith('|')) {\n frameLines += '<div class=\"code-line highlight\"><span class=\"line-number\"></span><span class=\"line-content\" style=\"color:#f87171\">' + this._escapeHTML(cleaned.replace(/^\\\\s*\\\\|/, '')) + '</span></div>';\n }\n }\n if (frameLines) {\n codeFrame = '<div class=\"code-frame\">' + frameLines + '</div>';\n }\n }\n\n var filePath = err.id || (err.loc && err.loc.file) || '';\n var lineNum = (err.loc && err.loc.line != null) ? err.loc.line : '';\n var col = (err.loc && err.loc.column != null) ? err.loc.column : '';\n var location = filePath\n ? '<div class=\"file-path\">' + this._escapeHTML(filePath) + (lineNum ? ':' + lineNum : '') + (col ? ':' + col : '') + '</div>'\n : '';\n\n var tip = this._getTip(err);\n var tipHTML = tip ? '<div class=\"tip\"><span class=\"tip-label\">Tip: </span>' + this._escapeHTML(tip) + '</div>' : '';\n\n var stack = (err.stack && !isCompilerError)\n ? '<div class=\"stack\">' + this._escapeHTML(this._cleanStack(err.stack)) + '</div>'\n : '';\n\n return '<div class=\"backdrop\"></div>'\n + '<div class=\"panel\">'\n + '<div class=\"header\">'\n + '<div class=\"header-left\">'\n + '<div class=\"logo\">W</div>'\n + '<span class=\"brand\">What Framework</span>'\n + '<span class=\"tag ' + tagClass + '\">' + type + '</span>'\n + '</div>'\n + '<div class=\"header-right\">'\n + '<button class=\"copy-btn\">Copy Error</button>'\n + '<button class=\"close-btn\">Dismiss (Esc)</button>'\n + '</div>'\n + '</div>'\n + '<div class=\"body\">'\n + '<h2 class=\"error-title\">' + this._escapeHTML(err.name || 'Error') + '</h2>'\n + location\n + '<pre class=\"error-message\">' + this._escapeHTML(err.message || String(err)) + '</pre>'\n + codeFrame\n + tipHTML\n + stack\n + '</div>'\n + '</div>';\n }\n\n show(err) {\n var template = document.createElement('template');\n template.innerHTML = this._buildHTML(err);\n this.root.appendChild(template.content.cloneNode(true));\n\n // Close handlers\n var self = this;\n var closeBtn = this.root.querySelector('.close-btn');\n if (closeBtn) closeBtn.addEventListener('click', function() { self.close(); });\n var backdrop = this.root.querySelector('.backdrop');\n if (backdrop) backdrop.addEventListener('click', function() { self.close(); });\n document.addEventListener('keydown', this._onKey = function(e) {\n if (e.key === 'Escape') self.close();\n });\n\n // Copy Error button\n var copyBtn = this.root.querySelector('.copy-btn');\n if (copyBtn) {\n copyBtn.addEventListener('click', function() {\n self._copyError(copyBtn);\n });\n }\n }\n\n _copyError(btn) {\n var err = this._err;\n var data = {\n name: err.name || 'Error',\n message: err.message || String(err),\n file: err.id || (err.loc && err.loc.file) || null,\n line: (err.loc && err.loc.line != null) ? err.loc.line : null,\n column: (err.loc && err.loc.column != null) ? err.loc.column : null,\n stack: err.stack ? this._cleanStack(err.stack) : null,\n framework: 'What Framework',\n timestamp: new Date().toISOString()\n };\n\n var text = JSON.stringify(data, null, 2);\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(text).then(function() {\n btn.textContent = 'Copied!';\n btn.classList.add('copied');\n setTimeout(function() {\n btn.textContent = 'Copy Error';\n btn.classList.remove('copied');\n }, 2000);\n }).catch(function() {\n // Fallback: select text\n prompt('Copy error details:', text);\n });\n } else {\n prompt('Copy error details:', text);\n }\n }\n\n close() {\n document.removeEventListener('keydown', this._onKey);\n this.remove();\n }\n}\n\nif (!customElements.get('what-error-overlay')) {\n customElements.define('what-error-overlay', WhatErrorOverlay);\n}\n`;\n\n/**\n * Generate the client-side error overlay injection script.\n * Called by the Vite plugin to inject into the dev server.\n */\nexport function getErrorOverlayCode() {\n return OVERLAY_ELEMENT;\n}\n\n/**\n * Create the error overlay middleware for Vite's dev server.\n * Intercepts Vite's error events and shows a custom What-branded overlay.\n */\nexport function setupErrorOverlay(server) {\n // Listen for Vite errors and enrich with What Framework context\n const origSend = server.ws.send.bind(server.ws);\n server.ws.send = function (payload) {\n if (payload?.type === 'error') {\n // Tag compiler errors\n if (payload.err?.plugin === 'vite-plugin-what') {\n payload.err._isCompilerError = true;\n }\n }\n return origSend(payload);\n };\n}\n"],
|
|
5
|
-
"mappings": ";AAUA,OAAOA,WAAU;AACjB,SAAS,qBAAqB;;;ACQ9B,IAAM,kBAAkB,oBAAI,IAAI,CAAC,kBAAkB,mBAAmB,QAAQ,WAAW,WAAW,MAAM,CAAC;AAC3G,IAAM,yBAAyB,oBAAI,IAAI,CAAC,QAAQ,WAAW,SAAS,CAAC;AACrE,IAAM,qBAAqB,oBAAI,IAAI;AAAA,EACjC;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAM;AAAA,EAAO;AAAA,EAAS;AAAA,EAAM;AAAA,EAAO;AAAA,EACnD;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAU;AAAA,EAAS;AAC9C,CAAC;AAKD,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC/B;AAAA,EAAS;AAAA,EAAS;AAAA,EAAU;AAAA,EAAW;AAAA,EAAS;AAAA,EAChD;AAAA,EAAW;AAAA,EAAY;AAAA,EAAa;AACtC,CAAC;AAID,IAAM,oBAAoB,oBAAI,IAAI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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UA4BZ,SAAS,CAAC,kBAAkB,aAAa,iBAAiB,aAAa;AAAA,QACzE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAKA,SAAS,kBAAkB,QAAQ,UAAU;AAE3C,MAAI,oBAAoB,KAAK,MAAM,EAAG,QAAO;AAE7C,MAAI,SAAS,SAAS,SAAS,KAAK,SAAS,SAAS,WAAW,EAAG,QAAO;AAC3E,SAAO;AACT;AAKA,SAAS,cAAc,UAAU;AAC/B,QAAM,WAAWA,MAAK,SAAS,UAAUA,MAAK,QAAQ,QAAQ,CAAC;AAC/D,SAAO,gBAAgB,KAAK,QAAQ;AACtC;AAOA,SAAS,oBAAoB,UAAU;AACrC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAQ4B,KAAK,UAAU,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D;",
|
|
4
|
+
"sourcesContent": ["/**\n * What Framework Vite Plugin\n *\n * 1. Transforms JSX via the What babel plugin\n * 2. Provides file-based routing via virtual:what-routes\n * 3. Watches pages directory for route changes\n * 4. HMR support: component files get granular hot-module replacement,\n * signal/utility files trigger full reload\n */\n\nimport path from 'path';\nimport { transformSync } from '@babel/core';\nimport whatBabelPlugin from './babel-plugin.js';\nimport { generateRoutesModule, scanPages } from './file-router.js';\nimport { setupErrorOverlay } from './error-overlay.js';\n\nconst VIRTUAL_ROUTES_ID = 'virtual:what-routes';\nconst RESOLVED_VIRTUAL_ID = '\\0' + VIRTUAL_ROUTES_ID;\n\n// Pattern: exported function starting with uppercase = component\nconst COMPONENT_EXPORT_RE = /export\\s+(?:default\\s+)?function\\s+([A-Z]\\w*)/;\n// Pattern: files that are likely signal/store/utility files\nconst UTILITY_FILE_RE = /(?:store|signal|state|context|util|helper|lib|config)\\b/i;\n\nexport default function whatVitePlugin(options = {}) {\n const {\n // File extensions to process\n include = /\\.[jt]sx$/,\n // Files to exclude\n exclude = /node_modules/,\n // Enable source maps\n sourceMaps = true,\n // Production optimizations\n production = process.env.NODE_ENV === 'production',\n // Pages directory (relative to project root)\n pages = 'src/pages',\n // HMR: enabled by default in dev, disabled in production\n hot = !production,\n // Resolve the `production` exports condition (dist/*.min.js \u2014 pre-minified,\n // dev warnings compiled out) during `vite build`. Set to false to build\n // against package sources instead \u2014 needed e.g. in a monorepo where\n // workspace-linked dist/ output may be stale or absent. See config() below.\n prodBundles = true,\n } = options;\n\n let rootDir = '';\n let pagesDir = '';\n let server = null;\n let isDevMode = false;\n\n return {\n name: 'vite-plugin-what',\n\n configResolved(config) {\n rootDir = config.root;\n pagesDir = path.resolve(rootDir, pages);\n isDevMode = config.command === 'serve';\n },\n\n configureServer(devServer) {\n server = devServer;\n\n // Set up What-branded error overlay\n setupErrorOverlay(devServer);\n\n // Watch the pages directory for file additions/removals\n devServer.watcher.on('add', (file) => {\n if (file.startsWith(pagesDir)) {\n // Invalidate the virtual routes module\n const mod = devServer.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);\n if (mod) {\n devServer.moduleGraph.invalidateModule(mod);\n devServer.ws.send({ type: 'full-reload' });\n }\n }\n });\n\n devServer.watcher.on('unlink', (file) => {\n if (file.startsWith(pagesDir)) {\n const mod = devServer.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);\n if (mod) {\n devServer.moduleGraph.invalidateModule(mod);\n devServer.ws.send({ type: 'full-reload' });\n }\n }\n });\n },\n\n // Resolve virtual module\n resolveId(id) {\n if (id === VIRTUAL_ROUTES_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n },\n\n // Generate the routes module\n load(id) {\n if (id === RESOLVED_VIRTUAL_ID) {\n return generateRoutesModule(pagesDir, rootDir);\n }\n },\n\n // Transform JSX files\n transform(code, id) {\n // Check if we should process this file\n if (!include.test(id)) return null;\n if (exclude && exclude.test(id)) return null;\n\n try {\n const result = transformSync(code, {\n filename: id,\n sourceMaps,\n // Hermetic transform (SPRINT v0.11 C7): never load the project's\n // babel.config.js/.babelrc. A user's React preset or unrelated\n // plugins corrupting What's JSX output is a debugging nightmare \u2014\n // and scanning the disk for config files on every transform is\n // wasted I/O in dev.\n configFile: false,\n babelrc: false,\n plugins: [\n [whatBabelPlugin, { production }]\n ],\n parserOpts: {\n plugins: ['jsx', 'typescript']\n }\n });\n\n if (!result || !result.code) {\n return null;\n }\n\n let outputCode = result.code;\n\n // HMR: append hot boundary code for component files in dev mode\n if (hot && isDevMode && !production) {\n const isComponentFile = isComponentModule(code, id);\n\n if (isComponentFile) {\n outputCode += generateHMRBoundary(id);\n }\n }\n\n return {\n code: outputCode,\n map: result.map\n };\n } catch (error) {\n // Enrich Babel errors with file context for the error overlay\n error.plugin = 'vite-plugin-what';\n if (!error.id) error.id = id;\n if (error.loc === undefined && error._loc) {\n error.loc = { file: id, line: error._loc.line, column: error._loc.column };\n }\n console.error(`[what] Error transforming ${id}:`, error.message);\n throw error;\n }\n },\n\n // HMR: detect component vs utility files and handle accordingly\n handleHotUpdate({ file, server: devServer, modules }) {\n if (!hot) return;\n\n // Only handle files we process\n if (!include.test(file)) return;\n if (exclude && exclude.test(file)) return;\n\n // Utility/signal/store files: trigger full reload\n // These files may export signals used across multiple components\n if (isUtilityFile(file)) {\n devServer.ws.send({ type: 'full-reload' });\n return [];\n }\n\n // Component files: let Vite handle HMR normally (our boundary code handles it)\n // Return undefined to let Vite's default HMR proceed\n return;\n },\n\n // Configure for development\n config(config, { mode, command }) {\n // SPRINT v0.11 C7: make the `production` exports condition reachable.\n // what-framework/what-core ship pre-minified production bundles behind\n // the `production` condition in their exports maps, but Vite's default\n // resolve conditions never include `production` \u2014 so production builds\n // silently shipped the dev source (larger, with dev-only warnings).\n //\n // Guard rationale (documented choice):\n // - Only during `vite build` in production mode \u2014 dev always uses src\n // so the dev server, HMR, and devtools see un-minified modules.\n // - Opt-out via `what({ prodBundles: false })` \u2014 in a monorepo with\n // workspace-linked packages, dist/ can be stale (or missing before\n // the first `npm run build`), and resolving `production` there would\n // bundle outdated framework code. Apps installing from npm always\n // have dist/ in sync with the published package, so the default is on.\n // - `resolve.conditions` is ADDITIVE in Vite (extra conditions on top\n // of the defaults), so import/browser/default resolution for other\n // packages is unaffected.\n const useProdCondition = command === 'build' && mode === 'production' && prodBundles;\n return {\n ...(useProdCondition ? { resolve: { conditions: ['production'] } } : {}),\n esbuild: {\n // Preserve JSX so our babel plugin handles it -- don't let esbuild transform it\n jsx: 'preserve',\n },\n optimizeDeps: {\n // Exclude framework packages from Vite's dependency pre-bundling.\n //\n // Bug class this prevents \u2014 \"dual module instance\":\n // The compiler emits `import { ... } from 'what-framework/render'`\n // (a subpath resolved to the source file). Meanwhile user code\n // imports `'what-framework'` (the package entry). If Vite\n // pre-bundles `'what-framework'` into an esbuild chunk under\n // node_modules/.vite, those two import paths resolve to two\n // *different* module instances. Module-scoped state \u2014 the\n // `componentStack` used by createComponent, effect ownership,\n // the signal subscriber registry \u2014 is duplicated, so a signal\n // created in user code never notifies effects created via the\n // compiler-emitted path, and `getCurrentComponent()` returns\n // undefined inside components mounted through compiler output.\n //\n // Why `exclude` is the right knob:\n // `include` would force pre-bundling of the package entry, which\n // does not resolve the subpath import the compiler emits \u2014 so the\n // split persists. Using `exclude` tells Vite to skip the optimizer\n // for these packages and serve them via the normal module graph,\n // where both the package entry and the `/render` subpath share\n // a single ESM module record.\n //\n // Regression symptom if this is removed:\n // Components mount but lifecycle hooks (onMount, onCleanup) and\n // shared store state silently no-op; effects don't re-run on\n // signal writes from user code; SSR/CSR hydration mismatches.\n exclude: ['what-framework', 'what-core', 'what-compiler', 'what-router'],\n }\n };\n }\n };\n}\n\n/**\n * Check if a file likely contains a component (has exported function starting with uppercase)\n */\nfunction isComponentModule(source, filePath) {\n // .jsx/.tsx files with component exports\n if (COMPONENT_EXPORT_RE.test(source)) return true;\n // Pages are always component files\n if (filePath.includes('/pages/') || filePath.includes('\\\\pages\\\\')) return true;\n return false;\n}\n\n/**\n * Check if a file is a utility/signal/store file (should trigger full reload)\n */\nfunction isUtilityFile(filePath) {\n const basename = path.basename(filePath, path.extname(filePath));\n return UTILITY_FILE_RE.test(basename);\n}\n\n/**\n * Generate HMR boundary code for a component file.\n * When the module is updated, Vite's HMR runtime calls import.meta.hot.accept(),\n * which re-runs the module. The component re-renders in place.\n */\nfunction generateHMRBoundary(filePath) {\n return `\n\n// --- What Framework HMR Boundary ---\nif (import.meta.hot) {\n import.meta.hot.accept((newModule) => {\n if (newModule) {\n // Signal to the What runtime that this module was hot-updated\n if (window.__WHAT_HMR_ACCEPT__) {\n window.__WHAT_HMR_ACCEPT__(${JSON.stringify(filePath)}, newModule);\n }\n }\n });\n}\n`;\n}\n\n// Named export for compatibility\nexport { whatVitePlugin as what };\n", "/**\n * What Framework Babel Plugin \u2014 Fine-Grained Only\n *\n * JSX \u2192 template() + insert() + effect() calls\n * Static HTML extracted to module-level templates, dynamic expressions wrapped in effects.\n * Components run ONCE. All reactivity is signal-driven.\n *\n * Output:\n * const _tmpl$1 = template('<div class=\"container\"><h1>Title</h1><p></p></div>');\n * function App() {\n * const _el$ = _tmpl$1();\n * insert(_el$.childNodes[1], () => desc());\n * return _el$;\n * }\n *\n * Template calls are hoisted to module scope \u2014 each unique HTML string gets one\n * top-level const. Component functions just clone: `const _el$ = _tmpl$1()`.\n */\n\nconst EVENT_MODIFIERS = new Set(['preventDefault', 'stopPropagation', 'once', 'capture', 'passive', 'self']);\nconst EVENT_OPTION_MODIFIERS = new Set(['once', 'capture', 'passive']);\nconst VOID_HTML_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr'\n]);\n\n// Events that use document-level delegation for performance.\n// The compiler emits `el.$$click = handler` instead of addEventListener.\n// A one-time document listener walks event.target upward to find the handler.\nconst DELEGATED_EVENTS = new Set([\n 'click', 'input', 'change', 'keydown', 'keyup', 'submit',\n 'focusin', 'focusout', 'mousedown', 'mouseup',\n]);\n\n// Known non-reactive call expressions \u2014 these should NOT be wrapped in effects\n// unless their arguments contain signal reads.\nconst SAFE_GLOBAL_CALLS = new Set([\n 'Math', 'Number', 'String', 'Boolean', 'parseInt', 'parseFloat',\n 'isNaN', 'isFinite', 'encodeURIComponent', 'decodeURIComponent',\n 'encodeURI', 'decodeURI', 'JSON', 'Date', 'Array', 'Object',\n 'console', 'RegExp',\n]);\n\n// Known signal-creating functions\nconst SIGNAL_CREATORS = new Set([\n 'useSignal', 'signal', 'computed', 'useComputed', 'useState', 'useReducer',\n 'createResource', 'useSWR', 'useQuery', 'useInfiniteQuery',\n]);\n\n// Normalize JSX text per React/Babel rules:\n// - Split on newlines, treat tabs as spaces.\n// - For interior lines: trim leading and trailing horizontal whitespace.\n// - For the first line: only trim trailing whitespace.\n// - For the last line: only trim leading whitespace.\n// - Skip lines that are entirely whitespace (don't add a separator space).\n// - Join the remaining non-empty lines with single spaces.\n//\n// This preserves leading/trailing single-line whitespace that sits next to\n// an expression like `{count} items` \u2014 without this, the space is eaten and\n// the rendered output reads `5items`.\nfunction normalizeJsxText(value) {\n // Single-line text (no newlines): preserve the original (just tabs->spaces).\n // This keeps the space in cases like `{a} {b}` where the JSXText is \" \".\n if (!/[\\r\\n]/.test(value)) {\n return value.replace(/\\t/g, ' ');\n }\n const lines = value.split(/\\r\\n|\\n|\\r/);\n let lastNonEmpty = -1;\n for (let i = 0; i < lines.length; i++) {\n if (/[^ \\t]/.test(lines[i])) lastNonEmpty = i;\n }\n if (lastNonEmpty === -1) return '';\n let out = '';\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i].replace(/\\t/g, ' ');\n const isFirst = i === 0;\n const isLast = i === lines.length - 1;\n if (!isFirst) line = line.replace(/^ +/, '');\n if (!isLast) line = line.replace(/ +$/, '');\n if (!line) continue;\n if (i !== lastNonEmpty) line += ' ';\n out += line;\n }\n return out;\n}\n\nexport default function whatBabelPlugin({ types: t }) {\n // =====================================================\n // Shared utilities\n // =====================================================\n\n // Warn-once tracking for unknown event modifier segments. Keyed by\n // `${filename}::${segment}` so each typo is reported at most once per file\n // per compile process. Without the filename in the key, the same typo in\n // two different files would silently warn for the first file only \u2014\n // problematic in long-running Vite dev servers.\n const _unknownModifierWarned = new Set();\n const _forInfoWarned = new Set();\n\n function hasEventModifiers(name, state) {\n // Any `__` in an `on*` attribute is intended as modifier syntax \u2014 even\n // if every segment is unknown. Returning false there would emit the\n // attribute as a plain delegated-event property (e.g.\n // `el.$$onclick__totalyWrong = handler`), which never fires. Instead,\n // always route through the modifier-handling branch so the parser can\n // warn about the typo and drop the unknown segments.\n if (!name.includes('__')) return false;\n if (!name.startsWith('on')) return false;\n const parts = name.split('__');\n const tail = parts.slice(1).filter(s => s !== '');\n if (tail.length === 0) return false;\n if (process.env.NODE_ENV !== 'production') {\n const unknown = tail.filter(m => !EVENT_MODIFIERS.has(m));\n const filename = (state && (state.filename || (state.file && state.file.opts && state.file.opts.filename))) || '<unknown>';\n for (const m of unknown) {\n const key = `${filename}::${m}`;\n if (!_unknownModifierWarned.has(key)) {\n _unknownModifierWarned.add(key);\n console.warn(\n `[what-compiler] Unknown event modifier \"__${m}\" in attribute \"${name}\" (${filename}). ` +\n `Known modifiers: ${[...EVENT_MODIFIERS].join(', ')}. ` +\n `Unknown segments are ignored.`\n );\n }\n }\n }\n return true;\n }\n\n function parseEventModifiers(name) {\n // Support both '|' (template strings) and '__' (JSX-safe) as modifier delimiters\n const delimiter = name.includes('|') ? '|' : '__';\n const parts = name.split(delimiter);\n const eventName = parts[0];\n const modifiers = parts.slice(1).filter(m => EVENT_MODIFIERS.has(m));\n return { eventName, modifiers };\n }\n\n function isBindingAttribute(name) {\n return name.startsWith('bind:');\n }\n\n function getBindingProperty(name) {\n return name.slice(5);\n }\n\n function isComponent(name) {\n return /^[A-Z]/.test(name);\n }\n\n function isVoidHtmlElement(name) {\n return VOID_HTML_ELEMENTS.has(String(name).toLowerCase());\n }\n\n function getAttributeValue(value) {\n if (!value) return t.booleanLiteral(true);\n if (t.isJSXExpressionContainer(value)) return value.expression;\n if (t.isStringLiteral(value)) return value;\n return t.stringLiteral(value.value || '');\n }\n\n function normalizeAttrName(attrName) {\n if (attrName === 'className') return 'class';\n if (attrName === 'htmlFor') return 'for';\n return attrName;\n }\n\n // Safely extract attribute name, handling JSXNamespacedName (e.g., client:idle, bind:value)\n function getAttrName(attr) {\n if (t.isJSXNamespacedName(attr.name)) {\n return `${attr.name.namespace.name}:${attr.name.name.name}`;\n }\n return typeof attr.name.name === 'string' ? attr.name.name : String(attr.name.name);\n }\n\n function createEventHandler(handler, modifiers) {\n if (modifiers.length === 0) return handler;\n\n let wrappedHandler = handler;\n\n for (const mod of modifiers) {\n switch (mod) {\n case 'preventDefault':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier('e'), t.identifier('preventDefault')),\n []\n )\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n ])\n );\n break;\n\n case 'stopPropagation':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier('e'), t.identifier('stopPropagation')),\n []\n )\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n ])\n );\n break;\n\n case 'self':\n wrappedHandler = t.arrowFunctionExpression(\n [t.identifier('e')],\n t.blockStatement([\n t.ifStatement(\n t.binaryExpression(\n '===',\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.memberExpression(t.identifier('e'), t.identifier('currentTarget'))\n ),\n t.expressionStatement(\n t.callExpression(wrappedHandler, [t.identifier('e')])\n )\n )\n ])\n );\n break;\n\n case 'once':\n case 'capture':\n case 'passive':\n break;\n }\n }\n\n return wrappedHandler;\n }\n\n // =====================================================\n // Reactivity Detection \u2014 Signal-Aware\n // =====================================================\n\n // Check if an identifier is known to be a signal (from useSignal/signal/computed/useState)\n function isSignalIdentifier(name, signalNames) {\n return signalNames.has(name);\n }\n\n // Collect signal identifiers using Babel's scope analysis.\n // Walks the scope chain from the given path upward, collecting signals\n // defined in each lexical scope (function/block).\n function collectSignalNamesFromScope(path) {\n const signalNames = new Set();\n\n // Helper: extract signal names from a VariableDeclarator node\n function extractFromDeclarator(decl) {\n const init = decl.init;\n if (!init || !t.isCallExpression(init)) return;\n\n const callee = init.callee;\n let calleeName = '';\n if (t.isIdentifier(callee)) {\n calleeName = callee.name;\n } else if (t.isMemberExpression(callee) && t.isIdentifier(callee.property)) {\n calleeName = callee.property.name;\n }\n\n if (SIGNAL_CREATORS.has(calleeName)) {\n const id = decl.id;\n if (t.isIdentifier(id)) {\n signalNames.add(id.name);\n } else if (t.isArrayPattern(id)) {\n for (const el of id.elements) {\n if (t.isIdentifier(el)) signalNames.add(el.name);\n }\n } else if (t.isObjectPattern(id)) {\n for (const prop of id.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n signalNames.add(prop.value.name);\n }\n }\n }\n }\n }\n\n // Walk up the scope chain using Babel's scope API.\n let scope = path.scope;\n while (scope) {\n // Check all variable bindings in this scope.\n for (const binding of Object.values(scope.bindings)) {\n if (binding.path.isVariableDeclarator()) {\n extractFromDeclarator(binding.path.node);\n }\n }\n // Scan this scope's own function params (destructured props) ONCE per\n // scope \u2014 not once per binding. The old per-binding rescan made this\n // O(params \u00D7 bindings) per scope per JSXElement. (AUDIT-2026-06-06 H2)\n const fnNode = scope.path && scope.path.node;\n if (fnNode && fnNode.params) {\n for (const param of fnNode.params) {\n if (t.isObjectPattern(param)) {\n for (const prop of param.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n signalNames.add(prop.value.name);\n } else if (t.isRestElement(prop) && t.isIdentifier(prop.argument)) {\n signalNames.add(prop.argument.name);\n }\n }\n }\n }\n }\n scope = scope.parent;\n }\n\n return signalNames;\n }\n\n // Legacy wrapper for backward compat (used in collectSignalNames calls)\n function collectSignalNames(path) {\n return collectSignalNamesFromScope(path);\n }\n\n // Check if a call expression is a safe (non-reactive) global call\n function isSafeGlobalCall(expr) {\n if (!t.isCallExpression(expr)) return false;\n const callee = expr.callee;\n\n // Math.max(), Number.parseInt(), etc.\n if (t.isMemberExpression(callee) && t.isIdentifier(callee.object)) {\n return SAFE_GLOBAL_CALLS.has(callee.object.name);\n }\n\n // parseInt(), isNaN(), etc.\n if (t.isIdentifier(callee)) {\n return SAFE_GLOBAL_CALLS.has(callee.name);\n }\n\n return false;\n }\n\n // Check if an expression's reactivity is uncertain \u2014 e.g., a non-signal function call\n // whose arguments happen to contain signal reads. The function itself may not produce\n // a reactive result, so the compiler wraps it conservatively.\n function isUncertainReactive(expr, signalNames, importedIds) {\n if (!signalNames) return false;\n if (t.isCallExpression(expr)) {\n // Callee is a known signal \u2014 definitely reactive, not uncertain\n if (t.isIdentifier(expr.callee) && isSignalIdentifier(expr.callee.name, signalNames)) {\n return false;\n }\n // Imported identifier called as function \u2014 definitely reactive (not uncertain)\n if (importedIds && t.isIdentifier(expr.callee) && importedIds.has(expr.callee.name) &&\n !SAFE_GLOBAL_CALLS.has(expr.callee.name)) {\n return false;\n }\n // Callee is a member of a known signal \u2014 definitely reactive\n if (t.isMemberExpression(expr.callee) && t.isIdentifier(expr.callee.object) &&\n isSignalIdentifier(expr.callee.object.name, signalNames)) {\n return false;\n }\n // Safe global call (Math.max, etc.) with reactive args \u2014 still deterministic, not uncertain\n if (isSafeGlobalCall(expr)) return false;\n // Unknown function call \u2014 if args are reactive, the wrapping is uncertain\n if (expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds))) {\n return true;\n }\n }\n return false;\n }\n\n // Check if an expression is potentially reactive (reads a signal)\n // importedIds: Set of identifiers imported from other modules \u2014 any imported\n // function call is conservatively treated as potentially reactive since the\n // imported binding could be a signal from another file.\n function isPotentiallyReactive(expr, signalNames, importedIds) {\n if (!signalNames) signalNames = new Set();\n\n if (t.isCallExpression(expr)) {\n // If callee is a known signal identifier being called (signal read), it's reactive\n if (t.isIdentifier(expr.callee) && isSignalIdentifier(expr.callee.name, signalNames)) {\n return true;\n }\n // Imported identifier called as a function \u2014 conservatively reactive.\n // Handles: import { count } from './store'; ... {count()} in JSX\n if (importedIds && t.isIdentifier(expr.callee) && importedIds.has(expr.callee.name)) {\n // Exclude known safe globals that happen to also be imported\n if (!SAFE_GLOBAL_CALLS.has(expr.callee.name)) {\n return true;\n }\n }\n // member.call() \u2014 e.g., data(), isLoading()\n if (t.isMemberExpression(expr.callee)) {\n // Check if the object is a signal\n if (t.isIdentifier(expr.callee.object) && isSignalIdentifier(expr.callee.object.name, signalNames)) {\n return true;\n }\n }\n // Safe global calls like Math.max \u2014 only reactive if their args are\n if (isSafeGlobalCall(expr)) {\n return expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n // Unknown call \u2014 check if callee or args contain signal reads\n if (t.isIdentifier(expr.callee)) {\n // Could be a function that reads signals internally\n // Be conservative: if it's not a known safe call and not a signal, still check args\n return expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n // For any other call expression, check recursively\n return isPotentiallyReactive(expr.callee, signalNames, importedIds) ||\n expr.arguments.some(arg => isPotentiallyReactive(arg, signalNames, importedIds));\n }\n\n if (t.isIdentifier(expr)) {\n return isSignalIdentifier(expr.name, signalNames) ||\n (importedIds && importedIds.has(expr.name));\n }\n\n if (t.isMemberExpression(expr)) {\n return isPotentiallyReactive(expr.object, signalNames, importedIds);\n }\n\n if (t.isConditionalExpression(expr)) {\n return isPotentiallyReactive(expr.test, signalNames, importedIds) ||\n isPotentiallyReactive(expr.consequent, signalNames, importedIds) ||\n isPotentiallyReactive(expr.alternate, signalNames, importedIds);\n }\n\n if (t.isBinaryExpression(expr) || t.isLogicalExpression(expr)) {\n return isPotentiallyReactive(expr.left, signalNames, importedIds) ||\n isPotentiallyReactive(expr.right, signalNames, importedIds);\n }\n\n if (t.isUnaryExpression(expr)) {\n return isPotentiallyReactive(expr.argument, signalNames, importedIds);\n }\n\n if (t.isTemplateLiteral(expr)) {\n return expr.expressions.some(e => isPotentiallyReactive(e, signalNames, importedIds));\n }\n\n if (t.isObjectExpression(expr)) {\n return expr.properties.some(prop =>\n t.isObjectProperty(prop) && isPotentiallyReactive(prop.value, signalNames, importedIds)\n );\n }\n\n if (t.isArrayExpression(expr)) {\n return expr.elements.some(el => el && isPotentiallyReactive(el, signalNames, importedIds));\n }\n\n if (t.isArrowFunctionExpression(expr) || t.isFunctionExpression(expr)) {\n // Function expressions are not reactive themselves \u2014 they're callbacks\n return false;\n }\n\n return false;\n }\n\n // --- Auto-lower .map() to mapArray ---\n // Detects: source().map((item) => <Comp key={expr} .../>)\n // or wrapped in an arrow: () => source().map(...)\n // Also walks into ternary (cond ? a.map(...) : fallback) and\n // logical (cond && a.map(...)) expressions so React-style\n // conditional list patterns get keyed reconciliation.\n // Produces: _$mapArray(source, (item) => <Comp .../>, { key: item => expr })\n function tryLowerMapToMapArray(expr, state) {\n // Unwrap arrow function: () => source().map(...)\n let mapCall = expr;\n let wrappedInArrow = false;\n if (t.isArrowFunctionExpression(expr) && expr.params.length === 0) {\n mapCall = expr.body;\n wrappedInArrow = true;\n }\n\n // Walk into ternary: cond ? arr().map(...) : fallback\n if (t.isConditionalExpression(mapCall)) {\n const loweredCon = tryLowerMapCall(mapCall.consequent, state);\n const loweredAlt = tryLowerMapCall(mapCall.alternate, state);\n if (loweredCon || loweredAlt) {\n const result = t.conditionalExpression(\n mapCall.test,\n loweredCon || mapCall.consequent,\n loweredAlt || mapCall.alternate\n );\n return wrappedInArrow ? t.arrowFunctionExpression([], result) : result;\n }\n return null;\n }\n\n // Walk into logical: cond && arr().map(...)\n if (t.isLogicalExpression(mapCall) && (mapCall.operator === '&&' || mapCall.operator === '||')) {\n const loweredRight = tryLowerMapCall(mapCall.right, state);\n if (loweredRight) {\n const result = t.logicalExpression(mapCall.operator, mapCall.left, loweredRight);\n return wrappedInArrow ? t.arrowFunctionExpression([], result) : result;\n }\n return null;\n }\n\n // Direct .map() call\n const lowered = tryLowerMapCall(mapCall, state);\n return lowered;\n }\n\n // Core .map() lowering \u2014 extracted so it can be called per-branch\n function tryLowerMapCall(mapCall, state) {\n // Check: something.map(fn)\n if (!t.isCallExpression(mapCall)) return null;\n if (!t.isMemberExpression(mapCall.callee)) return null;\n if (!t.isIdentifier(mapCall.callee.property, { name: 'map' })) return null;\n if (mapCall.arguments.length < 1) return null;\n\n const mapFn = mapCall.arguments[0];\n if (!t.isArrowFunctionExpression(mapFn) && !t.isFunctionExpression(mapFn)) return null;\n\n // Get the map callback's return expression\n let returnExpr = null;\n if (t.isArrowFunctionExpression(mapFn)) {\n if (t.isExpression(mapFn.body)) {\n returnExpr = mapFn.body;\n } else if (t.isBlockStatement(mapFn.body)) {\n const ret = mapFn.body.body.find(s => t.isReturnStatement(s));\n if (ret) returnExpr = ret.argument;\n }\n } else if (t.isFunctionExpression(mapFn)) {\n const ret = mapFn.body.body.find(s => t.isReturnStatement(s));\n if (ret) returnExpr = ret.argument;\n }\n\n if (!returnExpr) return null;\n\n // Check if the return is JSX with a `key` prop\n if (!t.isJSXElement(returnExpr)) return null;\n const attrs = returnExpr.openingElement.attributes;\n let keyAttr = null;\n for (const attr of attrs) {\n if (t.isJSXAttribute(attr) && getAttrName(attr) === 'key') {\n keyAttr = attr;\n break;\n }\n }\n if (!keyAttr) {\n // JSX returned without a key \u2014 bail out, but warn at compile time so\n // users notice they're missing keyed reconciliation. Only warn in dev\n // (production builds are noiseless).\n if (process.env.NODE_ENV !== 'production') {\n const loc = returnExpr.loc;\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.warn(\n `[what-compiler] .map() returning JSX without a \\`key\\` prop at ${fileName}${lineInfo}. ` +\n `Without a key, the list cannot use keyed reconciliation \u2014 items are re-created on every update. ` +\n `Add key={...} to enable efficient updates.`\n );\n }\n return null;\n }\n\n // Extract the key expression\n const keyValue = getAttributeValue(keyAttr.value);\n if (!keyValue) return null;\n\n // Remove the key prop from the JSX element (mapArray handles keying, not the DOM)\n returnExpr.openingElement.attributes = attrs.filter(a => a !== keyAttr);\n\n // Build the source: the object before .map() \u2014 wrap in an arrow for reactive access\n const sourceObj = mapCall.callee.object;\n const source = t.arrowFunctionExpression([], sourceObj);\n\n // Build the key function: (item) => keyExpr.\n // Clone both the parameter and the key expression \u2014 the parameter is shared\n // with the user's map callback AST and keyValue may be referenced elsewhere\n // in the tree. Cloning insulates this new arrow from later mutations.\n const itemParam = mapFn.params[0] ? t.cloneNode(mapFn.params[0], true) : t.identifier('_item');\n const keyFn = t.arrowFunctionExpression([itemParam], t.cloneNode(keyValue, true));\n\n // Build: _$mapArray(source, mapFn, { key: keyFn, raw: true })\n // raw: true means mapFn receives the raw item value (not a signal accessor),\n // matching user-authored .map() semantics where `item.prop` accesses values directly.\n return t.callExpression(t.identifier('_$mapArray'), [\n source,\n mapFn,\n t.objectExpression([\n t.objectProperty(t.identifier('key'), keyFn),\n t.objectProperty(t.identifier('raw'), t.booleanLiteral(true))\n ])\n ]);\n }\n\n // =====================================================\n // Fine-Grained Mode (template + insert + effect)\n // =====================================================\n\n // Check if a JSX child is static (no expressions)\n function isStaticChild(child) {\n if (t.isJSXText(child)) return true;\n if (t.isJSXExpressionContainer(child)) return false;\n if (t.isJSXElement(child)) {\n const el = child.openingElement;\n const tagName = el.name.name;\n if (isComponent(tagName)) return false;\n for (const attr of el.attributes) {\n if (t.isJSXSpreadAttribute(attr)) return false;\n const value = attr.value;\n if (t.isJSXExpressionContainer(value)) return false;\n }\n return child.children.every(isStaticChild);\n }\n return false;\n }\n\n // Check if an attribute value is dynamic\n function isDynamicAttr(attr) {\n if (t.isJSXSpreadAttribute(attr)) return true;\n if (!attr.value) return false;\n return t.isJSXExpressionContainer(attr.value);\n }\n\n // Extract static HTML from JSX element for template()\n function extractStaticHTML(node) {\n if (t.isJSXText(node)) {\n const text = normalizeJsxText(node.value);\n return text ? escapeHTML(text) : '';\n }\n\n if (t.isJSXExpressionContainer(node)) {\n if (t.isJSXEmptyExpression(node.expression)) return '';\n return '<!--$-->';\n }\n\n if (!t.isJSXElement(node)) return '';\n\n const el = node.openingElement;\n const tagName = el.name.name;\n\n if (isComponent(tagName)) return '';\n\n let html = `<${tagName}`;\n\n for (const attr of el.attributes) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const name = getAttrName(attr);\n if (name === 'key') continue;\n if (name.startsWith('on') || name.startsWith('bind:') || name.includes('|')) continue;\n\n let domName = name;\n if (name === 'className') domName = 'class';\n if (name === 'htmlFor') domName = 'for';\n\n if (!attr.value) {\n html += ` ${domName}`;\n } else if (t.isStringLiteral(attr.value)) {\n html += ` ${domName}=\"${escapeAttr(attr.value.value)}\"`;\n } else if (t.isJSXExpressionContainer(attr.value)) {\n continue; // Dynamic attr \u2014 set via effect\n }\n }\n\n const selfClosing = node.openingElement.selfClosing;\n if (selfClosing && isVoidHtmlElement(tagName)) {\n html += '>';\n return html;\n }\n\n if (selfClosing) {\n html += `></${tagName}>`;\n return html;\n }\n\n html += '>';\n\n for (const child of node.children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) html += escapeHTML(text);\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n html += '<!--$-->';\n }\n } else if (t.isJSXElement(child)) {\n if (isComponent(child.openingElement.name.name)) {\n html += '<!--$-->';\n } else {\n html += extractStaticHTML(child);\n }\n }\n }\n\n html += `</${tagName}>`;\n return html;\n }\n\n function escapeHTML(str) {\n return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n }\n\n function escapeAttr(str) {\n return str.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');\n }\n\n // Analyze JSX tree and generate fine-grained output\n function transformElementFineGrained(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const tagName = openingElement.name.name;\n\n // Control flow components \u2014 check before generic isComponent since they start uppercase\n if (tagName === 'For') {\n return transformForFineGrained(path, state);\n }\n if (tagName === 'Show') {\n return transformShowFineGrained(path, state);\n }\n\n if (isComponent(tagName)) {\n return transformComponentFineGrained(path, state);\n }\n\n const attributes = openingElement.attributes;\n const children = node.children;\n\n // Check if this entire subtree is purely static\n const allChildrenStatic = children.every(isStaticChild);\n const allAttrsStatic = attributes.every(attr => !isDynamicAttr(attr));\n const noEvents = attributes.every(attr => {\n if (t.isJSXSpreadAttribute(attr)) return false;\n const name = getAttrName(attr);\n return !name?.startsWith('on') && !name?.startsWith('bind:');\n });\n\n if (allChildrenStatic && allAttrsStatic && noEvents) {\n // Fully static element \u2014 extract to template, return clone call\n const html = extractStaticHTML(node);\n if (html) {\n const tmplId = getOrCreateTemplate(state, html);\n state.needsTemplate = true;\n return t.callExpression(t.identifier(tmplId), []);\n }\n }\n\n // Mixed static/dynamic element \u2014 extract template, add effects for dynamic parts\n const html = extractStaticHTML(node);\n if (!html) {\n // Template extraction failed \u2014 emit a detailed compile warning and use h() as fallback\n const loc = node.loc;\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.warn(\n `[what-compiler] Could not extract template for <${tagName}> at ${fileName}${lineInfo}. ` +\n `Falling back to h() for this element. ` +\n `This element could not be statically analyzed. Consider simplifying the JSX.`\n );\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n const tmplId = getOrCreateTemplate(state, html);\n state.needsTemplate = true;\n\n const elId = state.nextVarId();\n\n // Build statements: _el$ = _tmpl$1()\n // NO IIFE wrapping \u2014 statements are inlined into the containing function\n const statements = [\n t.variableDeclaration('const', [\n t.variableDeclarator(t.identifier(elId), t.callExpression(t.identifier(tmplId), []))\n ])\n ];\n\n // Apply dynamic attributes and events\n applyDynamicAttrs(statements, elId, attributes, state, tagName);\n\n // Handle dynamic children\n applyDynamicChildren(statements, elId, children, node, state);\n\n // Instead of wrapping in an IIFE, store setup statements for hoisting.\n // The JSXElement visitor will insert them before the enclosing statement.\n if (!state._pendingSetup) state._pendingSetup = [];\n state._pendingSetup.push(...statements);\n return t.identifier(elId);\n }\n\n // Fallback: transform element using h() when template extraction fails\n function transformElementAsH(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const tagName = openingElement.name.name;\n const attributes = openingElement.attributes;\n const children = node.children;\n\n const props = [];\n for (const attr of attributes) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const attrName = getAttrName(attr);\n const value = getAttributeValue(attr.value);\n let domAttrName = normalizeAttrName(attrName);\n props.push(\n t.objectProperty(\n /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(domAttrName)\n ? t.identifier(domAttrName)\n : t.stringLiteral(domAttrName),\n value\n )\n );\n }\n\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformedChildren.push(child.expression);\n }\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformedChildren.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n const propsExpr = props.length > 0 ? t.objectExpression(props) : t.nullLiteral();\n return t.callExpression(t.identifier('h'), [t.stringLiteral(tagName), propsExpr, ...transformedChildren]);\n }\n\n // Tags where `value` / `checked` are live DOM properties the user expects a\n // dynamic binding to drive (input.value, select.value, input.checked, ...).\n // Other tags keep the generic setProp path (e.g. <div value={x}> sets an\n // attribute, <li value={n}> hits the `key in el` property branch).\n const VALUE_PROP_TAGS = new Set(['input', 'textarea', 'select', 'option']);\n\n function applyDynamicAttrs(statements, elId, attributes, state, tagName) {\n // Specialized monomorphic setters for statically-known attribute names\n // (SPRINT v0.11 C2). The generic _$setProp re-dispatches on the key string\n // (ref/key/url/class/style/innerHTML/boolean/...) on EVERY reactive update;\n // when the compiler knows the name it emits the direct helper instead.\n // SECURITY: URL attributes (href/src/action/formaction) and innerHTML/\n // dangerouslySetInnerHTML intentionally fall through to _$setProp \u2014 URL\n // sanitization and the { __html } enforcement live there.\n function buildSetPropCall(propName, valueExpr) {\n if (propName === 'class') {\n // normalizeAttrName already mapped className \u2192 class\n state.needsSetClass = true;\n return t.callExpression(t.identifier('_$setClass'), [t.identifier(elId), valueExpr]);\n }\n if (propName === 'style') {\n state.needsSetStyle = true;\n return t.callExpression(t.identifier('_$setStyle'), [t.identifier(elId), valueExpr]);\n }\n if (propName === 'value' && tagName && VALUE_PROP_TAGS.has(tagName)) {\n state.needsSetValue = true;\n return t.callExpression(t.identifier('_$setValue'), [t.identifier(elId), valueExpr]);\n }\n if (propName === 'checked' && tagName === 'input') {\n // Live property write \u2014 matches bind:checked semantics. (The old\n // setAttribute('checked') path only set the DEFAULT-checked state,\n // which stops reflecting once the user has toggled the input.)\n // A helper (not a raw `.checked =`) so function values still get\n // reactive-accessor treatment, like every other setter.\n state.needsSetChecked = true;\n return t.callExpression(t.identifier('_$setChecked'), [t.identifier(elId), valueExpr]);\n }\n if (propName.startsWith('data-') || propName.startsWith('aria-')) {\n state.needsSetAttr = true;\n return t.callExpression(t.identifier('_$setAttr'), [\n t.identifier(elId),\n t.stringLiteral(propName),\n valueExpr\n ]);\n }\n state.needsSetProp = true;\n return t.callExpression(t.identifier('_$setProp'), [\n t.identifier(elId),\n t.stringLiteral(propName),\n valueExpr\n ]);\n }\n\n // Lazy delegation init (C6): the first element of a module that assigns a\n // delegated `$$event` handler also calls the once-guarded _$delegate$()\n // helper at construction time. Emitted at most once per element.\n let delegateInitEmitted = false;\n function emitDelegateInit() {\n if (delegateInitEmitted) return;\n delegateInitEmitted = true;\n statements.push(\n t.expressionStatement(t.callExpression(t.identifier('_$delegate$'), []))\n );\n }\n\n for (const attr of attributes) {\n if (t.isJSXSpreadAttribute(attr)) {\n state.needsSpread = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$spread'), [t.identifier(elId), attr.argument])\n )\n );\n continue;\n }\n\n const attrName = getAttrName(attr);\n\n // Strip key prop \u2014 WhatFW has no virtual DOM, so key is meaningless (issue #6)\n if (attrName === 'key') continue;\n\n // Ref handling \u2014 assign element to ref object/callback\n if (attrName === 'ref') {\n const refExpr = getAttributeValue(attr.value);\n // Generate: typeof ref === 'function' ? ref(el) : ref.current = el\n statements.push(\n t.expressionStatement(\n t.conditionalExpression(\n t.binaryExpression('===',\n t.unaryExpression('typeof', refExpr),\n t.stringLiteral('function')\n ),\n t.callExpression(t.cloneNode(refExpr), [t.identifier(elId)]),\n t.assignmentExpression('=',\n t.memberExpression(t.cloneNode(refExpr), t.identifier('current')),\n t.identifier(elId)\n )\n )\n )\n );\n continue;\n }\n\n // Event handlers\n if (attrName.startsWith('on') && !attrName.includes('|') && !hasEventModifiers(attrName, state)) {\n const event = attrName.slice(2).toLowerCase();\n const handler = getAttributeValue(attr.value);\n\n if (DELEGATED_EVENTS.has(event)) {\n // Use event delegation: el.$$click = handler (matches runtime lookup)\n state.needsDelegation = true;\n if (!state.delegatedEvents) state.delegatedEvents = new Set();\n state.delegatedEvents.add(event);\n emitDelegateInit();\n statements.push(\n t.expressionStatement(\n t.assignmentExpression('=',\n t.memberExpression(\n t.identifier(elId),\n t.identifier(`$$${event}`)\n ),\n handler\n )\n )\n );\n } else {\n // Non-delegated: use per-element addEventListener\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [t.stringLiteral(event), handler]\n )\n )\n );\n }\n continue;\n }\n\n // Event with modifiers (pipe '|' or JSX-safe double underscore '__')\n if (attrName.startsWith('on') && (attrName.includes('|') || hasEventModifiers(attrName, state))) {\n const { eventName, modifiers } = parseEventModifiers(attrName);\n const handler = getAttributeValue(attr.value);\n const wrappedHandler = createEventHandler(handler, modifiers);\n const event = eventName.slice(2).toLowerCase();\n\n const optionMods = modifiers.filter(m => EVENT_OPTION_MODIFIERS.has(m));\n const addEventArgs = [t.stringLiteral(event), wrappedHandler];\n if (optionMods.length > 0) {\n const optsProps = optionMods.map(m =>\n t.objectProperty(t.identifier(m), t.booleanLiteral(true))\n );\n addEventArgs.push(t.objectExpression(optsProps));\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n addEventArgs\n )\n )\n );\n continue;\n }\n\n // Binding\n if (isBindingAttribute(attrName)) {\n const bindProp = getBindingProperty(attrName);\n const signalExpr = attr.value.expression;\n state.needsEffect = true;\n\n if (bindProp === 'value') {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], t.assignmentExpression('=',\n t.memberExpression(t.identifier(elId), t.identifier('value')),\n t.callExpression(t.cloneNode(signalExpr), [])\n ))\n ])\n )\n );\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [\n t.stringLiteral('input'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('value')\n )]\n )\n )\n ]\n )\n )\n );\n } else if (bindProp === 'checked') {\n state.needsEffect = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], t.assignmentExpression('=',\n t.memberExpression(t.identifier(elId), t.identifier('checked')),\n t.callExpression(t.cloneNode(signalExpr), [])\n ))\n ])\n )\n );\n statements.push(\n t.expressionStatement(\n t.callExpression(\n t.memberExpression(t.identifier(elId), t.identifier('addEventListener')),\n [\n t.stringLiteral('change'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('checked')\n )]\n )\n )\n ]\n )\n )\n );\n }\n continue;\n }\n\n // Dynamic attribute (expression)\n if (t.isJSXExpressionContainer(attr.value)) {\n const expr = attr.value.expression;\n const domName = normalizeAttrName(attrName);\n\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n state.needsEffect = true;\n // Auto-invoke bare signal/imported identifiers: value={name} -> name()\n const valueExpr = t.isIdentifier(expr) &&\n (isSignalIdentifier(expr.name, state.signalNames) ||\n (state.importedIdentifiers && state.importedIdentifiers.has(expr.name)))\n ? t.callExpression(expr, [])\n : expr;\n const effectCall = t.callExpression(t.identifier('_$effect'), [\n t.arrowFunctionExpression([], buildSetPropCall(domName, valueExpr))\n ]);\n // In dev mode, add a leading comment when the effect wrapping is uncertain\n // (non-signal function call whose args happen to contain signal reads)\n if (isUncertainReactive(expr, state.signalNames, state.importedIdentifiers)) {\n t.addComment(effectCall, 'leading',\n ' @what-dev: effect wrapping may be unnecessary \u2014 expression contains a non-signal function call with reactive args ',\n false\n );\n }\n statements.push(t.expressionStatement(effectCall));\n } else {\n // Static expression (no signal calls) \u2014 set once\n statements.push(t.expressionStatement(buildSetPropCall(domName, expr)));\n }\n }\n }\n }\n\n // =====================================================\n // Branch Memoization (SPRINT v0.11 C1)\n // =====================================================\n // `_$insert(el, () => cond() ? <A/> : <B/>)` re-creates the taken branch's\n // DOM tree (and re-registers every effect inside it) on EVERY re-evaluation\n // of the insert effect \u2014 including writes to signals read by the condition\n // that do NOT flip which branch is taken (e.g. `count() > 5` while count\n // goes 6 \u2192 7). Solid solves this by memoizing the condition: route the\n // condition through an eager, equality-gated memo so the insert effect\n // depends on the *memo* instead of the raw signals:\n //\n // const _c$0 = _$memo(() => !!(count() > 5));\n // _$insert(_el$, () => _c$0() ? <A/> : <B/>, marker);\n //\n // The memo re-evaluates on every count write, but only NOTIFIES when its\n // value changes \u2014 so branch DOM is recreated exactly on real flips.\n //\n // Semantics preserved:\n // - Ternary tests only matter for truthiness \u2192 memoize `!!test`.\n // - `a && b` / `a || b` render the LEFT operand's VALUE when it\n // short-circuits (`{0 && <div/>}` renders \"0\"), so the left side is\n // memoized by value (Object.is) \u2014 never coerced.\n // - Branch-internal reactivity (signals read inside <A/>) is fine-grained\n // and unaffected; plain-value branches read in the insert arrow are\n // still tracked by the insert effect directly.\n\n // Does this expression produce DOM when evaluated? (raw JSX still present at\n // this stage, or an already-lowered _$mapArray list). Only then is branch\n // memoization worth the extra memo node.\n function buildsDOM(node) {\n if (!node || typeof node !== 'object') return false;\n if (Array.isArray(node)) return node.some(buildsDOM);\n if (node.type === 'JSXElement' || node.type === 'JSXFragment') return true;\n if (node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n (node.callee.name === '_$mapArray' || node.callee.name === 'mapArray')) {\n return true;\n }\n for (const key of Object.keys(node)) {\n if (key === 'loc' || key === 'start' || key === 'end' || key === 'leadingComments' ||\n key === 'trailingComments' || key === 'innerComments') continue;\n const v = node[key];\n if (v && typeof v === 'object' && buildsDOM(v)) return true;\n }\n return false;\n }\n\n // If `expr` is a conditional (ternary / && / ||) with a reactive test and a\n // DOM-producing branch, hoist the test into `const _c$N = _$memo(...)` (pushed\n // onto `statements`) and return the expression rewritten to read the memo.\n // Otherwise returns `expr` unchanged.\n function memoizeBranchCondition(expr, statements, state) {\n let testExpr = null;\n let isTernary = false;\n if (t.isConditionalExpression(expr)) {\n testExpr = expr.test;\n isTernary = true;\n } else if (t.isLogicalExpression(expr) && (expr.operator === '&&' || expr.operator === '||')) {\n testExpr = expr.left;\n } else {\n return expr;\n }\n\n if (!isPotentiallyReactive(testExpr, state.signalNames, state.importedIdentifiers)) return expr;\n\n const branches = isTernary ? [expr.consequent, expr.alternate] : [expr.right];\n if (!branches.some(buildsDOM)) return expr;\n\n const condId = state.nextMemoId();\n state.needsMemo = true;\n // Ternary: only truthiness matters in test position \u2192 gate on !!test so\n // value changes that don't flip truthiness (5 \u2192 6) never notify.\n // Logical: the left VALUE is rendered on short-circuit \u2192 gate on the value.\n const memoBody = isTernary\n ? t.unaryExpression('!', t.unaryExpression('!', testExpr))\n : testExpr;\n statements.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier(condId),\n t.callExpression(t.identifier('_$memo'), [\n t.arrowFunctionExpression([], memoBody)\n ])\n )\n ])\n );\n\n const condRead = t.callExpression(t.identifier(condId), []);\n return isTernary\n ? t.conditionalExpression(condRead, expr.consequent, expr.alternate)\n : t.logicalExpression(expr.operator, condRead, expr.right);\n }\n\n function applyDynamicChildren(statements, elId, children, parentNode, state) {\n // Two-pass approach: first collect all children needing DOM references,\n // then pre-capture markers before any _$insert() calls shift indices.\n // This fixes issue #1: childNodes index shifting with multiple dynamic children.\n\n // --- Pass 1: Scan children and collect entries ---\n const entries = [];\n let childIndex = 0;\n\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) childIndex++;\n continue;\n }\n\n if (t.isJSXExpressionContainer(child)) {\n if (t.isJSXEmptyExpression(child.expression)) continue;\n entries.push({ type: 'expression', child, childIndex });\n childIndex++;\n continue;\n }\n\n if (t.isJSXElement(child)) {\n const childTag = child.openingElement.name.name;\n if (isComponent(childTag) || childTag === 'For' || childTag === 'Show') {\n entries.push({ type: 'component', child, childIndex });\n childIndex++;\n } else {\n const hasAnythingDynamic = child.openingElement.attributes.some(isDynamicAttr) ||\n child.openingElement.attributes.some(a => !t.isJSXSpreadAttribute(a) && getAttrName(a)?.startsWith('on')) ||\n !child.children.every(isStaticChild);\n\n entries.push({ type: 'static', child, childIndex, hasAnythingDynamic });\n childIndex++;\n }\n continue;\n }\n\n if (t.isJSXFragment(child)) {\n entries.push({ type: 'fragment', child });\n }\n }\n\n // --- Pre-capture marker references if needed ---\n // When there are multiple entries needing DOM refs and at least one _$insert(),\n // capture all markers upfront to avoid index shifting after DOM mutations.\n const entriesNeedingRef = entries.filter(e =>\n e.type === 'expression' || e.type === 'component' ||\n (e.type === 'static' && e.hasAnythingDynamic)\n );\n // Pre-capture whenever 2+ children need a DOM ref. Beyond preventing index\n // shift after insert() mutations, the shared O(n) cursor walk below replaces\n // per-child `el.firstChild.nextSibling\u2026`-from-root access, which was O(n\u00B2) in\n // both compile time and emitted size for elements with many dynamic\n // children. (AUDIT-2026-06-06 H2)\n const needsPreCapture = entriesNeedingRef.length >= 2;\n\n const markerVars = new Map(); // childIndex \u2192 variable name\n if (needsPreCapture) {\n // Chain each marker from the PREVIOUS captured cursor instead of\n // re-walking `el.firstChild.nextSibling\u2026` from the root for every child.\n // entriesNeedingRef is in ascending childIndex order, so the per-marker\n // deltas sum to O(n) total instead of O(n\u00B2). This was the dominant\n // quadratic in compile time and emitted-bundle size for large elements.\n // (AUDIT-2026-06-06 H2)\n let prevVar = null;\n let prevIndex = 0;\n for (const entry of entriesNeedingRef) {\n const idx = entry.childIndex;\n const markerVar = state.nextVarId();\n markerVars.set(idx, markerVar);\n let init;\n if (prevVar === null) {\n init = buildChildAccess(elId, idx);\n } else {\n init = t.identifier(prevVar);\n for (let i = prevIndex; i < idx; i++) {\n init = t.memberExpression(init, t.identifier('nextSibling'));\n }\n }\n statements.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(t.identifier(markerVar), init)\n ])\n );\n prevVar = markerVar;\n prevIndex = idx;\n }\n }\n\n // Helper: get a marker reference (pre-captured var or inline access)\n function getMarker(idx) {\n if (markerVars.has(idx)) {\n return t.identifier(markerVars.get(idx));\n }\n return buildChildAccess(elId, idx);\n }\n\n // --- Pass 2: Generate code using stable references ---\n for (const entry of entries) {\n if (entry.type === 'expression') {\n let expr = entry.child.expression;\n const marker = getMarker(entry.childIndex);\n state.needsInsert = true;\n\n // Auto-lower .map() to mapArray when the callback returns keyed JSX.\n // Pattern: source().map(item => <Comp key={...} />) or source().map((item, i) => ...)\n let mapResult = tryLowerMapToMapArray(expr, state);\n if (mapResult) {\n state.needsMapArray = true;\n // A bare _$mapArray(...) call is a self-managing inserter (it tracks\n // its source internally) and an arrow is already reactive \u2014 pass both\n // raw. But when lowering produced a ternary/logical wrapping the call\n // (e.g. cond ? _$mapArray(...) : fallback), the surrounding condition\n // must stay reactive, so wrap the whole expression in () => and let\n // _$insert re-evaluate it on change. Without this the condition is read\n // exactly once and never re-tracks. (AUDIT-2026-06-06 H1)\n const isBareMapArray = t.isCallExpression(mapResult) && t.isIdentifier(mapResult.callee) &&\n (mapResult.callee.name === '_$mapArray' || mapResult.callee.name === 'mapArray');\n const isArrowAlready = t.isArrowFunctionExpression(mapResult);\n // Branch memoization (C1): when the lowered result is a conditional\n // around the list (cond ? _$mapArray(...) : fallback), memoize the\n // condition so non-flip writes don't tear down and recreate the\n // entire list inserter.\n if (isArrowAlready && t.isExpression(mapResult.body)) {\n mapResult.body = memoizeBranchCondition(mapResult.body, statements, state);\n } else if (!isBareMapArray && !isArrowAlready) {\n mapResult = memoizeBranchCondition(mapResult, statements, state);\n }\n const insertArg = (isBareMapArray || isArrowAlready)\n ? mapResult\n : t.arrowFunctionExpression([], mapResult);\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n insertArg,\n marker\n ])\n )\n );\n continue;\n }\n\n // mapArray() calls return self-managing inserters \u2014 pass directly, never wrap in () =>\n const isMapArrayCall = t.isCallExpression(expr) && t.isIdentifier(expr.callee) &&\n (expr.callee.name === 'mapArray' || expr.callee.name === '_$mapArray');\n if (isMapArrayCall) {\n state.needsMapArray = true;\n if (expr.callee.name === 'mapArray') expr.callee.name = '_$mapArray';\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr,\n marker\n ])\n )\n );\n continue;\n }\n\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n // Branch memoization (C1): conditional children only rebuild branch\n // DOM when the condition actually flips.\n expr = memoizeBranchCondition(expr, statements, state);\n const insertCall = t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n t.arrowFunctionExpression([], expr),\n marker\n ]);\n if (isUncertainReactive(expr, state.signalNames, state.importedIdentifiers)) {\n t.addComment(insertCall, 'leading',\n ' @what-dev: reactive wrapping may be unnecessary \u2014 expression contains a non-signal function call with reactive args ',\n false\n );\n }\n statements.push(t.expressionStatement(insertCall));\n } else {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr,\n marker\n ])\n )\n );\n }\n continue;\n }\n\n if (entry.type === 'component') {\n const transformed = transformElementFineGrained({ node: entry.child }, state);\n const marker = getMarker(entry.childIndex);\n state.needsInsert = true;\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n transformed,\n marker\n ])\n )\n );\n continue;\n }\n\n if (entry.type === 'static' && entry.hasAnythingDynamic) {\n // Static child with dynamic content \u2014 get element reference\n let childElRef;\n if (markerVars.has(entry.childIndex)) {\n childElRef = markerVars.get(entry.childIndex);\n } else {\n childElRef = state.nextVarId();\n statements.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier(childElRef),\n buildChildAccess(elId, entry.childIndex)\n )\n ])\n );\n }\n applyDynamicAttrs(statements, childElRef, entry.child.openingElement.attributes, state, entry.child.openingElement.name.name);\n applyDynamicChildren(statements, childElRef, entry.child.children, entry.child, state);\n continue;\n }\n\n if (entry.type === 'fragment') {\n for (const fChild of entry.child.children) {\n if (t.isJSXExpressionContainer(fChild) && !t.isJSXEmptyExpression(fChild.expression)) {\n state.needsInsert = true;\n let expr = fChild.expression;\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n expr = memoizeBranchCondition(expr, statements, state); // (C1)\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n t.arrowFunctionExpression([], expr)\n ])\n )\n );\n } else {\n statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier('_$insert'), [\n t.identifier(elId),\n expr\n ])\n )\n );\n }\n }\n }\n }\n }\n }\n\n function buildChildAccess(elId, index) {\n // Use firstChild/nextSibling chains instead of childNodes[N]\n // This is more robust with whitespace text nodes\n if (index === 0) {\n return t.memberExpression(t.identifier(elId), t.identifier('firstChild'));\n }\n // Chain .nextSibling for subsequent indices\n let expr = t.memberExpression(t.identifier(elId), t.identifier('firstChild'));\n for (let i = 0; i < index; i++) {\n expr = t.memberExpression(expr, t.identifier('nextSibling'));\n }\n return expr;\n }\n\n function transformComponentFineGrained(path, state) {\n const { node } = path;\n const openingElement = node.openingElement;\n const componentName = openingElement.name.name;\n const attributes = openingElement.attributes;\n const children = node.children;\n\n // Check for client: directive (islands)\n let clientDirective = null;\n const filteredAttrs = [];\n\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n // Handle both simple names and namespaced names (client:idle)\n let name;\n if (t.isJSXNamespacedName(attr.name)) {\n name = `${attr.name.namespace.name}:${attr.name.name.name}`;\n } else {\n name = attr.name.name;\n }\n if (name && typeof name === 'string' && name.startsWith('client:')) {\n const mode = name.slice(7);\n if (attr.value) {\n clientDirective = { type: mode, value: attr.value.value };\n } else {\n clientDirective = { type: mode };\n }\n continue;\n }\n }\n filteredAttrs.push(attr);\n }\n\n if (clientDirective) {\n state.needsCreateComponent = true;\n state.needsIsland = true;\n\n const islandProps = [\n t.objectProperty(t.identifier('component'), t.identifier(componentName)),\n t.objectProperty(t.identifier('mode'), t.stringLiteral(clientDirective.type)),\n ];\n\n if (clientDirective.value) {\n islandProps.push(\n t.objectProperty(t.identifier('mediaQuery'), t.stringLiteral(clientDirective.value))\n );\n }\n\n for (const attr of filteredAttrs) {\n if (t.isJSXSpreadAttribute(attr)) continue;\n const attrName = getAttrName(attr);\n const value = getAttributeValue(attr.value);\n islandProps.push(t.objectProperty(t.identifier(attrName), value));\n }\n\n return t.callExpression(\n t.identifier('_$createComponent'),\n [t.identifier('Island'), t.objectExpression(islandProps), t.arrayExpression([])]\n );\n }\n\n // Regular component \u2014 use _$createComponent to instantiate, component runs once\n state.needsCreateComponent = true;\n\n const props = [];\n let hasSpread = false;\n let spreadExpr = null;\n\n for (const attr of filteredAttrs) {\n if (t.isJSXSpreadAttribute(attr)) {\n hasSpread = true;\n spreadExpr = attr.argument;\n continue;\n }\n\n const attrName = getAttrName(attr);\n\n // Strip key prop \u2014 WhatFW has no virtual DOM, so key is meaningless (issue #6)\n if (attrName === 'key') continue;\n\n // Handle bind: attributes for components\n if (isBindingAttribute(attrName)) {\n const bindProp = getBindingProperty(attrName);\n const signalExpr = attr.value.expression;\n\n if (bindProp === 'value') {\n props.push(\n t.objectProperty(t.identifier('value'), t.callExpression(t.cloneNode(signalExpr), []))\n );\n props.push(\n t.objectProperty(\n t.identifier('onInput'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('value')\n )]\n )\n )\n )\n );\n } else if (bindProp === 'checked') {\n props.push(\n t.objectProperty(t.identifier('checked'), t.callExpression(t.cloneNode(signalExpr), []))\n );\n props.push(\n t.objectProperty(\n t.identifier('onChange'),\n t.arrowFunctionExpression(\n [t.identifier('e')],\n t.callExpression(\n t.memberExpression(t.cloneNode(signalExpr), t.identifier('set')),\n [t.memberExpression(\n t.memberExpression(t.identifier('e'), t.identifier('target')),\n t.identifier('checked')\n )]\n )\n )\n )\n );\n }\n continue;\n }\n\n // Handle event modifiers on components\n if (attrName.startsWith('on') && (attrName.includes('|') || hasEventModifiers(attrName, state))) {\n const { eventName, modifiers } = parseEventModifiers(attrName);\n const handler = getAttributeValue(attr.value);\n const wrappedHandler = createEventHandler(handler, modifiers);\n props.push(t.objectProperty(t.identifier(eventName), wrappedHandler));\n continue;\n }\n\n const value = getAttributeValue(attr.value);\n\n props.push(\n t.objectProperty(\n /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(attrName)\n ? t.identifier(attrName)\n : t.stringLiteral(attrName),\n value\n )\n );\n }\n\n // Transform children\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformedChildren.push(child.expression);\n }\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformedChildren.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n let propsExpr;\n if (hasSpread) {\n if (props.length > 0) {\n propsExpr = t.callExpression(\n t.memberExpression(t.identifier('Object'), t.identifier('assign')),\n [t.objectExpression([]), spreadExpr, t.objectExpression(props)]\n );\n } else {\n propsExpr = spreadExpr;\n }\n } else if (props.length > 0) {\n propsExpr = t.objectExpression(props);\n } else {\n propsExpr = t.nullLiteral();\n }\n\n const childrenArray = transformedChildren.length > 0\n ? t.arrayExpression(transformedChildren)\n : t.arrayExpression([]);\n\n return t.callExpression(t.identifier('_$createComponent'), [t.identifier(componentName), propsExpr, childrenArray]);\n }\n\n function transformForFineGrained(path, state) {\n const { node } = path;\n const attributes = node.openingElement.attributes;\n const children = node.children;\n\n // <For each={data} key={item => item.id}>{(item) => <Row />}</For>\n // \u2192 mapArray(data, (item) => ..., { key: item => item.id })\n //\n // NOTE: <For> is supported but .map() with a key prop is the preferred\n // pattern for list rendering. The compiler auto-lowers .map() to\n // _$mapArray with raw mode, which is simpler and matches JS idioms.\n // <For> is useful when you need signal-wrapped item accessors (keyed\n // mode without raw), so that item updates don't recreate DOM nodes.\n if (process.env.NODE_ENV !== 'production') {\n const fileName = state.filename || state.file?.opts?.filename || '<unknown>';\n if (!_forInfoWarned.has(fileName)) {\n _forInfoWarned.add(fileName);\n const loc = node.loc;\n const lineInfo = loc ? `:${loc.start.line}:${loc.start.column}` : '';\n console.info(\n `[what-compiler] <For> at ${fileName}${lineInfo}: consider using .map() with a key prop instead. ` +\n `The compiler auto-lowers .map() to efficient keyed reconciliation. ` +\n `<For> is only needed for signal-wrapped item accessors (advanced).`\n );\n }\n }\n\n let eachExpr = null;\n let keyExpr = null;\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n const name = getAttrName(attr);\n if (name === 'each') eachExpr = getAttributeValue(attr.value);\n else if (name === 'key') keyExpr = getAttributeValue(attr.value);\n }\n }\n\n if (!eachExpr) {\n console.warn('[what-compiler] <For> element missing \"each\" attribute.');\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n let renderFn = null;\n for (const child of children) {\n if (t.isJSXExpressionContainer(child) && !t.isJSXEmptyExpression(child.expression)) {\n renderFn = child.expression;\n break;\n }\n }\n\n if (!renderFn) {\n console.warn('[what-compiler] <For> element missing render function child.');\n state.needsH = true;\n return transformElementAsH(path, state);\n }\n\n state.needsMapArray = true;\n const args = [eachExpr, renderFn];\n if (keyExpr) {\n args.push(t.objectExpression([\n t.objectProperty(t.identifier('key'), keyExpr)\n ]));\n }\n return t.callExpression(t.identifier('_$mapArray'), args);\n }\n\n function transformShowFineGrained(path, state) {\n // <Show when={cond} fallback={alt}>{content}</Show>\n // \u2192 () => cond() ? content : (fallback || null)\n // This compiles to a reactive expression that insert() wraps in an effect.\n const { node } = path;\n const attributes = node.openingElement.attributes;\n const children = node.children;\n\n let whenExpr = null;\n let fallbackExpr = null;\n for (const attr of attributes) {\n if (t.isJSXAttribute(attr)) {\n const name = getAttrName(attr);\n if (name === 'when') whenExpr = getAttributeValue(attr.value);\n else if (name === 'fallback') fallbackExpr = getAttributeValue(attr.value);\n }\n }\n\n if (!whenExpr) {\n // <Show> without a when prop has no defined semantics \u2014 fail loudly at\n // build time so the user fixes their source instead of seeing runtime\n // confusion. buildCodeFrameError pins the error to the JSX location.\n throw path.buildCodeFrameError(\n '<Show> requires a \"when\" prop. Example: <Show when={isOpen} fallback={null}>...</Show>'\n );\n }\n\n // Extract the content \u2014 either a render function child or static JSX children\n let contentExpr = null;\n for (const child of children) {\n if (t.isJSXExpressionContainer(child) && !t.isJSXEmptyExpression(child.expression)) {\n // Render function: {() => <div>...</div>} or {(value) => <div>{value}</div>}\n contentExpr = child.expression;\n break;\n }\n }\n\n if (!contentExpr) {\n // Static children \u2014 collect and transform them\n const transformedChildren = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformedChildren.push(t.stringLiteral(text));\n } else if (t.isJSXElement(child)) {\n transformedChildren.push(transformElementFineGrained({ node: child }, state));\n }\n }\n if (transformedChildren.length === 1) {\n contentExpr = transformedChildren[0];\n } else if (transformedChildren.length > 1) {\n contentExpr = t.arrayExpression(transformedChildren);\n } else {\n contentExpr = t.nullLiteral();\n }\n }\n\n // Build:\n // () => { const _v = <condition>; return _v ? <consequent> : <alternate>; }\n // Hoisting into a local prevents double-evaluation of the `when` signal\n // (the consequent's render callback also needs the resolved value).\n //\n // `whenExpr` shape determines how we form the condition:\n // - call expression \u2192 use as-is <Show when={cond()}>\n // - arrow w/ expression body \u2192 use the body <Show when={() => x > 5}>\n // - identifier that looks like a signal/import <Show when={isOpen}>\n // \u2192 invoke it as accessor: isOpen()\n // - anything else (member, literal, logical, etc.) <Show when={user.isAdmin}>\n // \u2192 use the raw expression. Do NOT invoke \u2014\n // non-functions would throw at runtime.\n let condition;\n if (t.isCallExpression(whenExpr)) {\n condition = whenExpr;\n } else if (t.isArrowFunctionExpression(whenExpr) && t.isExpression(whenExpr.body)) {\n condition = whenExpr.body;\n } else if (\n t.isIdentifier(whenExpr) &&\n (\n (state.signalNames && isSignalIdentifier(whenExpr.name, state.signalNames)) ||\n (state.importedIdentifiers && state.importedIdentifiers.has(whenExpr.name))\n )\n ) {\n condition = t.callExpression(whenExpr, []);\n } else {\n // Plain boolean expression \u2014 member access, literal, logical, etc.\n condition = whenExpr;\n }\n\n const vId = path.scope\n ? path.scope.generateUidIdentifier('v')\n : t.identifier('_v');\n\n const contentIsFn = t.isFunction(contentExpr);\n const consequent = contentIsFn\n ? t.callExpression(contentExpr, [t.cloneNode(vId)])\n : contentExpr;\n const alternate = fallbackExpr || t.nullLiteral();\n\n // Branch memoization (SPRINT v0.11 C1): route a reactive `when` through an\n // equality-gated memo so the insert effect only re-fires (recreating the\n // taken branch's DOM) when the condition actually changes \u2014 not on every\n // write to a signal the condition happens to read.\n // - Render-function children receive the resolved value (`{v => ...}`),\n // so the memo is VALUE-gated (Object.is): identity changes re-render,\n // matching pre-memo semantics.\n // - Static children only use the value for truthiness \u2192 gate on !!cond\n // so e.g. `when={items().length}` doesn't re-render on 2 \u2192 3.\n if (isPotentiallyReactive(condition, state.signalNames, state.importedIdentifiers)) {\n const condId = state.nextMemoId();\n state.needsMemo = true;\n const memoBody = contentIsFn\n ? condition\n : t.unaryExpression('!', t.unaryExpression('!', condition));\n if (!state._pendingSetup) state._pendingSetup = [];\n state._pendingSetup.push(\n t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier(condId),\n t.callExpression(t.identifier('_$memo'), [\n t.arrowFunctionExpression([], memoBody)\n ])\n )\n ])\n );\n condition = t.callExpression(t.identifier(condId), []);\n }\n\n return t.arrowFunctionExpression([], t.blockStatement([\n t.variableDeclaration('const', [\n t.variableDeclarator(vId, condition)\n ]),\n t.returnStatement(\n t.conditionalExpression(t.cloneNode(vId), consequent, alternate)\n )\n ]));\n }\n\n // A fragment-as-root returns an array (or single value) that the runtime\n // mounts element-by-element (createDOM / insert). Unlike the element-child\n // path there's no host element to _$insert into with a marker, so reactive\n // children must instead be emitted as `() => expr` arrows \u2014 the runtime's\n // createDOM/insert treat a function array-item as a reactive binding (it\n // wraps it in an effect with comment markers). Without this, a bare dynamic\n // expression like `{count()}` is evaluated exactly once and never updates.\n //\n // This applies the SAME lowering the element-child expression path uses:\n // - tryLowerMapToMapArray for keyed `items().map(...)` \u2192 _$mapArray\n // - memoizeBranchCondition for reactive ternary/&&/|| (node-identity stable\n // branches: the taken branch's DOM is only rebuilt when the condition\n // actually flips, not on every read of a signal the condition touches)\n // - reactive expressions wrapped in `() =>` so the runtime tracks them\n // Memo (_$memo) declarations are pushed into state._pendingSetup, which\n // transformJsxRoot drains into the enclosing scope. (SPRINT v0.11)\n function lowerFragmentExprChild(expr, state) {\n if (!state._pendingSetup) state._pendingSetup = [];\n const setup = state._pendingSetup;\n\n // Auto-lower .map() to mapArray when the callback returns keyed JSX.\n const mapResult = tryLowerMapToMapArray(expr, state);\n if (mapResult) {\n state.needsMapArray = true;\n // A bare _$mapArray(...) is a self-managing inserter and an arrow is\n // already reactive \u2014 emit as-is. A ternary/logical wrapping the call\n // keeps its condition reactive via a () => wrapper (and memoization).\n const isBareMapArray = t.isCallExpression(mapResult) && t.isIdentifier(mapResult.callee) &&\n (mapResult.callee.name === '_$mapArray' || mapResult.callee.name === 'mapArray');\n const isArrowAlready = t.isArrowFunctionExpression(mapResult);\n if (isArrowAlready && t.isExpression(mapResult.body)) {\n mapResult.body = memoizeBranchCondition(mapResult.body, setup, state);\n return mapResult;\n }\n if (isBareMapArray) return mapResult;\n const memoized = memoizeBranchCondition(mapResult, setup, state);\n return t.arrowFunctionExpression([], memoized);\n }\n\n // mapArray() calls are self-managing inserters \u2014 pass directly.\n const isMapArrayCall = t.isCallExpression(expr) && t.isIdentifier(expr.callee) &&\n (expr.callee.name === 'mapArray' || expr.callee.name === '_$mapArray');\n if (isMapArrayCall) {\n state.needsMapArray = true;\n if (expr.callee.name === 'mapArray') expr.callee.name = '_$mapArray';\n return expr;\n }\n\n if (isPotentiallyReactive(expr, state.signalNames, state.importedIdentifiers)) {\n // Branch memoization (C1): conditional/logical children only rebuild the\n // taken branch's DOM when the condition actually flips.\n expr = memoizeBranchCondition(expr, setup, state);\n return t.arrowFunctionExpression([], expr);\n }\n\n // Static \u2014 emit verbatim.\n return expr;\n }\n\n function transformFragmentFineGrained(path, state) {\n const { node } = path;\n const children = node.children;\n\n const transformed = [];\n for (const child of children) {\n if (t.isJSXText(child)) {\n const text = normalizeJsxText(child.value);\n if (text) transformed.push(t.stringLiteral(text));\n } else if (t.isJSXExpressionContainer(child)) {\n if (!t.isJSXEmptyExpression(child.expression)) {\n transformed.push(lowerFragmentExprChild(child.expression, state));\n }\n } else if (t.isJSXElement(child)) {\n transformed.push(transformElementFineGrained({ node: child }, state));\n } else if (t.isJSXFragment(child)) {\n transformed.push(transformFragmentFineGrained({ node: child }, state));\n }\n }\n\n if (transformed.length === 1) return transformed[0];\n return t.arrayExpression(transformed);\n }\n\n // Template deduplication: same HTML string \u2192 same module-level const\n function getOrCreateTemplate(state, html) {\n if (state.templateMap.has(html)) {\n return state.templateMap.get(html);\n }\n const id = `_tmpl$${state.templateCount++}`;\n state.templateMap.set(html, id);\n state.templates.push({ id, html });\n return id;\n }\n\n // Shared driver for top-level JSX roots (elements AND fragments).\n //\n // transformElementFineGrained does NOT emit IIFEs: it pushes setup\n // statements (`const _el$N = _tmpl$X(); _el$N.$$click = ...; _$insert(...)`)\n // into state._pendingSetup and returns the bare `_el$N` identifier. Whoever\n // visits the JSX root is responsible for draining _pendingSetup and placing\n // those statements somewhere the returned reference can see them.\n //\n // The JSXElement visitor always did this; the JSXFragment visitor did not,\n // so fragments whose element children had dynamic parts (event handlers,\n // dynamic attrs/children) compiled to references to _el$N variables that\n // were never declared \u2014 a runtime ReferenceError. Both visitors now share\n // this driver. (SPRINT v0.11: composes with C1 branch memoization and C2\n // specialized setters \u2014 memo/setter statements ride in _pendingSetup too.)\n function transformJsxRoot(path, state, transform) {\n // FIX-1: Use scope-aware signal detection instead of file-global.\n // Memoize per Babel scope: every JSX root in the same scope yields the\n // same signal-name set, so without this the full scope-chain walk ran\n // once per element \u2014 O(n\u00B2) compile time for a large single component.\n // (AUDIT-2026-06-06 H2)\n const scope = path.scope;\n let cache = state._signalNamesCache;\n if (!cache) cache = state._signalNamesCache = new WeakMap();\n let names = cache.get(scope);\n if (!names) {\n names = collectSignalNamesFromScope(path);\n cache.set(scope, names);\n }\n state.signalNames = names;\n state._pendingSetup = [];\n const transformed = transform(path, state);\n const pending = state._pendingSetup;\n state._pendingSetup = [];\n\n if (pending.length > 0) {\n // Find the enclosing statement to hoist setup before it,\n // but only if it's in the SAME function scope. Crossing into\n // an inner arrow/function (e.g., .map(item => <JSX/>)) would\n // hoist references to closure variables out of scope.\n let stmtPath = path;\n let crossedFunctionBoundary = false;\n while (stmtPath && !stmtPath.isStatement()) {\n if (stmtPath.isArrowFunctionExpression() || stmtPath.isFunctionExpression()) {\n crossedFunctionBoundary = true;\n }\n stmtPath = stmtPath.parentPath;\n }\n // We can safely hoist setup as siblings of `stmtPath` ONLY if\n // `stmtPath` lives inside a statement list (BlockStatement.body or\n // Program.body). For single-statement positions like\n // `if (cond) return <jsx/>;` or `while (x) return <jsx/>;`,\n // Babel's `insertBefore` wraps the parent into a block lazily and\n // multi-statement inserts end up split across scopes, leaving the\n // `_$insert(_el$N, ...)` call outside the block that declares\n // `const _el$N`. This is a TDZ/ReferenceError at runtime.\n //\n // To guarantee that ALL setup statements and the returned reference\n // share one lexical block, require that `stmtPath.listKey` points\n // at a statement list. Otherwise fall through to the IIFE path,\n // which is always safe.\n const inStatementList =\n stmtPath\n && stmtPath.isStatement()\n && (stmtPath.listKey === 'body' || stmtPath.listKey === 'consequent')\n && Array.isArray(stmtPath.container);\n if (inStatementList && !crossedFunctionBoundary) {\n // Same function scope \u2014 safe to hoist setup before the enclosing\n // statement. Works for return statements too: `insertBefore`\n // places setup above `return <jsx/>` without wrapping in an IIFE.\n stmtPath.insertBefore(pending);\n path.replaceWith(transformed);\n } else {\n // Crossed a function boundary or no enclosing statement found \u2014\n // fall back to IIFE so closure variables remain in scope.\n pending.push(t.returnStatement(transformed));\n path.replaceWith(\n t.callExpression(\n t.arrowFunctionExpression([], t.blockStatement(pending)),\n []\n )\n );\n }\n } else {\n path.replaceWith(transformed);\n }\n }\n\n // =====================================================\n // Plugin entry\n // =====================================================\n\n return {\n name: 'what-jsx-transform',\n\n visitor: {\n Program: {\n enter(path, state) {\n // Fine-grained mode state\n state.needsTemplate = false;\n state.needsInsert = false;\n state.needsEffect = false;\n state.needsMapArray = false;\n state.needsSpread = false;\n state.needsSetProp = false;\n state.needsMemo = false; // branch memoization (C1)\n state.needsSetClass = false; // specialized setters (C2)\n state.needsSetStyle = false;\n state.needsSetAttr = false;\n state.needsSetValue = false;\n state.needsSetChecked = false;\n state.needsH = false;\n state.needsCreateComponent = false;\n state.needsFragment = false;\n state.needsIsland = false;\n state.needsDelegation = false;\n state.delegatedEvents = new Set();\n state.templates = [];\n state.templateMap = new Map(); // html \u2192 template id (deduplication)\n state.templateCount = 0;\n state._varCounter = 0;\n state._memoCounter = 0;\n state._pendingSetup = [];\n state.nextVarId = () => `_el$${state._varCounter++}`;\n state.nextMemoId = () => `_c$${state._memoCounter++}`;\n\n // Collect signal names for smart reactivity detection\n state.signalNames = new Set();\n\n // --- Imported Signal Tracking ---\n // Only mark imports as potentially reactive if they come from known\n // reactive sources: what-framework, what-framework/*, relative paths\n // (user stores), or functions matching use*/create* naming conventions.\n // This prevents over-wrapping of utility imports (lodash, etc.).\n state.importedIdentifiers = new Set();\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node)) {\n const source = node.source.value;\n const isReactiveSource =\n source === 'what-framework' ||\n source.startsWith('what-framework/') ||\n source === 'what-core' ||\n source.startsWith('what-core/') ||\n source.startsWith('./') ||\n source.startsWith('../');\n\n for (const spec of node.specifiers) {\n let localName = null;\n if (t.isImportSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n } else if (t.isImportDefaultSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n } else if (t.isImportNamespaceSpecifier(spec) && t.isIdentifier(spec.local)) {\n localName = spec.local.name;\n }\n\n if (localName) {\n // Mark as reactive if from a reactive source, or if the name\n // matches use*/create* conventions (hooks/signal creators)\n if (isReactiveSource || /^(use|create)[A-Z]/.test(localName)) {\n state.importedIdentifiers.add(localName);\n }\n }\n }\n }\n }\n\n path.traverse({\n VariableDeclarator(declPath) {\n const init = declPath.node.init;\n if (!init || !t.isCallExpression(init)) return;\n\n const callee = init.callee;\n let calleeName = '';\n if (t.isIdentifier(callee)) {\n calleeName = callee.name;\n } else if (t.isMemberExpression(callee) && t.isIdentifier(callee.property)) {\n calleeName = callee.property.name;\n }\n\n if (SIGNAL_CREATORS.has(calleeName)) {\n const id = declPath.node.id;\n if (t.isIdentifier(id)) {\n state.signalNames.add(id.name);\n } else if (t.isArrayPattern(id)) {\n for (const el of id.elements) {\n if (t.isIdentifier(el)) state.signalNames.add(el.name);\n }\n } else if (t.isObjectPattern(id)) {\n for (const prop of id.properties) {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.value)) {\n state.signalNames.add(prop.value.name);\n }\n }\n }\n }\n }\n });\n },\n\n exit(path, state) {\n // Insert template declarations at top of program (hoisted to module scope)\n for (const tmpl of state.templates.reverse()) {\n // /* @__PURE__ */ marks the hoisted call as side-effect-free so\n // bundlers (esbuild/rollup/terser) can drop templates whose\n // components are tree-shaken away. (SPRINT v0.11 C6)\n const tmplCall = t.callExpression(t.identifier('_$template'), [t.stringLiteral(tmpl.html)]);\n t.addComment(tmplCall, 'leading', ' @__PURE__ ');\n path.unshiftContainer('body',\n t.variableDeclaration('const', [\n t.variableDeclarator(t.identifier(tmpl.id), tmplCall)\n ])\n );\n }\n\n // Build fine-grained imports\n const fgSpecifiers = [];\n if (state.needsTemplate) {\n // Import the compiler-internal `_$template` export, NOT the public\n // `template` export. The public one warns in dev (\"template() is a\n // compiler internal... XSS\") \u2014 compiled output must never trip that\n // guard; the warning exists for *hand-written* template() calls\n // with dynamic strings. (SPRINT v0.11 C5)\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$template'), t.identifier('_$template'))\n );\n }\n if (state.needsInsert) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$insert'), t.identifier('insert'))\n );\n }\n if (state.needsEffect) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$effect'), t.identifier('effect'))\n );\n }\n if (state.needsMapArray) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$mapArray'), t.identifier('mapArray'))\n );\n }\n if (state.needsSpread) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$spread'), t.identifier('spread'))\n );\n }\n if (state.needsSetProp) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setProp'), t.identifier('setProp'))\n );\n }\n if (state.needsMemo) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$memo'), t.identifier('memo'))\n );\n }\n if (state.needsSetClass) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setClass'), t.identifier('setClass'))\n );\n }\n if (state.needsSetStyle) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setStyle'), t.identifier('setStyle'))\n );\n }\n if (state.needsSetAttr) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setAttr'), t.identifier('setAttr'))\n );\n }\n if (state.needsSetValue) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setValue'), t.identifier('setValue'))\n );\n }\n if (state.needsSetChecked) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$setChecked'), t.identifier('setChecked'))\n );\n }\n if (state.needsCreateComponent) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$createComponent'), t.identifier('_$createComponent'))\n );\n }\n if (state.needsDelegation) {\n fgSpecifiers.push(\n t.importSpecifier(t.identifier('_$delegateEvents'), t.identifier('delegateEvents'))\n );\n }\n\n // Core imports (h/Fragment/Island for components)\n const coreSpecifiers = [];\n if (state.needsH) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('h'), t.identifier('h'))\n );\n }\n if (state.needsFragment) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('Fragment'), t.identifier('Fragment'))\n );\n }\n if (state.needsIsland) {\n coreSpecifiers.push(\n t.importSpecifier(t.identifier('Island'), t.identifier('Island'))\n );\n }\n\n if (fgSpecifiers.length > 0) {\n let existingRenderImport = null;\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node) && (\n node.source.value === 'what-framework/render' ||\n node.source.value === 'what-core/render'\n )) {\n existingRenderImport = node;\n break;\n }\n }\n\n if (existingRenderImport) {\n const existingNames = new Set(\n existingRenderImport.specifiers\n .filter(s => t.isImportSpecifier(s))\n .map(s => s.imported.name)\n );\n for (const spec of fgSpecifiers) {\n if (!existingNames.has(spec.imported.name)) {\n existingRenderImport.specifiers.push(spec);\n }\n }\n } else {\n path.unshiftContainer('body',\n t.importDeclaration(fgSpecifiers, t.stringLiteral('what-framework/render'))\n );\n }\n }\n\n if (coreSpecifiers.length > 0) {\n addCoreImports(path, t, coreSpecifiers);\n }\n\n // Emit LAZY event delegation setup if any delegated events were used.\n // Previously this was a bare module-top-level `_$delegateEvents([...])`\n // call \u2014 a side effect that (a) prevented bundlers from tree-shaking\n // modules whose components are never used, and (b) attached document\n // listeners at import time even when no component ever mounted.\n // Instead we emit a once-guarded helper that each element setup calls\n // at construction time; unused modules carry only dead declarations\n // that DCE removes. (SPRINT v0.11 C6)\n if (state.needsDelegation && state.delegatedEvents && state.delegatedEvents.size > 0) {\n const eventArray = t.arrayExpression(\n [...state.delegatedEvents].map(e => t.stringLiteral(e))\n );\n // function _$delegate$() { if (_$delegated$) return; _$delegated$ = true; _$delegateEvents([...]); }\n const helperFn = t.functionDeclaration(\n t.identifier('_$delegate$'),\n [],\n t.blockStatement([\n t.ifStatement(\n t.identifier('_$delegated$'),\n t.returnStatement()\n ),\n t.expressionStatement(\n t.assignmentExpression('=', t.identifier('_$delegated$'), t.booleanLiteral(true))\n ),\n t.expressionStatement(\n t.callExpression(t.identifier('_$delegateEvents'), [eventArray])\n ),\n ])\n );\n // Unshift so `let _$delegated$ = false` executes before any\n // top-level component construction (e.g. a same-module mount()).\n path.unshiftContainer('body', [\n t.variableDeclaration('let', [\n t.variableDeclarator(t.identifier('_$delegated$'), t.booleanLiteral(false))\n ]),\n helperFn,\n ]);\n }\n }\n },\n\n JSXElement(path, state) {\n transformJsxRoot(path, state, transformElementFineGrained);\n },\n\n JSXFragment(path, state) {\n // Fragments share the element driver: their element children push\n // `const _el$N = ...` setup into _pendingSetup, which MUST be drained\n // here (hoisted or IIFE-wrapped) or the emitted `_el$N` references\n // are never declared (ReferenceError at runtime).\n transformJsxRoot(path, state, transformFragmentFineGrained);\n }\n }\n };\n}\n\nfunction addCoreImports(path, t, coreSpecifiers) {\n let existingImport = null;\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node) && (\n node.source.value === 'what-core' || node.source.value === 'what-framework'\n )) {\n existingImport = node;\n break;\n }\n }\n\n if (existingImport) {\n const existingNames = new Set(\n existingImport.specifiers\n .filter(s => t.isImportSpecifier(s))\n .map(s => s.imported.name)\n );\n for (const spec of coreSpecifiers) {\n if (!existingNames.has(spec.imported.name)) {\n existingImport.specifiers.push(spec);\n }\n }\n } else {\n const importDecl = t.importDeclaration(\n coreSpecifiers,\n t.stringLiteral('what-framework')\n );\n path.unshiftContainer('body', importDecl);\n }\n}\n", "/**\n * File-Based Router for What Framework\n *\n * Scans a pages directory and generates route configuration.\n *\n * File conventions:\n * src/pages/index.jsx \u2192 /\n * src/pages/about.jsx \u2192 /about\n * src/pages/blog/index.jsx \u2192 /blog\n * src/pages/blog/[slug].jsx \u2192 /blog/:slug\n * src/pages/[...path].jsx \u2192 catch-all\n * src/pages/_layout.jsx \u2192 layout for that directory\n * src/pages/(auth)/login.jsx \u2192 /login (group doesn't affect URL)\n * src/pages/api/users.js \u2192 API route: /api/users\n *\n * Page declarations (optional export in each page file):\n * export const page = {\n * mode: 'client', // default \u2014 SPA, JS required\n * mode: 'server', // SSR on every request\n * mode: 'static', // pre-rendered at build time\n * mode: 'hybrid', // static HTML shell + interactive islands\n * };\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nconst PAGE_EXTENSIONS = new Set(['.jsx', '.tsx', '.js', '.ts']);\nconst IGNORED_FILES = new Set(['_layout', '_error', '_loading', '_404']);\n\n/**\n * Scan a directory recursively and return all page files.\n */\nexport function scanPages(pagesDir) {\n const pages = [];\n const layouts = [];\n const apiRoutes = [];\n\n function walk(dir, urlPrefix = '') {\n if (!fs.existsSync(dir)) return;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n // Route groups: (name)/ \u2014 strip from URL\n const groupMatch = entry.name.match(/^\\((.+)\\)$/);\n if (groupMatch) {\n walk(fullPath, urlPrefix); // Same URL prefix\n continue;\n }\n\n // API directory\n if (entry.name === 'api' && urlPrefix === '') {\n walkApi(fullPath, '/api');\n continue;\n }\n\n walk(fullPath, urlPrefix + '/' + fileNameToSegment(entry.name));\n continue;\n }\n\n // Only process page extensions\n const ext = path.extname(entry.name);\n if (!PAGE_EXTENSIONS.has(ext)) continue;\n\n const baseName = path.basename(entry.name, ext);\n\n // Layout files\n if (baseName === '_layout') {\n layouts.push({\n filePath: fullPath,\n urlPrefix: urlPrefix || '/',\n });\n continue;\n }\n\n // Error/loading/404 boundaries (reserved names)\n if (IGNORED_FILES.has(baseName)) continue;\n\n // Convert file name to URL segment\n const urlSegment = fileNameToSegment(baseName);\n const routePath = baseName === 'index'\n ? (urlPrefix || '/')\n : urlPrefix + '/' + urlSegment;\n\n pages.push({\n filePath: fullPath,\n routePath: normalizePath(routePath),\n isDynamic: routePath.includes(':') || routePath.includes('*'),\n });\n }\n }\n\n function walkApi(dir, urlPrefix) {\n if (!fs.existsSync(dir)) return;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n walkApi(fullPath, urlPrefix + '/' + fileNameToSegment(entry.name));\n continue;\n }\n\n const ext = path.extname(entry.name);\n if (!PAGE_EXTENSIONS.has(ext)) continue;\n\n const baseName = path.basename(entry.name, ext);\n const segment = fileNameToSegment(baseName);\n const routePath = baseName === 'index'\n ? urlPrefix\n : urlPrefix + '/' + segment;\n\n apiRoutes.push({\n filePath: fullPath,\n routePath: normalizePath(routePath),\n });\n }\n }\n\n walk(pagesDir);\n\n // Sort: static routes first, then dynamic, then catch-all\n pages.sort((a, b) => {\n const aWeight = routeWeight(a.routePath);\n const bWeight = routeWeight(b.routePath);\n return aWeight - bWeight;\n });\n\n return { pages, layouts, apiRoutes };\n}\n\n/**\n * Convert a file name to a URL segment.\n * [slug] \u2192 :slug\n * [...path] \u2192 *path (catch-all)\n * about \u2192 about\n */\nfunction fileNameToSegment(name) {\n // Catch-all: [...param]\n const catchAll = name.match(/^\\[\\.\\.\\.(\\w+)\\]$/);\n if (catchAll) return '*' + catchAll[1];\n\n // Dynamic: [param]\n const dynamic = name.match(/^\\[(\\w+)\\]$/);\n if (dynamic) return ':' + dynamic[1];\n\n // Lowercase page names for URL consistency (About.jsx \u2192 /about)\n return name.toLowerCase();\n}\n\n/**\n * Normalize a route path.\n */\nfunction normalizePath(p) {\n // Remove double slashes\n let result = p.replace(/\\/+/g, '/');\n // Remove trailing slash (except root)\n if (result.length > 1 && result.endsWith('/')) {\n result = result.slice(0, -1);\n }\n return result || '/';\n}\n\n/**\n * Route weight for sorting \u2014 static routes first.\n */\nfunction routeWeight(path) {\n if (path.includes('*')) return 100; // Catch-all last\n if (path.includes(':')) return 10; // Dynamic middle\n return 0; // Static first\n}\n\n/**\n * Extract `export const page = { ... }` from a file's source code.\n * Uses simple regex \u2014 doesn't need a full parser for this.\n */\nexport function extractPageConfig(source) {\n // Match: export const page = { ... }\n // Handles single-line and simple multi-line objects\n const match = source.match(\n /export\\s+const\\s+page\\s*=\\s*(\\{[^}]*\\})/s\n );\n\n if (!match) {\n return { mode: 'client' }; // Default\n }\n\n try {\n // Simple evaluation of the object literal\n // Only supports string/boolean/number literals for safety\n const obj = match[1]\n .replace(/'/g, '\"')\n .replace(/(\\w+)\\s*:/g, '\"$1\":')\n .replace(/,\\s*}/g, '}')\n .replace(/\\/\\/[^\\n]*/g, ''); // Strip comments\n\n return { mode: 'client', ...JSON.parse(obj) };\n } catch {\n return { mode: 'client' };\n }\n}\n\n/**\n * Detect which named exports a page module declares. Functions (loader,\n * getStaticPaths) cannot live in `export const page` (JSON-only), so the codegen\n * imports them as live bindings instead. \\b anchors avoid false positives like\n * `loaderState` or `getStaticPathsHelper`.\n */\nexport function detectPageExports(source) {\n return {\n hasLoader: /export\\s+(?:async\\s+)?(?:const|let|var|function)\\s+loader\\b/.test(source),\n hasGetStaticPaths: /export\\s+(?:async\\s+)?(?:const|let|var|function)\\s+getStaticPaths\\b/.test(source),\n hasPageConfig: /export\\s+const\\s+page\\b/.test(source),\n };\n}\n\n/**\n * Generate the virtual routes module source code.\n * This is what gets imported as 'virtual:what-routes'.\n */\nexport function generateRoutesModule(pagesDir, rootDir) {\n const { pages, layouts, apiRoutes } = scanPages(pagesDir);\n\n const imports = [];\n const routeEntries = [];\n\n // Generate layout imports\n const layoutMap = new Map();\n layouts.forEach((layout, i) => {\n const varName = `_layout${i}`;\n const relPath = toImportPath(layout.filePath, rootDir);\n imports.push(`import ${varName} from '${relPath}';`);\n layoutMap.set(layout.urlPrefix, varName);\n });\n\n // Generate page imports and route entries\n pages.forEach((page, i) => {\n const varName = `_page${i}`;\n const relPath = toImportPath(page.filePath, rootDir);\n imports.push(`import ${varName} from '${relPath}';`);\n\n // Read file to extract page config + detect loader/getStaticPaths exports\n let pageConfig = { mode: 'client' };\n let detected = { hasLoader: false, hasGetStaticPaths: false, hasPageConfig: false };\n try {\n const source = fs.readFileSync(page.filePath, 'utf-8');\n pageConfig = extractPageConfig(source);\n detected = detectPageExports(source);\n } catch {}\n\n // Find matching layout (closest parent)\n const layoutVar = findLayout(page.routePath, layoutMap);\n\n const entry = {\n path: page.routePath,\n component: varName,\n mode: pageConfig.mode || 'client',\n layout: layoutVar || null,\n hasLoader: detected.hasLoader,\n };\n\n routeEntries.push(entry);\n });\n\n // Generate API route entries\n const apiEntries = [];\n apiRoutes.forEach((route, i) => {\n const varName = `_api${i}`;\n const relPath = toImportPath(route.filePath, rootDir);\n imports.push(`import * as ${varName} from '${relPath}';`);\n apiEntries.push({\n path: route.routePath,\n handlers: varName,\n });\n });\n\n // Build the module\n const lines = [\n '// Auto-generated by What Framework file router',\n '// Do not edit \u2014 changes will be overwritten',\n '',\n ...imports,\n '',\n 'export const routes = [',\n ...routeEntries.map(r =>\n ` { path: '${r.path}', component: ${r.component}, mode: '${r.mode}'${r.layout ? `, layout: ${r.layout}` : ''}${r.hasLoader ? ', hasLoader: true' : ''} },`\n ),\n '];',\n '',\n `export const apiRoutes = [`,\n ...apiEntries.map(r =>\n ` { path: '${r.path}', handlers: ${r.handlers} },`\n ),\n '];',\n '',\n // Export page modes for the build system\n 'export const pageModes = {',\n ...routeEntries.map(r =>\n ` '${r.path}': '${r.mode}',`\n ),\n '};',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Generate the SERVER routes module ('virtual:what-routes/server'). Same routes\n * as the client module PLUS live bindings for loader / getStaticPaths / page so\n * the deploy adapter can run them. The client module (above) deliberately omits\n * these so server loaders are never bundled into the browser.\n */\nexport function generateServerRoutesModule(pagesDir, rootDir) {\n const { pages, layouts, apiRoutes } = scanPages(pagesDir);\n\n const imports = [];\n const routeEntries = [];\n\n const layoutMap = new Map();\n layouts.forEach((layout, i) => {\n const varName = `_layout${i}`;\n imports.push(`import ${varName} from '${toImportPath(layout.filePath, rootDir)}';`);\n layoutMap.set(layout.urlPrefix, varName);\n });\n\n pages.forEach((page, i) => {\n const def = `_page${i}`;\n const ns = `_page${i}_ns`;\n const relPath = toImportPath(page.filePath, rootDir);\n\n let pageConfig = { mode: 'client' };\n let detected = { hasLoader: false, hasGetStaticPaths: false, hasPageConfig: false };\n try {\n const source = fs.readFileSync(page.filePath, 'utf-8');\n pageConfig = extractPageConfig(source);\n detected = detectPageExports(source);\n } catch {}\n\n const needsNs = detected.hasLoader || detected.hasGetStaticPaths || detected.hasPageConfig;\n if (needsNs) {\n imports.push(`import ${def}, * as ${ns} from '${relPath}';`);\n } else {\n imports.push(`import ${def} from '${relPath}';`);\n }\n\n routeEntries.push({\n path: page.routePath,\n component: def,\n ns,\n mode: pageConfig.mode || 'client',\n layout: findLayout(page.routePath, layoutMap) || null,\n ...detected,\n });\n });\n\n const apiEntries = [];\n apiRoutes.forEach((route, i) => {\n const varName = `_api${i}`;\n imports.push(`import * as ${varName} from '${toImportPath(route.filePath, rootDir)}';`);\n apiEntries.push({ path: route.routePath, handlers: varName });\n });\n\n const routeLine = (r) =>\n ` { path: '${r.path}', component: ${r.component}, mode: '${r.mode}'` +\n `${r.layout ? `, layout: ${r.layout}` : ''}` +\n `${r.hasLoader ? `, loader: ${r.ns}.loader` : ''}` +\n `${r.hasGetStaticPaths ? `, getStaticPaths: ${r.ns}.getStaticPaths` : ''}` +\n `${r.hasPageConfig ? `, page: ${r.ns}.page` : ''} },`;\n\n const lines = [\n '// Auto-generated by What Framework file router (server)',\n '// Do not edit \u2014 changes will be overwritten',\n '',\n ...imports,\n '',\n 'export const routes = [',\n ...routeEntries.map(routeLine),\n '];',\n '',\n 'export const apiRoutes = [',\n ...apiEntries.map(r => ` { path: '${r.path}', handlers: ${r.handlers} },`),\n '];',\n '',\n 'export const pageModes = {',\n ...routeEntries.map(r => ` '${r.path}': '${r.mode}',`),\n '};',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Convert absolute file path to a root-relative import path.\n */\nfunction toImportPath(filePath, rootDir) {\n const rel = path.relative(rootDir, filePath);\n // Ensure forward slashes and starts with /\n return '/' + rel.split(path.sep).join('/');\n}\n\n/**\n * Find the closest layout for a given route path.\n */\nfunction findLayout(routePath, layoutMap) {\n // Walk up from the route path to find the nearest layout\n const segments = routePath.split('/').filter(Boolean);\n\n while (segments.length > 0) {\n const prefix = '/' + segments.join('/');\n if (layoutMap.has(prefix)) return layoutMap.get(prefix);\n segments.pop();\n }\n\n // Check root layout\n if (layoutMap.has('/')) return layoutMap.get('/');\n return null;\n}\n", "/**\n * What Framework \u2014 Vite Error Overlay\n *\n * Custom error overlay injected during dev mode. Shows compiler transform errors\n * and runtime signal errors with What Framework branding and helpful context.\n *\n * This is client-side code that Vite injects into the page during development.\n *\n * Architecture: The overlay HTML template and all helper functions are inlined as\n * string literals into the custom element code. This avoids function-to-string\n * serialization (which is fragile with minifiers and bundlers).\n */\n\n// CSS for the overlay \u2014 scoped to avoid style conflicts\nconst OVERLAY_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 99999;\n font-family: ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;\n }\n\n .backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.66);\n }\n\n .panel {\n position: fixed;\n inset: 2rem;\n overflow: auto;\n background: #1a1a2e;\n border: 1px solid #2a2a4a;\n border-radius: 12px;\n box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);\n color: #e0e0e0;\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid #2a2a4a;\n background: #16163a;\n border-radius: 12px 12px 0 0;\n }\n\n .header-left {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n }\n\n .header-right {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .logo {\n width: 28px;\n height: 28px;\n background: linear-gradient(135deg, #2563eb, #1d4ed8);\n border-radius: 6px;\n display: grid;\n place-items: center;\n font-weight: 800;\n font-size: 14px;\n color: #fff;\n }\n\n .brand {\n font-size: 14px;\n font-weight: 600;\n color: #a0a0c0;\n }\n\n .tag {\n font-size: 11px;\n padding: 2px 8px;\n border-radius: 4px;\n font-weight: 600;\n }\n\n .tag-error {\n background: #3b1219;\n color: #f87171;\n }\n\n .tag-warning {\n background: #3b2f19;\n color: #fbbf24;\n }\n\n .close-btn, .copy-btn {\n background: none;\n border: 1px solid #3a3a5a;\n color: #a0a0c0;\n border-radius: 6px;\n padding: 4px 12px;\n cursor: pointer;\n font-family: inherit;\n font-size: 12px;\n }\n\n .close-btn:hover, .copy-btn:hover {\n background: #2a2a4a;\n color: #fff;\n }\n\n .copy-btn.copied {\n border-color: #22c55e;\n color: #22c55e;\n }\n\n .body {\n padding: 1.5rem;\n }\n\n .error-title {\n font-size: 16px;\n font-weight: 700;\n color: #f87171;\n margin: 0 0 0.5rem;\n }\n\n .error-message {\n font-size: 14px;\n color: #e0e0e0;\n margin: 0 0 1rem;\n line-height: 1.6;\n white-space: pre-wrap;\n }\n\n .file-path {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 12px;\n color: #818cf8;\n margin-bottom: 1rem;\n padding: 0.25rem 0;\n }\n\n .code-frame {\n background: #0d0d1a;\n border: 1px solid #2a2a4a;\n border-radius: 8px;\n overflow-x: auto;\n margin-bottom: 1rem;\n }\n\n .code-line {\n display: flex;\n padding: 0 1rem;\n font-size: 13px;\n line-height: 1.7;\n }\n\n .code-line.highlight {\n background: rgba(248, 113, 113, 0.1);\n }\n\n .line-number {\n color: #4a4a6a;\n min-width: 3ch;\n text-align: right;\n margin-right: 1rem;\n user-select: none;\n }\n\n .line-content {\n white-space: pre;\n }\n\n .tip {\n margin-top: 1rem;\n padding: 0.75rem 1rem;\n background: #1a2744;\n border: 1px solid #1e3a5f;\n border-radius: 8px;\n font-size: 13px;\n color: #93c5fd;\n line-height: 1.5;\n }\n\n .tip-label {\n font-weight: 700;\n color: #60a5fa;\n }\n\n .stack {\n margin-top: 1rem;\n font-size: 12px;\n color: #6a6a8a;\n white-space: pre-wrap;\n line-height: 1.5;\n }\n`;\n\n/**\n * Client-side overlay component \u2014 injected as a custom element string literal.\n * All helper functions are inlined directly to avoid function.toString() fragility.\n */\nconst OVERLAY_ELEMENT = `\nclass WhatErrorOverlay extends HTMLElement {\n constructor(err) {\n super();\n this.root = this.attachShadow({ mode: 'open' });\n this.root.innerHTML = '<style>${OVERLAY_STYLES}</style>';\n this._err = err;\n this.show(err);\n }\n\n // --- Inlined helper: escapeHTML ---\n _escapeHTML(str) {\n return String(str)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n }\n\n // --- Inlined helper: cleanStack ---\n _cleanStack(stack) {\n return stack\n .split('\\\\n')\n .filter(function(line) { return line.indexOf('node_modules') === -1; })\n .slice(0, 10)\n .join('\\\\n');\n }\n\n // --- Inlined helper: getTip ---\n _getTip(err) {\n var msg = (err.message || '').toLowerCase();\n\n if (msg.indexOf('infinite') !== -1 && msg.indexOf('effect') !== -1) {\n return 'An effect is writing to a signal it also reads. Use untrack() to read without subscribing, or move the write to a different effect.';\n }\n if (msg.indexOf('jsx') !== -1 && msg.indexOf('unexpected') !== -1) {\n return 'Make sure your vite.config includes the What compiler plugin: import what from \"what-compiler/vite\"';\n }\n if (msg.indexOf('not a function') !== -1 && msg.indexOf('signal') !== -1) {\n return 'Signals are functions: call sig() to read, sig(value) to write. Check you are not destructuring a signal.';\n }\n if (msg.indexOf('hydrat') !== -1) {\n return 'Hydration mismatches happen when SSR output differs from client render. Ensure server and client see the same initial state.';\n }\n // New tips for common mistakes\n if (msg.indexOf('signal') !== -1 && msg.indexOf('without') !== -1 && msg.indexOf('call') !== -1) {\n return 'Signals must be called to read their value. Use {count()} in JSX, not {count}. The parentheses trigger the reactive subscription.';\n }\n if (msg.indexOf('innerhtml') !== -1 && msg.indexOf('__html') !== -1) {\n return 'Raw innerHTML is blocked for security. Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.';\n }\n if ((msg.indexOf('innerhtml') !== -1 || msg.indexOf('xss') !== -1) && msg.indexOf('raw string') !== -1) {\n return 'Raw innerHTML is a security risk (XSS). Wrap your HTML in an object: innerHTML={{ __html: yourString }}.';\n }\n if (msg.indexOf('cleanup') !== -1 && (msg.indexOf('effect') !== -1 || msg.indexOf('listener') !== -1)) {\n return 'Effects that add event listeners or timers should return a cleanup function: effect(() => { el.addEventListener(...); return () => el.removeEventListener(...); })';\n }\n if (msg.indexOf('route') !== -1 && (msg.indexOf('not found') !== -1 || msg.indexOf('404') !== -1 || msg.indexOf('no match') !== -1)) {\n return 'No route matched the current URL. Check that your route paths are correct and you have a catch-all or 404 route defined.';\n }\n if (msg.indexOf('key') !== -1 && (msg.indexOf('missing') !== -1 || msg.indexOf('list') !== -1 || msg.indexOf('each') !== -1)) {\n return 'Lists need unique keys for efficient DOM updates. Add a key prop: items.map(item => <Item key={item.id} />)';\n }\n return '';\n }\n\n // --- Build overlay HTML ---\n _buildHTML(err) {\n var isCompilerError = err._isCompilerError || err.plugin === 'vite-plugin-what';\n var type = isCompilerError ? 'Compiler Error' : 'Runtime Error';\n var tagClass = isCompilerError ? 'tag-error' : 'tag-warning';\n\n var codeFrame = '';\n var rawFrame = err.frame || err._frame;\n if (rawFrame) {\n var lines = rawFrame.split('\\\\n');\n var frameLines = '';\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var isHighlight = line.trimStart().startsWith('>');\n var cleaned = line.replace(/^\\\\s*>\\\\s?/, ' ').replace(/^\\\\s{2}/, '');\n var match = cleaned.match(/^(\\\\s*\\\\d+)\\\\s*\\\\|(.*)$/);\n if (match) {\n frameLines += '<div class=\"code-line' + (isHighlight ? ' highlight' : '') + '\"><span class=\"line-number\">' + match[1].trim() + '</span><span class=\"line-content\">' + this._escapeHTML(match[2]) + '</span></div>';\n } else if (cleaned.trim().startsWith('|')) {\n frameLines += '<div class=\"code-line highlight\"><span class=\"line-number\"></span><span class=\"line-content\" style=\"color:#f87171\">' + this._escapeHTML(cleaned.replace(/^\\\\s*\\\\|/, '')) + '</span></div>';\n }\n }\n if (frameLines) {\n codeFrame = '<div class=\"code-frame\">' + frameLines + '</div>';\n }\n }\n\n var filePath = err.id || (err.loc && err.loc.file) || '';\n var lineNum = (err.loc && err.loc.line != null) ? err.loc.line : '';\n var col = (err.loc && err.loc.column != null) ? err.loc.column : '';\n var location = filePath\n ? '<div class=\"file-path\">' + this._escapeHTML(filePath) + (lineNum ? ':' + lineNum : '') + (col ? ':' + col : '') + '</div>'\n : '';\n\n var tip = this._getTip(err);\n var tipHTML = tip ? '<div class=\"tip\"><span class=\"tip-label\">Tip: </span>' + this._escapeHTML(tip) + '</div>' : '';\n\n var stack = (err.stack && !isCompilerError)\n ? '<div class=\"stack\">' + this._escapeHTML(this._cleanStack(err.stack)) + '</div>'\n : '';\n\n return '<div class=\"backdrop\"></div>'\n + '<div class=\"panel\">'\n + '<div class=\"header\">'\n + '<div class=\"header-left\">'\n + '<div class=\"logo\">W</div>'\n + '<span class=\"brand\">What Framework</span>'\n + '<span class=\"tag ' + tagClass + '\">' + type + '</span>'\n + '</div>'\n + '<div class=\"header-right\">'\n + '<button class=\"copy-btn\">Copy Error</button>'\n + '<button class=\"close-btn\">Dismiss (Esc)</button>'\n + '</div>'\n + '</div>'\n + '<div class=\"body\">'\n + '<h2 class=\"error-title\">' + this._escapeHTML(err.name || 'Error') + '</h2>'\n + location\n + '<pre class=\"error-message\">' + this._escapeHTML(err.message || String(err)) + '</pre>'\n + codeFrame\n + tipHTML\n + stack\n + '</div>'\n + '</div>';\n }\n\n show(err) {\n var template = document.createElement('template');\n template.innerHTML = this._buildHTML(err);\n this.root.appendChild(template.content.cloneNode(true));\n\n // Close handlers\n var self = this;\n var closeBtn = this.root.querySelector('.close-btn');\n if (closeBtn) closeBtn.addEventListener('click', function() { self.close(); });\n var backdrop = this.root.querySelector('.backdrop');\n if (backdrop) backdrop.addEventListener('click', function() { self.close(); });\n document.addEventListener('keydown', this._onKey = function(e) {\n if (e.key === 'Escape') self.close();\n });\n\n // Copy Error button\n var copyBtn = this.root.querySelector('.copy-btn');\n if (copyBtn) {\n copyBtn.addEventListener('click', function() {\n self._copyError(copyBtn);\n });\n }\n }\n\n _copyError(btn) {\n var err = this._err;\n var data = {\n name: err.name || 'Error',\n message: err.message || String(err),\n file: err.id || (err.loc && err.loc.file) || null,\n line: (err.loc && err.loc.line != null) ? err.loc.line : null,\n column: (err.loc && err.loc.column != null) ? err.loc.column : null,\n stack: err.stack ? this._cleanStack(err.stack) : null,\n framework: 'What Framework',\n timestamp: new Date().toISOString()\n };\n\n var text = JSON.stringify(data, null, 2);\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(text).then(function() {\n btn.textContent = 'Copied!';\n btn.classList.add('copied');\n setTimeout(function() {\n btn.textContent = 'Copy Error';\n btn.classList.remove('copied');\n }, 2000);\n }).catch(function() {\n // Fallback: select text\n prompt('Copy error details:', text);\n });\n } else {\n prompt('Copy error details:', text);\n }\n }\n\n close() {\n document.removeEventListener('keydown', this._onKey);\n this.remove();\n }\n}\n\nif (!customElements.get('what-error-overlay')) {\n customElements.define('what-error-overlay', WhatErrorOverlay);\n}\n`;\n\n/**\n * Generate the client-side error overlay injection script.\n * Called by the Vite plugin to inject into the dev server.\n */\nexport function getErrorOverlayCode() {\n return OVERLAY_ELEMENT;\n}\n\n/**\n * Create the error overlay middleware for Vite's dev server.\n * Intercepts Vite's error events and shows a custom What-branded overlay.\n */\nexport function setupErrorOverlay(server) {\n // Listen for Vite errors and enrich with What Framework context\n const origSend = server.ws.send.bind(server.ws);\n server.ws.send = function (payload) {\n if (payload?.type === 'error') {\n // Tag compiler errors\n if (payload.err?.plugin === 'vite-plugin-what') {\n payload.err._isCompilerError = true;\n }\n }\n return origSend(payload);\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAUA,OAAOA,WAAU;AACjB,SAAS,qBAAqB;;;ACQ9B,IAAM,kBAAkB,oBAAI,IAAI,CAAC,kBAAkB,mBAAmB,QAAQ,WAAW,WAAW,MAAM,CAAC;AAC3G,IAAM,yBAAyB,oBAAI,IAAI,CAAC,QAAQ,WAAW,SAAS,CAAC;AACrE,IAAM,qBAAqB,oBAAI,IAAI;AAAA,EACjC;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAM;AAAA,EAAO;AAAA,EAAS;AAAA,EAAM;AAAA,EAAO;AAAA,EACnD;AAAA,EAAQ;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