@pithyjs/core 0.1.0-beta.0 → 0.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -6
- package/dist/a11y/focus-trap.d.ts.map +1 -1
- package/dist/a11y/focus-trap.js +2 -0
- package/dist/a11y/focus-trap.js.map +1 -1
- package/dist/a11y/index.d.ts +4 -4
- package/dist/a11y/index.js +4 -4
- package/dist/a11y/index.js.map +1 -1
- package/dist/a11y/keyboard-utils.js.map +1 -1
- package/dist/a11y/roving-tabindex.js.map +1 -1
- package/dist/a11y/skip-link.js.map +1 -1
- package/dist/compile/bindSwitchCases.d.ts +8 -3
- package/dist/compile/bindSwitchCases.d.ts.map +1 -1
- package/dist/compile/bindSwitchCases.js +113 -177
- package/dist/compile/bindSwitchCases.js.map +1 -1
- package/dist/compile/binds/bindBoundAttributes.d.ts +1 -0
- package/dist/compile/binds/bindBoundAttributes.d.ts.map +1 -1
- package/dist/compile/binds/bindBoundAttributes.js +24 -2
- package/dist/compile/binds/bindBoundAttributes.js.map +1 -1
- package/dist/compile/binds/bindClassDirectives.d.ts +3 -0
- package/dist/compile/binds/bindClassDirectives.d.ts.map +1 -1
- package/dist/compile/binds/bindClassDirectives.js +59 -21
- package/dist/compile/binds/bindClassDirectives.js.map +1 -1
- package/dist/compile/binds/bindComponentsTags.d.ts +2 -0
- package/dist/compile/binds/bindComponentsTags.d.ts.map +1 -1
- package/dist/compile/binds/bindComponentsTags.js +171 -74
- package/dist/compile/binds/bindComponentsTags.js.map +1 -1
- package/dist/compile/binds/bindConditionals.d.ts +2 -2
- package/dist/compile/binds/bindConditionals.d.ts.map +1 -1
- package/dist/compile/binds/bindConditionals.js +22 -5
- package/dist/compile/binds/bindConditionals.js.map +1 -1
- package/dist/compile/binds/bindDefaultTwoWay.d.ts.map +1 -1
- package/dist/compile/binds/bindDefaultTwoWay.js +2 -1
- package/dist/compile/binds/bindDefaultTwoWay.js.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.d.ts.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.js +45 -15
- package/dist/compile/binds/bindDeferDirectives.js.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.d.ts +13 -2
- package/dist/compile/binds/bindErrorBoundary.d.ts.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.js +25 -10
- package/dist/compile/binds/bindErrorBoundary.js.map +1 -1
- package/dist/compile/binds/bindEventHandlers.js +2 -2
- package/dist/compile/binds/bindEventHandlers.js.map +1 -1
- package/dist/compile/binds/bindRefDirectives.js.map +1 -1
- package/dist/compile/binds/bindStyleDirectives.d.ts +17 -0
- package/dist/compile/binds/bindStyleDirectives.d.ts.map +1 -0
- package/dist/compile/binds/bindStyleDirectives.js +47 -0
- package/dist/compile/binds/bindStyleDirectives.js.map +1 -0
- package/dist/compile/binds/bindTextInterpolations.d.ts +2 -1
- package/dist/compile/binds/bindTextInterpolations.d.ts.map +1 -1
- package/dist/compile/binds/bindTextInterpolations.js +55 -17
- package/dist/compile/binds/bindTextInterpolations.js.map +1 -1
- package/dist/compile/binds/directiveRegistry.js.map +1 -1
- package/dist/compile/binds/forwardedAttrs.d.ts +22 -0
- package/dist/compile/binds/forwardedAttrs.d.ts.map +1 -0
- package/dist/compile/binds/forwardedAttrs.js +66 -0
- package/dist/compile/binds/forwardedAttrs.js.map +1 -0
- package/dist/compile/binds/propNames.d.ts +14 -0
- package/dist/compile/binds/propNames.d.ts.map +1 -0
- package/dist/compile/binds/propNames.js +116 -0
- package/dist/compile/binds/propNames.js.map +1 -0
- package/dist/compile/compileExpression.js.map +1 -1
- package/dist/compile/compileNodes.d.ts.map +1 -1
- package/dist/compile/compileNodes.js +6 -3
- package/dist/compile/compileNodes.js.map +1 -1
- package/dist/compile/compileTemplate.d.ts +3 -4
- package/dist/compile/compileTemplate.d.ts.map +1 -1
- package/dist/compile/compileTemplate.js +28 -31
- package/dist/compile/compileTemplate.js.map +1 -1
- package/dist/compile/componentResult.d.ts +100 -0
- package/dist/compile/componentResult.d.ts.map +1 -0
- package/dist/compile/componentResult.js +138 -0
- package/dist/compile/componentResult.js.map +1 -0
- package/dist/compile/contentProjection.d.ts +1 -1
- package/dist/compile/contentProjection.d.ts.map +1 -1
- package/dist/compile/contentProjection.js +32 -15
- package/dist/compile/contentProjection.js.map +1 -1
- package/dist/compile/forLoops/bindForLoops.d.ts +2 -2
- package/dist/compile/forLoops/bindForLoops.d.ts.map +1 -1
- package/dist/compile/forLoops/bindForLoops.js +9 -22
- package/dist/compile/forLoops/bindForLoops.js.map +1 -1
- package/dist/compile/forLoops/createLoopManager.d.ts +6 -3
- package/dist/compile/forLoops/createLoopManager.d.ts.map +1 -1
- package/dist/compile/forLoops/createLoopManager.js +144 -114
- package/dist/compile/forLoops/createLoopManager.js.map +1 -1
- package/dist/compile/forLoops/index.d.ts +5 -5
- package/dist/compile/forLoops/index.js +5 -5
- package/dist/compile/forLoops/index.js.map +1 -1
- package/dist/compile/forLoops/loopHelpers.d.ts +6 -0
- package/dist/compile/forLoops/loopHelpers.d.ts.map +1 -1
- package/dist/compile/forLoops/loopHelpers.js +17 -0
- package/dist/compile/forLoops/loopHelpers.js.map +1 -1
- package/dist/compile/forLoops/loopSignals.js +2 -2
- package/dist/compile/forLoops/loopSignals.js.map +1 -1
- package/dist/compile/forLoops/loopTraversal.js +2 -2
- package/dist/compile/forLoops/loopTraversal.js.map +1 -1
- package/dist/compile/handleConditionalChain.d.ts +2 -2
- package/dist/compile/handleConditionalChain.d.ts.map +1 -1
- package/dist/compile/handleConditionalChain.js +21 -83
- package/dist/compile/handleConditionalChain.js.map +1 -1
- package/dist/compile/index.d.ts +17 -14
- package/dist/compile/index.d.ts.map +1 -1
- package/dist/compile/index.js +28 -12
- package/dist/compile/index.js.map +1 -1
- package/dist/compile/injectScopedStyle.js.map +1 -1
- package/dist/compile/nodeExpando.d.ts +6 -0
- package/dist/compile/nodeExpando.d.ts.map +1 -1
- package/dist/compile/nodeExpando.js.map +1 -1
- package/dist/compile/parseHtml.d.ts.map +1 -1
- package/dist/compile/parseHtml.js +2 -2
- package/dist/compile/parseHtml.js.map +1 -1
- package/dist/compile/pithyTreeToDom.js +1 -1
- package/dist/compile/pithyTreeToDom.js.map +1 -1
- package/dist/compile/renderBranch.d.ts +13 -0
- package/dist/compile/renderBranch.d.ts.map +1 -0
- package/dist/compile/renderBranch.js +65 -0
- package/dist/compile/renderBranch.js.map +1 -0
- package/dist/compile/renderChildren.d.ts +17 -0
- package/dist/compile/renderChildren.d.ts.map +1 -1
- package/dist/compile/renderChildren.js +22 -3
- package/dist/compile/renderChildren.js.map +1 -1
- package/dist/compile/ssrCrashes.d.ts +116 -0
- package/dist/compile/ssrCrashes.d.ts.map +1 -0
- package/dist/compile/ssrCrashes.js +173 -0
- package/dist/compile/ssrCrashes.js.map +1 -0
- package/dist/compile/ssrMode.js +1 -1
- package/dist/compile/ssrMode.js.map +1 -1
- package/dist/compile/textValue.js.map +1 -1
- package/dist/compile/trimBlankEdges.d.ts +2 -0
- package/dist/compile/trimBlankEdges.d.ts.map +1 -0
- package/dist/compile/trimBlankEdges.js +15 -0
- package/dist/compile/trimBlankEdges.js.map +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +2 -2
- package/dist/interfaces/index.js +2 -2
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/ref-signal.interface.js.map +1 -1
- package/dist/interfaces/ref.interface.js.map +1 -1
- package/dist/runtime/applyBindings.d.ts +5 -5
- package/dist/runtime/applyBindings.d.ts.map +1 -1
- package/dist/runtime/applyBindings.js +97 -21
- package/dist/runtime/applyBindings.js.map +1 -1
- package/dist/runtime/bindings/applyComponent.d.ts +2 -2
- package/dist/runtime/bindings/applyComponent.d.ts.map +1 -1
- package/dist/runtime/bindings/applyComponent.js +137 -39
- package/dist/runtime/bindings/applyComponent.js.map +1 -1
- package/dist/runtime/bindings/applyDefer.d.ts +1 -1
- package/dist/runtime/bindings/applyDefer.d.ts.map +1 -1
- package/dist/runtime/bindings/applyDefer.js +46 -18
- package/dist/runtime/bindings/applyDefer.js.map +1 -1
- package/dist/runtime/bindings/applySimple.d.ts +2 -1
- package/dist/runtime/bindings/applySimple.d.ts.map +1 -1
- package/dist/runtime/bindings/applySimple.js +70 -14
- package/dist/runtime/bindings/applySimple.js.map +1 -1
- package/dist/runtime/bindings/applyStructural.d.ts +1 -1
- package/dist/runtime/bindings/applyStructural.d.ts.map +1 -1
- package/dist/runtime/bindings/applyStructural.js +58 -68
- package/dist/runtime/bindings/applyStructural.js.map +1 -1
- package/dist/runtime/bindings/helpers.d.ts +1 -1
- package/dist/runtime/bindings/helpers.js +1 -1
- package/dist/runtime/bindings/helpers.js.map +1 -1
- package/dist/runtime/bindings/index.d.ts +6 -6
- package/dist/runtime/bindings/index.d.ts.map +1 -1
- package/dist/runtime/bindings/index.js +5 -5
- package/dist/runtime/bindings/index.js.map +1 -1
- package/dist/runtime/bindings/types.d.ts +12 -1
- package/dist/runtime/bindings/types.d.ts.map +1 -1
- package/dist/runtime/bindings/types.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +1 -1
- package/dist/runtime/bootstrap.js +1 -1
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/createContextProxy.js.map +1 -1
- package/dist/runtime/deferHelpers.d.ts +1 -1
- package/dist/runtime/deferHelpers.js.map +1 -1
- package/dist/runtime/html.d.ts.map +1 -1
- package/dist/runtime/html.js +6 -5
- package/dist/runtime/html.js.map +1 -1
- package/dist/runtime/index.d.ts +6 -5
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +7 -5
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/lazy.js +1 -1
- package/dist/runtime/lazy.js.map +1 -1
- package/dist/runtime/module-cache.js.map +1 -1
- package/dist/runtime/onDestroy.d.ts +7 -0
- package/dist/runtime/onDestroy.d.ts.map +1 -1
- package/dist/runtime/onDestroy.js +16 -1
- package/dist/runtime/onDestroy.js.map +1 -1
- package/dist/runtime/parseIdentifiersFromTemplate.js +1 -1
- package/dist/runtime/parseIdentifiersFromTemplate.js.map +1 -1
- package/dist/runtime/resource/createAction.d.ts +44 -0
- package/dist/runtime/resource/createAction.d.ts.map +1 -0
- package/dist/runtime/resource/createAction.js +102 -0
- package/dist/runtime/resource/createAction.js.map +1 -0
- package/dist/runtime/resource/createResource.d.ts +56 -0
- package/dist/runtime/resource/createResource.d.ts.map +1 -0
- package/dist/runtime/resource/createResource.js +102 -0
- package/dist/runtime/resource/createResource.js.map +1 -0
- package/dist/runtime/resource/engine.d.ts +136 -0
- package/dist/runtime/resource/engine.d.ts.map +1 -0
- package/dist/runtime/resource/engine.js +363 -0
- package/dist/runtime/resource/engine.js.map +1 -0
- package/dist/runtime/resource/index.d.ts +19 -0
- package/dist/runtime/resource/index.d.ts.map +1 -0
- package/dist/runtime/resource/index.js +18 -0
- package/dist/runtime/resource/index.js.map +1 -0
- package/dist/runtime/resource/types.d.ts +240 -0
- package/dist/runtime/resource/types.d.ts.map +1 -0
- package/dist/runtime/resource/types.js +9 -0
- package/dist/runtime/resource/types.js.map +1 -0
- package/dist/types/globals.d.ts +10 -1
- package/dist/types/globals.d.ts.map +1 -1
- package/dist/types/globals.js.map +1 -1
- package/dist/types/index.d.ts +15 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/index.d.ts +2 -2
- package/dist/utilities/index.js +2 -2
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/ref-signal.utility.d.ts +1 -1
- package/dist/utilities/ref-signal.utility.js.map +1 -1
- package/dist/utilities/ref.untility.d.ts +1 -1
- package/dist/utilities/ref.untility.js.map +1 -1
- package/package.json +14 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindComponentsTags.js","sourceRoot":"","sources":["../../../src/compile/binds/bindComponentsTags.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kEAAkE;QAClE,IAAI,cAAc,IAAI,aAAa,EAAE,CAAC;YACpC,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9C,IAAI,GAAG;oBAAE,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,4EAA4E;QAC5E,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC;YAC/C,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;YACxD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;YACtE,IAAI,UAAU,CAAC,MAAM;gBACnB,WAAW,CAAC,aAAa,CAAC,CAAC,YAAY,GAAG,UAAU,CAAC;YACvD,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;YACxE,IAAI,YAAY,CAAC,MAAM;gBACrB,WAAW,CAAC,aAAa,CAAC,CAAC,cAAc,GAAG,YAAY,CAAC;QAC7D,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAClC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.components\",\n \"title\": \"Component Tag Binding System\",\n \"category\": \"runtime\"\n}\n*/\n\nimport { compileExpression } from '../compileExpression';\nimport { boundaryForElement, runWithBoundary } from './bindErrorBoundary';\nimport { collectSlotMap } from '../contentProjection';\nimport { nativeTags, type PithyNode } from '@pithyjs/compiler';\nimport { collectForwardedAttrs, applyForwardedAttrs } from './forwardedAttrs';\nimport { createRoot, untrack } from '@pithyjs/signals';\nimport { nodeExpando } from '../nodeExpando';\nimport { pithyGlobals } from '../../types/globals';\nimport { isSSRMode } from '../ssrMode';\nimport { clearSSRRenderCrash, reportComponentFailure } from '../ssrCrashes';\nimport { isRenderableComponentEl } from '../componentResult';\nimport { parsePropNames, type PropNames } from './propNames';\n\ninterface ComponentResult {\n /** Any DOM node — see the `Component` type for why this is not narrower. */\n el: Node;\n destroy?: () => void;\n}\ntype ComponentFn = (props: Record<string, unknown>) => ComponentResult;\n\n/**\n * Find the closest element-scoped context we attach in createLoopItem().\n * This is what exposes item(), gIdx(), count(), etc.\n */\n// Warn once per component/tag pair — the same idiom re-renders constantly\n// (e.g. a panel importing Button while using a native <button>), and\n// repeating the warning drowns out real ones.\nconst warnedComponentTags = new Set<string>();\n\n/** Test-only: forget which tags were warned about, so each render warns as a fresh process would. */\nexport function __resetComponentTagWarnings(): void {\n warnedComponentTags.clear();\n}\n\nfunction nearestCtx(\n el: Element,\n rootCtx: Record<string, unknown>\n): Record<string, unknown> {\n let n: Element | null = el;\n while (n) {\n const local = nodeExpando(n).__pithyCtx;\n if (local) return local;\n n = n.parentElement;\n }\n return rootCtx;\n}\n\n/**\n * Detect whether a node is inside a subtree that represents a NOT-YET-EXPANDED nested loop.\n * Those hosts are tagged in createLoopManager.createLoopItem() via `__pithySkipText`,\n * and real templates may also still carry @for / data-for before expansion.\n * We must *defer* binding for anything under such a host, otherwise expressions like item()\n * will throw ReferenceError (because inner loop ctx isn’t created yet).\n */\nfunction isInsidePendingLoopZone(node: Element): boolean {\n let p: Element | null = node;\n while (p) {\n if (nodeExpando(p).__pithySkipText) return true;\n if (\n p.hasAttribute &&\n (p.hasAttribute('@for') || p.hasAttribute('data-for'))\n ) {\n return true;\n }\n p = p.parentElement;\n }\n return false;\n}\n\n/** Evaluate `expr` in `ctx`. Try engine compiler first, then args-style fallback. */\nfunction evalInCtx(expr: string, ctx: Record<string, unknown>): unknown {\n // 1) Preferred: compileExpression uses `with(ctx) { return (...) }`\n try {\n const f = compileExpression(expr, ctx);\n try {\n return f();\n } catch {\n /* fall through to fallback */\n }\n } catch {\n /* fall through to fallback */\n }\n\n // 2) Fallback: args-style evaluator (robust even if compileExpression throws)\n const keys = Object.keys(ctx);\n const vals = keys.map(k => ctx[k]);\n // eslint-disable-next-line no-new-func -- args-style template expression evaluation is a core framework feature\n const fn = new Function(...keys, `return (${expr});`) as (\n ...args: unknown[]\n ) => unknown;\n return fn(...vals);\n}\n\nconst propNameCache = new WeakMap<ComponentFn, PropNames>();\n\nfunction readPropNames(componentFn: ComponentFn): PropNames {\n let cached = propNameCache.get(componentFn);\n if (!cached) {\n try {\n cached = parsePropNames(componentFn.toString());\n } catch {\n cached = { names: [], fromParam: false, exhaustive: false };\n }\n propNameCache.set(componentFn, cached);\n }\n return cached;\n}\n\nfunction extractExpectedPropNames(componentFn: ComponentFn): string[] {\n return readPropNames(componentFn).names;\n}\n\nconst warnedBoundProps = new Set<string>();\nconst GLOBAL_ATTRS = new Set([\n 'id',\n 'class',\n 'style',\n 'title',\n 'role',\n 'tabindex',\n 'hidden',\n]);\n\nfunction warnBoundProps(\n componentFn: ComponentFn,\n el: Element,\n componentName: string\n): void {\n const expected = extractExpectedPropNames(componentFn);\n for (const attr of Array.from(el.attributes)) {\n if (!attr.name.startsWith('data-bind-')) continue;\n const bound = attr.name.slice('data-bind-'.length);\n if (GLOBAL_ATTRS.has(bound)) continue;\n const prop = expected.find(p => p.toLowerCase() === bound);\n const key = `${componentName} ${bound}`;\n if (!prop || warnedBoundProps.has(key)) continue;\n warnedBoundProps.add(key);\n console.warn(\n `[PithyJS] <${componentName}> [${bound}] sets an attribute on the rendered root, not the \\`${prop}\\` prop. Write ${prop}=\"…\" without brackets to set the prop; for a live value pass a signal or () => … if the prop accepts one.`\n );\n }\n}\n\n/** Dev warnings for unexpected props (only if destructuring is present). */\nfunction validateComponentProps(\n componentFn: ComponentFn,\n props: Record<string, unknown>,\n componentName: string\n): void {\n const { names: allNames, exhaustive } = readPropNames(componentFn);\n if (!exhaustive || allNames.length === 0) return;\n\n const passed = Object.keys(props);\n const expectedSet = new Set(allNames);\n\n const unexpected = passed.filter(p => !expectedSet.has(p));\n if (unexpected.length) {\n console.warn(\n `[PithyJS] 🔍 Component <${componentName}> received unexpected props: ${unexpected.join(\n ', '\n )}\\nExpected props: ${allNames.join(', ')}\\nPassed props: ${passed.join(', ')}`\n );\n }\n\n // NOTE: We intentionally do NOT warn about \"missing\" props here.\n // In template-driven usage, props are assembled at runtime by\n // bindComponentTags(), so TypeScript cannot catch missing required\n // props in this path. Components should self-validate critical\n // props where appropriate (e.g. Toggle warns on empty label).\n}\n\n/** Map lowercased DOM attr name to expected prop name (case-insensitive). */\nfunction normalizePropName(\n authoredName: string,\n expectedProps: string[]\n): string {\n if (expectedProps.includes(authoredName)) return authoredName;\n const lower = authoredName.toLowerCase();\n const matches = expectedProps.filter(p => p.toLowerCase() === lower);\n return matches.length === 1 ? matches[0] : authoredName;\n}\n\n/**\n * Replace custom component tags (<Counter/>, <NestedComponent/>) with rendered output.\n * - Skips anything under a pending nested loop host (bind after loop expansion)\n * - Evaluates prop expressions in nearest loop ctx\n * - Case-insensitive prop name normalization\n * - No raw-string fallback (prevents things like calling count() on a string)\n */\n/** @codexApi {\"parent\":\"pithy.runtime.components\",\"name\":\"bindComponentTags\",\"stability\":\"stable\",\"signature\":\"(root: Element | DocumentFragment, rootCtx: Record<string, unknown>, disposers: (() => void)[]) => void\"} */\nexport function bindComponentTags(\n root: Element | DocumentFragment,\n rootCtx: Record<string, unknown>,\n disposers: (() => void)[]\n): void {\n // case-insensitive tag lookup from context\n const tagMap = new Map<string, unknown>(\n Object.keys(rootCtx).map(k => [k.toLowerCase(), rootCtx[k]])\n );\n\n const scope =\n root instanceof Element ? (root as Element) : (root as DocumentFragment);\n const elements = Array.from(scope.querySelectorAll('*'));\n\n for (const el of elements) {\n // Skip elements removed from the tree by a parent component's render, or\n // hidden by an `@error-boundary` that has since activated.\n if (!scope.contains(el)) {\n // An element that has left the tree contributes nothing to the output, so\n // a crash recorded for it on an earlier DETACHED pass is stale. Leaving it\n // fails a route that rendered correctly: with two crashing components\n // under one boundary inside an `@if`, the detached pass records both, the\n // retry lets the boundary accept the first, and accepting synchronously\n // hides the second — which then never gets a retry to retract it.\n if (isSSRMode()) clearSSRRenderCrash(el);\n continue;\n }\n\n // Defer components inside not-yet-expanded loops\n if (isInsidePendingLoopZone(el)) continue;\n\n // A build's placeholder carries no AST: its children are DOM, which only\n // the AOT binder reads.\n const aotMount = nodeExpando(el).__pithyAotMount;\n if (aotMount) {\n // Marked as below, so the text pass skips what the component rendered.\n for (const node of aotMount(disposers))\n nodeExpando(node).__pithyComponentDom = true;\n continue;\n }\n\n const tag = el.tagName.toLowerCase();\n\n // Check if the parser marked this element as a component\n // This is the authoritative source - it checks originalTagName starts with uppercase\n // AND the tag name exists in importedIdentifiers\n const pithyNode = nodeExpando(el).__pithyNode;\n if (pithyNode) {\n // Parser processed this element - use its isComponent flag\n if (!pithyNode.isComponent) {\n // DEV: Warn if there's a component that matches case-insensitively\n // This helps developers catch typos like <button> when they meant <Button>\n // Skip warning if we're inside a component's render (the component might\n // legitimately use native elements like <button> in its implementation)\n const isInsideComponentRender =\n !!pithyGlobals().__pithyRenderingComponent;\n if (import.meta.env?.DEV && !isInsideComponentRender) {\n const matchingComponent = tagMap.get(tag);\n if (matchingComponent && typeof matchingComponent === 'function') {\n // Find the actual component name from context\n const componentName = Object.keys(rootCtx).find(\n k => k.toLowerCase() === tag && rootCtx[k] === matchingComponent\n );\n const warnKey = `${componentName}:${pithyNode.originalTagName}`;\n if (\n componentName &&\n componentName !== pithyNode.originalTagName &&\n !warnedComponentTags.has(warnKey)\n ) {\n warnedComponentTags.add(warnKey);\n console.warn(\n `[PithyJS] ⚠️ Component '${componentName}' is imported but used as '<${pithyNode.originalTagName}>'. ` +\n `Components must use PascalCase. Use '<${componentName}>' instead.`\n );\n }\n }\n }\n continue;\n }\n } else {\n // Fallback for elements not processed by our parser:\n // Skip native HTML elements to prevent <button> matching Button component\n if (nativeTags.has(tag)) continue;\n }\n\n let candidate = tagMap.get(tag);\n\n if (!candidate) continue;\n\n // Support default exports\n if (\n candidate &&\n typeof candidate === 'object' &&\n 'default' in candidate &&\n typeof candidate.default === 'function'\n ) {\n candidate = candidate.default;\n }\n if (typeof candidate !== 'function') continue;\n\n const componentFn = candidate as ComponentFn;\n const localCtx = nearestCtx(el, rootCtx); // crucial for item(), gIdx(), etc.\n\n // Extract expected props for validation (DEV) and prop name normalization (always)\n // This ensures case-insensitive matching works even when originalAttrs is unavailable\n const { names, fromParam } = readPropNames(componentFn);\n const expectedProps = fromParam ? names : [];\n\n // Preserve originally-authored attribute names/casing from the parsed template\n // (pithyNode already extracted above for isComponent check)\n const originalAttrs: Record<string, string> | undefined =\n pithyNode?.originalAttrs;\n\n const props: Record<string, unknown> = {};\n\n // Evaluate attributes as expressions in localCtx\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name;\n const raw = attr.value;\n\n // Skip internal/behavioral attributes\n if (name.startsWith('data-')) continue;\n if (name === 'class' || name === 'style') continue;\n\n // Prefer originally-authored name (preserve casing), else DOM name\n const authored = originalAttrs?.[name] ?? name;\n const propName = normalizePropName(authored, expectedProps);\n\n try {\n const value = untrack(() => evalInCtx(raw, localCtx));\n props[propName] = value; // only set when evaluation succeeds\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn(\n `[PithyJS] ⚠️ Failed to evaluate prop \"${propName}\" = \"${raw}\"`,\n err\n );\n }\n // IMPORTANT: do NOT set a raw string fallback here.\n // Leaving it undefined lets the child use defaults and avoids count()-on-string.\n }\n }\n\n // Validate props for all components in DEV mode.\n // Native elements are already filtered out earlier (line 197 for fallback, line 171 for parser).\n if (import.meta.env?.DEV) {\n const displayTag = pithyNode?.originalTagName || tag;\n validateComponentProps(componentFn, props, displayTag);\n warnBoundProps(componentFn, el, displayTag);\n }\n\n // Collect content projection SlotMap from component children\n const pithyChildren: PithyNode[] = pithyNode?.children || [];\n const slotMap = collectSlotMap(pithyChildren, localCtx);\n\n // Create enhanced context with SlotMap for content projection\n const componentContext = {\n ...localCtx,\n __slotMap: slotMap,\n __childAstNodes: pithyChildren,\n __childFactory: undefined,\n };\n\n // Find nearest error boundary for this component\n const boundaryEl = el.closest('[data-error]') as Element | null;\n const boundary = boundaryForElement(boundaryEl);\n\n // Invoke component under boundary context; expect { el, destroy }\n let out: ComponentResult | undefined;\n let disposeSetup: (() => void) | undefined;\n try {\n out = runWithBoundary(boundary, () => {\n // Store the enhanced context globally for the component's html() calls to access.\n // This per-component context contains __slotMap for content projection.\n //\n // In SSR, there are TWO context sources that html() merges:\n // 1. AsyncLocalStorage context (__getComponentContext) - request-level isolation\n // 2. This global context (__pithyComponentContext) - per-component __slotMap\n //\n // Both are needed: AsyncLocalStorage provides request isolation, while this\n // global provides the __slotMap that changes for each component render.\n const g = pithyGlobals();\n const originalContext = g.__pithyComponentContext;\n const wasRendering = g.__pithyRenderingComponent;\n g.__pithyComponentContext = componentContext;\n // Mark that we're rendering a component to suppress casing warnings for\n // native elements used in component implementations (e.g., <button> in Button)\n g.__pithyRenderingComponent = true;\n\n try {\n const result = createRoot(disposeRoot => {\n disposeSetup = disposeRoot;\n return componentFn(props);\n });\n return result;\n } finally {\n // Restore original context\n g.__pithyComponentContext = originalContext;\n g.__pithyRenderingComponent = wasRendering;\n }\n });\n } catch (err) {\n // Route sync render errors to the nearest boundary with escalation\n if (boundary) {\n const error = err instanceof Error ? err : new Error(String(err));\n // A boundary being in scope does not mean it accepted the error: an\n // already-active boundary with no free ancestor drops it (React's\n // first-error-wins). A component inside that boundary's `@fallback` is\n // the everyday case, and the fallback is what the user actually sees.\n const accepted = reportComponentFailure(el, tag, error, boundary);\n if (import.meta.env?.DEV) {\n // Say which of the two actually happened. \"Captured\" on a rejected\n // error reports the opposite of the truth, and this branch exists\n // precisely because the two are not the same.\n console.log(\n accepted\n ? `[ErrorBoundary] Captured sync render error in <${tag}>:`\n : `[ErrorBoundary] Boundary already active — error from <${tag}> was NOT captured:`,\n error.message\n );\n }\n continue;\n }\n\n // No boundary in scope *yet*. Degrading is still the right call here in\n // both modes: throwing would pre-empt the retry pass that gives an\n // `@error-boundary` its only chance to claim a crash raised while the\n // subtree was detached.\n //\n // A static/server render additionally records the crash. Nobody reads a\n // console during `pithy-ssg`, so this used to leave the raw <${tag}> in\n // the emitted HTML while the route still counted as rendered and the CLI\n // exited 0 (BUG-018). Anything still recorded when the render finishes\n // makes the SSR renderer throw, and the per-route catch in `vite-ssg.ts`\n // fails that route.\n reportComponentFailure(\n el,\n tag,\n err instanceof Error ? err : new Error(String(err)),\n null\n );\n\n console.error(`❌ Component <${tag}> crashed during render:`, err);\n continue;\n }\n\n if (\n !out ||\n typeof out !== 'object' ||\n !('el' in out) ||\n !isRenderableComponentEl(out.el, el)\n ) {\n console.warn(\n `❌ Invalid render result from <${tag}>. Expected { el, destroy }`\n );\n // Not a throw, but the same outcome as one: the raw <${tag}> is left in\n // the document and the subtree never renders. Under SSR that is content\n // silently missing from the emitted HTML, so it is recorded exactly like\n // a crash (BUG-018). Recorded rather than merely left in place, because\n // this attempt may also be retracting an earlier attempt's record.\n // Same funnel as a throw: a boundary above this component gets the\n // chance to claim it and render its fallback, and only an unclaimed\n // failure is recorded. Bypassing this meant a component under\n // `@error-boundary` that returned garbage failed the route with the\n // boundary signal still null.\n reportComponentFailure(\n el,\n tag,\n new Error(\n `Invalid render result from <${tag}>; expected { el, destroy }`\n ),\n boundary\n );\n disposeSetup?.();\n continue;\n }\n\n const { el: renderedEl, destroy } = out;\n\n // Capture class and data-* attributes for forwarding to rendered root:\n // directive bindings (data-on-*, data-bind-*, data-class-toggle-*,\n // data-classes, data-style-*) plus any author-written data-* attribute.\n const forwardedClass = el.getAttribute('class');\n const forwardedAttrs = collectForwardedAttrs(el);\n\n const isFragment = renderedEl.nodeType === Node.DOCUMENT_FRAGMENT_NODE;\n let forwardTarget: HTMLElement | null = null;\n const hasForwardables = !!(forwardedClass || forwardedAttrs.length > 0);\n if (hasForwardables) {\n if (isFragment) {\n forwardTarget = (renderedEl as DocumentFragment)\n .firstElementChild as HTMLElement | null;\n if (import.meta.env?.DEV && !forwardTarget) {\n const displayTag = pithyNode?.originalTagName || tag;\n console.warn(\n `[PithyJS] <${displayTag}> has class or data-* attributes but returns a fragment with no element children — forwarding skipped.`\n );\n }\n } else if (renderedEl.nodeType === Node.ELEMENT_NODE) {\n forwardTarget = renderedEl as HTMLElement;\n }\n }\n\n const renderedNodes = isFragment\n ? Array.from(renderedEl.childNodes)\n : [renderedEl];\n for (const node of renderedNodes)\n nodeExpando(node).__pithyComponentDom = true;\n\n let replaced = true;\n try {\n el.replaceWith(...renderedNodes);\n } catch (err) {\n // A failed replacement leaves the raw <${tag}> exactly where a crash\n // would have, so it is the same content loss and is recorded the same way.\n replaced = false;\n reportComponentFailure(\n el,\n tag,\n err instanceof Error ? err : new Error(String(err)),\n boundary\n );\n console.error(`❌ Failed to replace <${tag}> with rendered DOM:`, err);\n }\n\n // Retracted only here, and in the boundary catch above — never eagerly at\n // the top of an attempt, where any early `continue` added later would\n // silently drop a real record. This is the point at which the component is\n // known to have produced a usable node AND to have reached the document, so\n // an earlier detached attempt's crash is genuinely no longer the outcome.\n if (isSSRMode() && replaced) clearSSRRenderCrash(el);\n\n // Forward class from component tag onto the rendered root element\n if (forwardedClass && forwardTarget) {\n for (const cls of forwardedClass.split(/\\s+/)) {\n if (cls) forwardTarget.classList.add(cls);\n }\n }\n\n // Forward captured attributes so subsequent binders can attach the bindings\n if (forwardedAttrs.length > 0 && forwardTarget) {\n applyForwardedAttrs(forwardTarget, forwardedAttrs, tag);\n const styleProps = Object.keys(pithyNode?.directives?.styleMap ?? {});\n if (styleProps.length)\n nodeExpando(forwardTarget).__styleProps = styleProps;\n const classToggles = Object.keys(pithyNode?.directives?.classMap ?? {});\n if (classToggles.length)\n nodeExpando(forwardTarget).__classToggles = classToggles;\n }\n\n if (disposeSetup) {\n disposers.push(disposeSetup);\n }\n\n if (typeof destroy === 'function') {\n disposers.push(destroy);\n }\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { type PithyNode } from '@pithyjs/compiler';
|
|
|
10
10
|
* Processes conditional directives (@if, @else-if, @else) in the template.
|
|
11
11
|
* Identifies conditional chains and delegates their handling to handleConditionalChain.
|
|
12
12
|
*/
|
|
13
|
-
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl:
|
|
14
|
-
export declare function bindConditionals(nodes: PithyNode[], rootEl:
|
|
13
|
+
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>"} */
|
|
14
|
+
export declare function bindConditionals(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, // Track already processed nodes
|
|
15
15
|
disposers?: (() => void)[]): Set<string>;
|
|
16
16
|
//# sourceMappingURL=bindConditionals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindConditionals.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bindConditionals.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnE;;;GAGG;AACH,+QAA+Q;AAC/Q,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,OAAO,GAAG,gBAAgB,EAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,gBAAgB,GAAE,GAAG,CAAC,MAAM,CAAa,EAAE,gCAAgC;AAC3E,SAAS,GAAE,CAAC,MAAM,IAAI,CAAC,EAAO,GAC7B,GAAG,CAAC,MAAM,CAAC,CAgIb"}
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
}
|
|
7
7
|
*/
|
|
8
8
|
import { collectIfChain } from '@pithyjs/compiler';
|
|
9
|
-
import { handleConditionalChain } from '../handleConditionalChain';
|
|
10
|
-
import { findAllNestedLoopNodes } from '../forLoops/loopTraversal';
|
|
9
|
+
import { handleConditionalChain } from '../handleConditionalChain.js';
|
|
10
|
+
import { findAllNestedLoopNodes } from '../forLoops/loopTraversal.js';
|
|
11
|
+
const warnedOrphans = new WeakSet();
|
|
11
12
|
/**
|
|
12
13
|
* Processes conditional directives (@if, @else-if, @else) in the template.
|
|
13
14
|
* Identifies conditional chains and delegates their handling to handleConditionalChain.
|
|
14
15
|
*/
|
|
15
|
-
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl:
|
|
16
|
+
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>"} */
|
|
16
17
|
export function bindConditionals(nodes, rootEl, ctx, processedNodeIds = new Set(), // Track already processed nodes
|
|
17
18
|
disposers = [] // Collect disposers for cleanup
|
|
18
19
|
) {
|
|
19
20
|
// Performance optimization: Create a Map of all elements by data-pid
|
|
20
21
|
// This makes element lookups O(1) instead of O(n) with querySelector
|
|
21
22
|
const elMap = new Map();
|
|
22
|
-
if (rootEl instanceof
|
|
23
|
+
if (rootEl instanceof Element || rootEl instanceof DocumentFragment) {
|
|
23
24
|
const elements = rootEl.querySelectorAll('[data-pid]');
|
|
24
25
|
elements.forEach(el => {
|
|
25
26
|
const pid = el.getAttribute('data-pid');
|
|
@@ -37,6 +38,18 @@ disposers = [] // Collect disposers for cleanup
|
|
|
37
38
|
chains.push({ chain, startIndex: i });
|
|
38
39
|
i += chain.length - 1; // Skip consumed siblings
|
|
39
40
|
}
|
|
41
|
+
else if (node.type === 'element' &&
|
|
42
|
+
(node.directives?.elseIf !== undefined ||
|
|
43
|
+
node.directives?.else !== undefined) &&
|
|
44
|
+
node.nodeId &&
|
|
45
|
+
!processedNodeIds.has(node.nodeId)) {
|
|
46
|
+
processedNodeIds.add(node.nodeId);
|
|
47
|
+
elMap.get(node.nodeId)?.remove();
|
|
48
|
+
if (import.meta.env?.DEV && !warnedOrphans.has(node)) {
|
|
49
|
+
warnedOrphans.add(node);
|
|
50
|
+
console.warn(`[bindConditionals] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped, as in a build`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
54
|
// Process each chain and track processed nodes
|
|
42
55
|
chains.forEach(({ chain }) => {
|
|
@@ -88,10 +101,14 @@ disposers = [] // Collect disposers for cleanup
|
|
|
88
101
|
if (node.directives?.for !== undefined) {
|
|
89
102
|
continue;
|
|
90
103
|
}
|
|
104
|
+
// A component's children are bound where the component renders them
|
|
105
|
+
// (slot projection, renderChildren); the tag's own DOM is discarded.
|
|
106
|
+
if (node.isComponent)
|
|
107
|
+
continue;
|
|
91
108
|
if (node.type === 'element' && node.children?.length) {
|
|
92
109
|
// Use the Map for O(1) lookup
|
|
93
110
|
const element = node.nodeId ? elMap.get(node.nodeId) : null;
|
|
94
|
-
if (element instanceof
|
|
111
|
+
if (element instanceof Element) {
|
|
95
112
|
// Pass the processedNodeIds Set and disposers to avoid duplicate processing
|
|
96
113
|
bindConditionals(node.children, element, ctx, processedNodeIds, disposers);
|
|
97
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindConditionals.js","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;GAGG;AACH
|
|
1
|
+
{"version":3,"file":"bindConditionals.js","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,aAAa,GAAG,IAAI,OAAO,EAAa,CAAC;AAE/C;;;GAGG;AACH,+QAA+Q;AAC/Q,MAAM,UAAU,gBAAgB,CAC9B,KAAkB,EAClB,MAAkC,EAClC,GAA4B,EAC5B,mBAAgC,IAAI,GAAG,EAAE,EAAE,gCAAgC;AAC3E,YAA4B,EAAE,CAAC,gCAAgC;;IAE/D,qEAAqE;IACrE,qEAAqE;IACrE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IACzC,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,YAAY,gBAAgB,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACpB,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YACxC,IAAI,GAAG,EAAE,CAAC;gBACR,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAa,CAAC,CAAC;YAChC,CAAC;QACH,CAA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sDAAsD;QACtD,6DAA6D;QAC7D,sBAAsB,CACpB,WAAW,EACX,KAAK,EACL,GAAG,EACH,gBAAgB,EAChB,SAAS,CACV,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,wFAAwF;IACxF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,wEAAwE;QACxE,IAAI,IAAI,CAAC,MAAM,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACrD,SAAS;QACX,CAAC;QAED,8EAA8E;QAC9E,wFAAwF;QACxF,IAAI,IAAI,CAAC,UAAU,EAAE,GAAG,KAAK,SAAS,EAAE,CAAC;YACvC,SAAS;QACX,CAAC;QAED,oEAAoE;QACpE,qEAAqE;QACrE,IAAI,IAAI,CAAC,WAAW;YAAE,SAAS;QAE/B,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;YACrD,8BAA8B;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAE5D,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;gBAC/B,4EAA4E;gBAC5E,gBAAgB,CACd,IAAI,CAAC,QAAQ,EACb,OAAO,EACP,GAAG,EACH,gBAAgB,EAChB,SAAS,CACV,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.if\",\n \"title\": \"@if conditional directive\",\n \"category\": \"directive\"\n}\n*/\n\nimport { collectIfChain, type PithyNode } from '@pithyjs/compiler';\nimport { handleConditionalChain } from '../handleConditionalChain';\nimport { findAllNestedLoopNodes } from '../forLoops/loopTraversal';\n\nconst warnedOrphans = new WeakSet<PithyNode>();\n\n/**\n * Processes conditional directives (@if, @else-if, @else) in the template.\n * Identifies conditional chains and delegates their handling to handleConditionalChain.\n */\n/** @codexApi {\"parent\":\"pithy.directive.if\",\"name\":\"bindConditionals\",\"stability\":\"stable\",\"signature\":\"(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>\"} */\nexport function bindConditionals(\n nodes: PithyNode[],\n rootEl: Element | DocumentFragment,\n ctx: Record<string, unknown>,\n processedNodeIds: Set<string> = new Set(), // Track already processed nodes\n disposers: (() => void)[] = [] // Collect disposers for cleanup\n): Set<string> {\n // Performance optimization: Create a Map of all elements by data-pid\n // This makes element lookups O(1) instead of O(n) with querySelector\n const elMap = new Map<string, Element>();\n if (rootEl instanceof Element || rootEl instanceof DocumentFragment) {\n const elements = rootEl.querySelectorAll('[data-pid]');\n elements.forEach(el => {\n const pid = el.getAttribute('data-pid');\n if (pid) {\n elMap.set(pid, el as Element);\n }\n });\n }\n\n // Identify all conditional chains using shared utility from @pithyjs/compiler\n const chains: { chain: PithyNode[]; startIndex: number }[] = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === 'element' && node.directives?.if !== undefined) {\n const chain = collectIfChain(nodes, i);\n chains.push({ chain, startIndex: i });\n i += chain.length - 1; // Skip consumed siblings\n } else if (\n node.type === 'element' &&\n (node.directives?.elseIf !== undefined ||\n node.directives?.else !== undefined) &&\n node.nodeId &&\n !processedNodeIds.has(node.nodeId)\n ) {\n processedNodeIds.add(node.nodeId);\n elMap.get(node.nodeId)?.remove();\n if (import.meta.env?.DEV && !warnedOrphans.has(node)) {\n warnedOrphans.add(node);\n console.warn(\n `[bindConditionals] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped, as in a build`\n );\n }\n }\n }\n\n // Process each chain and track processed nodes\n chains.forEach(({ chain }) => {\n chain.forEach(node => {\n // Mark this node as processed\n if (node.nodeId) {\n processedNodeIds.add(node.nodeId);\n }\n\n // Also mark all loops inside this conditional as processed\n // They will be bound by handleConditionalChain when the condition is true\n const nestedLoops = findAllNestedLoopNodes(node);\n for (const loopNode of nestedLoops) {\n if (loopNode.nodeId) {\n processedNodeIds.add(loopNode.nodeId);\n }\n }\n });\n\n // Find the DOM elements for this chain using our optimized Map\n const domElements = chain\n .map(node => {\n if (!node.nodeId) {\n return null;\n }\n\n // Use the Map for O(1) lookup instead of querySelector\n const element = elMap.get(node.nodeId);\n\n if (!element) {\n return null;\n }\n return element;\n })\n .filter((el): el is Element => el !== null);\n\n // Verify we found all DOM elements\n if (domElements.length !== chain.length) {\n return;\n }\n\n // Handle the chain and collect all processed node IDs\n // Pass disposers array so effects can be properly cleaned up\n handleConditionalChain(\n domElements,\n chain,\n ctx,\n processedNodeIds,\n disposers\n );\n });\n\n // Recursively process children of all nodes, skipping those already processed in chains\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n // Skip nodes that were already processed as part of a conditional chain\n if (node.nodeId && processedNodeIds.has(node.nodeId)) {\n continue;\n }\n\n // Skip @for nodes - their children (including conditionals) will be processed\n // by the loop manager's createLoopItem with the proper loop context (item, index, etc.)\n if (node.directives?.for !== undefined) {\n continue;\n }\n\n // A component's children are bound where the component renders them\n // (slot projection, renderChildren); the tag's own DOM is discarded.\n if (node.isComponent) continue;\n\n if (node.type === 'element' && node.children?.length) {\n // Use the Map for O(1) lookup\n const element = node.nodeId ? elMap.get(node.nodeId) : null;\n\n if (element instanceof Element) {\n // Pass the processedNodeIds Set and disposers to avoid duplicate processing\n bindConditionals(\n node.children,\n element,\n ctx,\n processedNodeIds,\n disposers\n );\n }\n }\n }\n\n return processedNodeIds;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDefaultTwoWay.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qOAAqO;AACrO,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,GAAG,gBAAgB,EACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,GACxB,IAAI,
|
|
1
|
+
{"version":3,"file":"bindDefaultTwoWay.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qOAAqO;AACrO,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,GAAG,gBAAgB,EACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,GACxB,IAAI,CAwDN"}
|
|
@@ -49,7 +49,7 @@ export function bindDefaultTwoWay(fragment, context, disposers) {
|
|
|
49
49
|
}
|
|
50
50
|
const el = element; // Now TypeScript knows this is HTMLElement
|
|
51
51
|
Array.from(el.attributes).forEach(attr => {
|
|
52
|
-
if (
|
|
52
|
+
if (attr.name !== 'data-bind')
|
|
53
53
|
return;
|
|
54
54
|
const signal = context[attr.value];
|
|
55
55
|
if (!isWritableSignal(signal)) {
|
|
@@ -73,6 +73,7 @@ export function bindDefaultTwoWay(fragment, context, disposers) {
|
|
|
73
73
|
signal.set(newVal);
|
|
74
74
|
};
|
|
75
75
|
el.addEventListener(event, eventHandler);
|
|
76
|
+
el.removeAttribute('data-bind');
|
|
76
77
|
// Add proper cleanup
|
|
77
78
|
disposers.push(() => {
|
|
78
79
|
el.removeEventListener(event, eventHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDefaultTwoWay.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQpD,sDAAsD;AACtD,SAAS,aAAa,CAAC,OAAgB;IACrC,OAAO,OAAO,YAAY,WAAW,CAAC;AACxC,CAAC;AAED,8CAA8C;AAC9C,SAAS,gBAAgB,CAAC,MAAe;IACvC,OAAO,CACL,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAQ,MAAyB,CAAC,GAAG,KAAK,UAAU,CACzE,CAAC;AACJ,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qOAAqO;AACrO,MAAM,UAAU,iBAAiB,CAC/B,QAAoC,EACpC,OAAgC,EAChC,SAAyB;IAEzB,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACzD,8CAA8C;QAC9C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CACV,yDAAyD,EACzD,OAAO,CACR,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,2CAA2C;QAE/D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvC,IAAI,
|
|
1
|
+
{"version":3,"file":"bindDefaultTwoWay.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQpD,sDAAsD;AACtD,SAAS,aAAa,CAAC,OAAgB;IACrC,OAAO,OAAO,YAAY,WAAW,CAAC;A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AAC,CAAC,WAAW;AAC7B,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAe,EAAE,IAAY;IACvD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACxC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,oBAAoB,CAAC,EAAe,EAAE,IAAY;IACzD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAQ,EAAuB,CAAC,OAAO,CAAC;IAC1C,CAAC;IAED,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,EAAsB,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACvC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;QACpD,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;QACvB,OAAQ,EAA0B,CAAC,KAAK,CAAC;IAC3C,CAAC;IAED,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,OAAQ,EAAwB,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,OAAQ,EAA4C,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.two-way-binding\",\n \"title\": \"Two-Way Data Binding System\",\n \"category\": \"runtime\"\n}\n*/\n\nimport { effect, isSignal } from '@pithyjs/signals';\n\n// Define a type for writable signals\ninterface WritableSignal<T = unknown> {\n (): T;\n set(value: T): void;\n}\n\n// Type guard to check if an element is an HTMLElement\nfunction isHTMLElement(element: Element): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\n// Type guard to check if a signal is writable\nfunction isWritableSignal(signal: unknown): signal is WritableSignal {\n return (\n isSignal(signal) && typeof (signal as WritableSignal).set === 'function'\n );\n}\n/**\n * Establishes two-way data binding between HTML elements with `data-bind` attributes and writable signals.\n *\n * This function scans the provided fragment for elements with `data-bind` attributes and creates\n * bidirectional synchronization between the DOM elements and their corresponding signals in the context.\n *\n * **How it works:**\n * 1. Finds all elements with `data-bind` attributes within the fragment\n * 2. For each element, retrieves the corresponding signal from the context using the attribute value\n * 3. Sets up reactive updates: when the signal changes, the DOM element is updated\n * 4. Sets up event listeners: when the user interacts with the element, the signal is updated\n * 5. Automatically infers the appropriate property and event based on the element type\n *\n * **Supported elements:**\n * - `<input>` elements: binds to `value` property (or `checked` for checkboxes/radio buttons)\n * - `<textarea>` elements: binds to `value` property\n * - `<select>` elements: binds to `value` property\n * - Other elements: falls back to `value` property\n *\n * @param fragment - The DOM fragment or element to search for bindable elements\n * @param context - Object containing the signals referenced by `data-bind` attributes\n * @param disposers - Array to collect cleanup functions for proper resource disposal\n *\n * @throws Will log warnings for elements that are not HTMLElements or signals that are not writable\n */\n\n/** @codexApi {\"parent\":\"pithy.runtime.two-way-binding\",\"name\":\"bindDefaultTwoWay\",\"stability\":\"stable\",\"signature\":\"(fragment: Element | DocumentFragment, context: Record<string, unknown>, disposers: (() => void)[]) => void\"} */\nexport function bindDefaultTwoWay(\n fragment: Element | DocumentFragment,\n context: Record<string, unknown>,\n disposers: (() => void)[]\n): void {\n fragment.querySelectorAll('[data-bind]').forEach(element => {\n // Type guard to ensure we have an HTMLElement\n if (!isHTMLElement(element)) {\n console.warn(\n `[PithyJS] Element with data-bind is not an HTMLElement:`,\n element\n );\n return;\n }\n\n const el = element; // Now TypeScript knows this is HTMLElement\n\n Array.from(el.attributes).forEach(attr => {\n if (attr.name !== 'data-bind') return;\n\n const signal = context[attr.value];\n\n if (!isWritableSignal(signal)) {\n console.warn(\n `[PithyJS] @bind=\"${attr.value}\" must refer to a writable signal`\n );\n return;\n }\n\n const prop = inferBindableProperty(el);\n const target = el as HTMLElement & Record<string, unknown>;\n\n // Reactive update: signal → DOM\n const effectDisposer = effect(() => {\n const value = signal();\n const currentValue = target[prop];\n if (currentValue !== value) {\n target[prop] = value;\n }\n });\n\n // Event listener: DOM → signal\n const event = inferBindableEvent(el, prop);\n const eventHandler = () => {\n const newVal = extractBindableValue(el, prop);\n signal.set(newVal);\n };\n\n el.addEventListener(event, eventHandler);\n el.removeAttribute('data-bind');\n\n // Add proper cleanup\n disposers.push(() => {\n el.removeEventListener(event, eventHandler);\n if (typeof effectDisposer === 'function') {\n effectDisposer();\n }\n });\n });\n });\n}\n\nfunction inferBindableProperty(el: HTMLElement): string {\n const tag = el.tagName.toLowerCase();\n\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n const type = inputEl.type;\n if (type === 'checkbox' || type === 'radio') return 'checked';\n return 'value';\n }\n\n if (tag === 'textarea') return 'value';\n if (tag === 'select') return 'value';\n\n return 'value'; // fallback\n}\n\nfunction inferBindableEvent(el: HTMLElement, prop: string): string {\n if (prop === 'checked') return 'change';\n return 'input';\n}\n\nfunction extractBindableValue(el: HTMLElement, prop: string): unknown {\n if (prop === 'checked') {\n return (el as HTMLInputElement).checked;\n }\n\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n const type = inputEl.type;\n if (type === 'number') {\n const numValue = Number(inputEl.value);\n return isNaN(numValue) ? inputEl.value : numValue;\n }\n return inputEl.value;\n }\n\n if (tag === 'textarea') {\n return (el as HTMLTextAreaElement).value;\n }\n\n if (tag === 'select') {\n return (el as HTMLSelectElement).value;\n }\n\n return (el as HTMLElement & Record<string, unknown>)[prop];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDeferDirectives.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAmCF;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC3B,IAAI,
|
|
1
|
+
{"version":3,"file":"bindDeferDirectives.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAmCF;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC3B,IAAI,CAkiBN"}
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @module compile/binds/bindDeferDirectives
|
|
15
15
|
*/
|
|
16
|
-
import { effect } from '@pithyjs/signals';
|
|
16
|
+
import { createRoot, effect } from '@pithyjs/signals';
|
|
17
17
|
import { DEFAULT_LAZY_TIMEOUT, } from '@pithyjs/compiler';
|
|
18
|
-
import { compileExpression } from '../compileExpression';
|
|
19
|
-
import { DEFAULT_VISIBILITY_MARGIN, isLazyHandle, observeVisibilityOnce, } from '../../runtime';
|
|
20
|
-
import { boundaryForElement, setBoundaryError } from './bindErrorBoundary';
|
|
21
|
-
import { loadWithTimeout, scheduleByPriority, } from '../../runtime/deferHelpers';
|
|
18
|
+
import { compileExpression } from '../compileExpression.js';
|
|
19
|
+
import { DEFAULT_VISIBILITY_MARGIN, isLazyHandle, observeVisibilityOnce, } from '../../runtime/index.js';
|
|
20
|
+
import { boundaryForElement, setBoundaryError } from './bindErrorBoundary.js';
|
|
21
|
+
import { loadWithTimeout, scheduleByPriority, } from '../../runtime/deferHelpers.js';
|
|
22
22
|
/** Unique ID counter for defer anchors */
|
|
23
23
|
let deferIdCounter = 0;
|
|
24
24
|
/**
|
|
@@ -154,6 +154,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
154
154
|
element.style.display = 'none';
|
|
155
155
|
// Track mounted component for cleanup
|
|
156
156
|
let mountedDestroy = null;
|
|
157
|
+
let disposeMountedSetup = null;
|
|
157
158
|
let isMounted = false;
|
|
158
159
|
let isMounting = false; // true while an async mount is in-flight
|
|
159
160
|
// Mount generation counter — incremented on every unmount/cleanup to
|
|
@@ -161,6 +162,34 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
161
162
|
let mountGeneration = 0;
|
|
162
163
|
// Track inserted nodes directly (no wrapper div)
|
|
163
164
|
let insertedNodes = [];
|
|
165
|
+
/**
|
|
166
|
+
* Run and clear the mounted instance's teardown. Claimed before DOM
|
|
167
|
+
* insertion, so a throw between the two still reaches it.
|
|
168
|
+
*/
|
|
169
|
+
function releaseMountedComponent() {
|
|
170
|
+
const destroyMounted = mountedDestroy;
|
|
171
|
+
const disposeSetup = disposeMountedSetup;
|
|
172
|
+
mountedDestroy = null;
|
|
173
|
+
disposeMountedSetup = null;
|
|
174
|
+
try {
|
|
175
|
+
destroyMounted?.();
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
if (import.meta.env?.DEV) {
|
|
179
|
+
console.warn('[pithy] @defer error in component destroy():', err);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
try {
|
|
184
|
+
disposeSetup?.();
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
if (import.meta.env?.DEV) {
|
|
188
|
+
console.warn('[pithy] @defer error in setup cleanup:', err);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
164
193
|
/**
|
|
165
194
|
* Remove mounted component nodes from DOM
|
|
166
195
|
*/
|
|
@@ -168,11 +197,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
168
197
|
// Invalidate any in-flight async mount
|
|
169
198
|
mountGeneration++;
|
|
170
199
|
isMounting = false;
|
|
171
|
-
|
|
172
|
-
if (mountedDestroy) {
|
|
173
|
-
mountedDestroy();
|
|
174
|
-
mountedDestroy = null;
|
|
175
|
-
}
|
|
200
|
+
releaseMountedComponent();
|
|
176
201
|
// Remove all inserted nodes
|
|
177
202
|
for (const node of insertedNodes) {
|
|
178
203
|
if (node.parentNode) {
|
|
@@ -234,9 +259,15 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
234
259
|
const Component = module.default || module;
|
|
235
260
|
if (typeof Component === 'function') {
|
|
236
261
|
// Render the component
|
|
237
|
-
|
|
262
|
+
let disposeSetup;
|
|
263
|
+
const result = createRoot(disposeRoot => {
|
|
264
|
+
disposeSetup = disposeRoot;
|
|
265
|
+
return Component();
|
|
266
|
+
});
|
|
238
267
|
if (result && typeof result === 'object' && 'el' in result) {
|
|
239
268
|
const { el, destroy } = result;
|
|
269
|
+
mountedDestroy = destroy ?? null;
|
|
270
|
+
disposeMountedSetup = disposeSetup ?? null;
|
|
240
271
|
// Insert component content directly (no wrapper div)
|
|
241
272
|
if (el instanceof DocumentFragment) {
|
|
242
273
|
// Track all children before moving them
|
|
@@ -251,10 +282,6 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
251
282
|
}
|
|
252
283
|
isMounted = true;
|
|
253
284
|
isMounting = false;
|
|
254
|
-
// Track destroy function
|
|
255
|
-
if (destroy) {
|
|
256
|
-
mountedDestroy = destroy;
|
|
257
|
-
}
|
|
258
285
|
// Dispatch loaded event
|
|
259
286
|
element.dispatchEvent(new CustomEvent('loaded', {
|
|
260
287
|
detail: {
|
|
@@ -265,6 +292,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
265
292
|
}));
|
|
266
293
|
}
|
|
267
294
|
else {
|
|
295
|
+
disposeSetup?.();
|
|
268
296
|
isMounting = false;
|
|
269
297
|
}
|
|
270
298
|
}
|
|
@@ -274,6 +302,8 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
274
302
|
}
|
|
275
303
|
catch (err) {
|
|
276
304
|
isMounting = false;
|
|
305
|
+
if (!isMounted)
|
|
306
|
+
releaseMountedComponent();
|
|
277
307
|
// Check if an unmount/cleanup happened during async load
|
|
278
308
|
if (thisGeneration !== mountGeneration)
|
|
279
309
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDeferDirectives.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACL,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,0CAA0C;AAC1C,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO,MAAM,UAAU,mBAAmB,CACjC,QAA0B,EAC1B,OAAgC,EAChC,SAA4B;IAE5B,0CAA0C;IAC1C,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAEhE,KAAK,MAAM,EAAE,IAAI,aAAa,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,EAAiB,CAAC;QAElC,wEAAwE;QACxE,8EAA8E;QAC9E,IAAI,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC;YAAE,SAAS;QAEvD,6CAA6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BACN,0EAA0E;oBAC1E,kBAAkB,EAAE,CAAC;oBAErB,iDAAiD;oBACjD,uEAAuE;oBACvE,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;wBAC5B,gBAAgB,EAAE,CAAC;oBACrB,CAAC;oBACD,qEAAqE;oBACrE,IAAI,OAAO,EAAE,CAAC;wBACZ,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;oBACjC,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClB,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,gDAAgD,EAAE,OAAO,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"bindDeferDirectives.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,0CAA0C;AAC1C,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO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kBAAkB,EAAE,CAAC;oBAErB,iDAAiD;oBACjD,uEAAuE;oBACvE,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;wBAC5B,gBAAgB,EAAE,CAAC;oBACrB,CAAC;oBACD,qEAAqE;oBACrE,IAAI,OAAO,EAAE,CAAC;wBACZ,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;oBACjC,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClB,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,gDAAgD,EAAE,OAAO,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.core.bind-defer-directives\",\n \"title\": \"Defer Directive Binder for Lazy Loading\",\n \"category\": \"directive\"\n}\n*/\n\n/**\n * Lazy Loading Directive Binder\n *\n * Handles @defer directives to lazily load components based on\n * visibility (IntersectionObserver) or boolean conditions.\n *\n * @module compile/binds/bindDeferDirectives\n */\n\nimport { createRoot, effect } from '@pithyjs/signals';\nimport {\n DEFAULT_LAZY_TIMEOUT,\n type DeferTrigger,\n type LoadingPriority,\n} from '@pithyjs/compiler';\nimport { compileExpression } from '../compileExpression';\n\nimport {\n DEFAULT_VISIBILITY_MARGIN,\n isLazyHandle,\n observeVisibilityOnce,\n type LazyHandle,\n} from '../../runtime';\n\nimport { boundaryForElement, setBoundaryError } from './bindErrorBoundary';\nimport {\n loadWithTimeout,\n scheduleByPriority,\n} from '../../runtime/deferHelpers';\n\n/** Unique ID counter for defer anchors */\nlet deferIdCounter = 0;\n\n/**\n * Bind @defer directives to enable lazy loading of components.\n *\n * Supports two trigger modes:\n * - `visible`: Load when element scrolls into viewport (IntersectionObserver)\n * - `when`: Load when a boolean expression becomes truthy\n *\n * @param fragment - The root document fragment\n * @param context - Template context with signals and lazy handles\n * @param disposers - Array to collect cleanup functions\n */\n/** @codexApi {\"parent\":\"pithy.core.bind-defer-directives\",\"name\":\"bindDeferDirectives\",\"stability\":\"stable\",\"signature\":\"(fragment: DocumentFragment, context: Record<string, unknown>, disposers: Array<() => void>) => void\"} */\nexport function bindDeferDirectives(\n fragment: DocumentFragment,\n context: Record<string, unknown>,\n disposers: Array<() => void>\n): void {\n // Find all elements with @defer directive\n const deferElements = fragment.querySelectorAll('[data-defer]');\n\n for (const el of deferElements) {\n const element = el as HTMLElement;\n\n // Skip elements already processed (e.g., inside component subtrees that\n // ran their own bindDeferDirectives before being inserted into the outer DOM)\n if (element.hasAttribute('data-defer-state')) continue;\n\n // Read directive values from data attributes\n const trigger = element.dataset.defer as DeferTrigger | undefined;\n const loadExpr = element.dataset.load;\n const placeholderExpr = element.dataset.placeholder;\n const whenExpr = element.dataset.when;\n const priority = element.dataset.deferPriority as\n | LoadingPriority\n | undefined;\n const timeoutStr = element.dataset.deferTimeout;\n const timeout = timeoutStr ? parseInt(timeoutStr, 10) : undefined;\n\n // Validate required attributes\n if (!trigger) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer element missing trigger type', element);\n }\n continue;\n }\n\n if (!loadExpr) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer element missing @load directive', element);\n }\n continue;\n }\n\n // Get the lazy handle from context\n const lazyHandleGetter = compileExpression<LazyHandle<unknown>>(\n loadExpr,\n context,\n undefined\n );\n const lazyHandle = lazyHandleGetter();\n\n if (!isLazyHandle(lazyHandle)) {\n if (import.meta.env?.DEV) {\n console.warn(\n `[pithy] @load=\"${loadExpr}\" did not resolve to a LazyHandle`,\n element\n );\n }\n continue;\n }\n\n // Use existing data-defer-id or generate a unique one\n const existingId = element.getAttribute('data-defer-id');\n const deferId = existingId || `defer-${++deferIdCounter}`;\n\n // Set data attributes for SSR markers (preserve existing ID if present)\n if (!existingId) {\n element.setAttribute('data-defer-id', deferId);\n }\n element.setAttribute('data-defer-state', 'pending');\n\n // Create anchor comment\n const anchor = document.createComment(`defer:${deferId}`);\n\n // Setup placeholder - check both data-placeholder attribute and slot=\"placeholder\" children\n let placeholderEl: HTMLElement | Text | null = null;\n\n // First, try to extract slot=\"placeholder\" from element children\n const slotPlaceholder = element.querySelector('[slot=\"placeholder\"]');\n if (slotPlaceholder) {\n // Remove from original parent and use as placeholder\n placeholderEl = slotPlaceholder as HTMLElement;\n placeholderEl.removeAttribute('slot');\n // Add data attribute for test accessibility\n placeholderEl.setAttribute('data-defer-placeholder', deferId);\n } else if (placeholderExpr) {\n // Fallback to data-placeholder attribute\n // Check if it's a string literal\n if (\n (placeholderExpr.startsWith(\"'\") && placeholderExpr.endsWith(\"'\")) ||\n (placeholderExpr.startsWith('\"') && placeholderExpr.endsWith('\"'))\n ) {\n // String placeholder\n const text = placeholderExpr.slice(1, -1);\n placeholderEl = document.createTextNode(text) as unknown as HTMLElement;\n } else {\n // Component placeholder - get from context\n const placeholderGetter = compileExpression<unknown>(\n placeholderExpr,\n context,\n null\n );\n const placeholder = placeholderGetter();\n\n if (typeof placeholder === 'function') {\n // It's a component function\n try {\n const result = (placeholder as () => unknown)();\n if (result && typeof result === 'object' && 'el' in result) {\n placeholderEl = (result as { el: HTMLElement }).el as HTMLElement;\n }\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn(\n `[pithy] Error rendering placeholder component:`,\n err\n );\n }\n }\n }\n }\n }\n\n // Also extract slot=\"error\" for error handling\n const slotError = element.querySelector('[slot=\"error\"]');\n let errorEl: HTMLElement | null = null;\n if (slotError) {\n errorEl = slotError as HTMLElement;\n errorEl.removeAttribute('slot');\n // Add data attribute for test accessibility\n errorEl.setAttribute('data-defer-error', deferId);\n // Keep error slot hidden until needed\n errorEl.style.display = 'none';\n }\n\n // Insert anchor and placeholder\n const parent = element.parentNode;\n if (!parent) continue;\n\n parent.insertBefore(anchor, element);\n\n if (placeholderEl) {\n // For @defer=\"when\", placeholder starts hidden (only shows during loading)\n // For @defer=\"visible\", placeholder shows immediately (triggers on visibility)\n if (trigger === 'when' && placeholderEl instanceof HTMLElement) {\n placeholderEl.style.display = 'none';\n }\n parent.insertBefore(placeholderEl, element);\n }\n\n // Insert error element (hidden) after placeholder\n if (errorEl) {\n parent.insertBefore(errorEl, element);\n }\n\n // Hide the original element (it becomes the container after load)\n element.style.display = 'none';\n\n // Track mounted component for cleanup\n let mountedDestroy: (() => void) | null = null;\n let disposeMountedSetup: (() => void) | null = null;\n let isMounted = false;\n let isMounting = false; // true while an async mount is in-flight\n\n // Mount generation counter — incremented on every unmount/cleanup to\n // invalidate in-flight async mounts that started before the unmount.\n let mountGeneration = 0;\n\n // Track inserted nodes directly (no wrapper div)\n let insertedNodes: Node[] = [];\n\n /**\n * Run and clear the mounted instance's teardown. Claimed before DOM\n * insertion, so a throw between the two still reaches it.\n */\n function releaseMountedComponent(): void {\n const destroyMounted = mountedDestroy;\n const disposeSetup = disposeMountedSetup;\n mountedDestroy = null;\n disposeMountedSetup = null;\n try {\n destroyMounted?.();\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer error in component destroy():', err);\n }\n } finally {\n try {\n disposeSetup?.();\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer error in setup cleanup:', err);\n }\n }\n }\n }\n\n /**\n * Remove mounted component nodes from DOM\n */\n function unmountComponent(): void {\n // Invalidate any in-flight async mount\n mountGeneration++;\n isMounting = false;\n\n releaseMountedComponent();\n\n // Remove all inserted nodes\n for (const node of insertedNodes) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n insertedNodes = [];\n isMounted = false;\n\n // Hide placeholder if it was shown during a cancelled in-flight mount\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n placeholderEl.style.display = 'none';\n }\n\n // Reset state to pending (ready for re-mount on next trigger)\n element.setAttribute('data-defer-state', 'pending');\n }\n\n /**\n * Mount the lazy component with timeout support\n */\n async function mountComponent(): Promise<void> {\n // If already mounted or a mount is in-flight, skip\n if (isMounted || isMounting) return;\n\n isMounting = true;\n\n // Capture generation so we can detect if an unmount happened while awaiting\n const thisGeneration = mountGeneration;\n\n element.setAttribute('data-defer-state', 'loading');\n\n // Show placeholder during loading (for @defer=\"when\" it starts hidden)\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n placeholderEl.style.display = '';\n }\n\n try {\n // Load the module with timeout (chunk is cached after first load)\n const effectiveTimeout = timeout ?? DEFAULT_LAZY_TIMEOUT;\n const module = await loadWithTimeout(lazyHandle, effectiveTimeout);\n\n // Check if an unmount/cleanup happened during async load (generation changed)\n if (thisGeneration !== mountGeneration) {\n isMounting = false;\n return;\n }\n\n // Use fresh parentNode — the element may have been moved into the real DOM\n // by bindComponentTags.replaceWith() during the async gap\n const freshParent = element.parentNode;\n if (!freshParent) {\n isMounting = false;\n return;\n }\n\n element.setAttribute('data-defer-state', 'loaded');\n\n // Remove placeholder\n if (placeholderEl && placeholderEl.parentNode) {\n placeholderEl.parentNode.removeChild(placeholderEl);\n placeholderEl = null;\n }\n\n // Remove error element (no longer needed on success)\n if (errorEl && errorEl.parentNode) {\n errorEl.parentNode.removeChild(errorEl);\n errorEl = null;\n }\n\n // Get the component from the module\n const Component = (module as { default?: unknown }).default || module;\n\n if (typeof Component === 'function') {\n // Render the component\n let disposeSetup: (() => void) | undefined;\n const result = createRoot(disposeRoot => {\n disposeSetup = disposeRoot;\n return (Component as () => unknown)();\n });\n\n if (result && typeof result === 'object' && 'el' in result) {\n const { el, destroy } = result as {\n el: HTMLElement | DocumentFragment;\n destroy?: () => void;\n };\n\n mountedDestroy = destroy ?? null;\n disposeMountedSetup = disposeSetup ?? null;\n\n // Insert component content directly (no wrapper div)\n if (el instanceof DocumentFragment) {\n // Track all children before moving them\n const nodes = Array.from(el.childNodes);\n insertedNodes = nodes;\n // Insert fragment directly - this moves all children to the DOM\n freshParent.insertBefore(el, element);\n } else {\n insertedNodes = [el];\n freshParent.insertBefore(el, element);\n }\n\n isMounted = true;\n isMounting = false;\n\n // Dispatch loaded event\n element.dispatchEvent(\n new CustomEvent('loaded', {\n detail: {\n ttiMs: Date.now(), // Could track actual load time\n chunkId: lazyHandle.key,\n },\n bubbles: true,\n })\n );\n } else {\n disposeSetup?.();\n isMounting = false;\n }\n } else {\n isMounting = false;\n }\n } catch (err) {\n isMounting = false;\n if (!isMounted) releaseMountedComponent();\n\n // Check if an unmount/cleanup happened during async load\n if (thisGeneration !== mountGeneration) return;\n\n element.setAttribute('data-defer-state', 'error');\n\n const error = err instanceof Error ? err : new Error(String(err));\n\n // Remove placeholder and show error slot if available\n if (placeholderEl && placeholderEl.parentNode) {\n placeholderEl.parentNode.removeChild(placeholderEl);\n placeholderEl = null;\n }\n\n // Propagate error to nearest error boundary (if one exists)\n const boundary = boundaryForElement(element);\n if (boundary) {\n setBoundaryError(boundary, error);\n } else if (errorEl) {\n // No error boundary - fall back to local error slot\n errorEl.style.display = '';\n }\n\n // Dispatch error event (for programmatic handling)\n element.dispatchEvent(\n new CustomEvent('error', {\n detail: {\n error,\n retry: () => {\n // Hide error, re-show placeholder if we had one\n if (errorEl) {\n errorEl.style.display = 'none';\n }\n lazyHandle.retry().then(mountComponent);\n },\n },\n bubbles: true,\n })\n );\n\n if (import.meta.env?.DEV) {\n console.error(`[pithy] Failed to load lazy component:`, err);\n }\n }\n }\n\n // Track idle callback for cancellation\n let idleCallbackId: number | undefined;\n\n /**\n * Cleanup function\n */\n function cleanup(): void {\n // Cancel any scheduled-but-not-started mount\n cancelPendingMount();\n\n // Invalidate any in-flight async mount (unmountComponent also does this,\n // but we bump it here too in case unmountComponent is skipped)\n mountGeneration++;\n\n // Cancel pending idle callback (cancelPendingMount handles the scheduled\n // case, but cover the already-in-flight case too)\n if (\n idleCallbackId !== undefined &&\n typeof cancelIdleCallback !== 'undefined'\n ) {\n cancelIdleCallback(idleCallbackId);\n idleCallbackId = undefined;\n }\n\n // Unmount component (calls destroy and removes nodes)\n unmountComponent();\n\n // Cancel any in-flight load\n lazyHandle.cancel();\n }\n\n // Track whether a mount has been scheduled but not yet started.\n // This is needed so that unmount/cancel can invalidate pending\n // scheduled mounts (e.g., rapid toggle: true → false → true).\n let mountScheduled = false;\n\n /**\n * Trigger mount with priority scheduling\n */\n function triggerMount(): void {\n mountScheduled = true;\n // Capture current generation so the microtask can detect cancellation.\n // cancelPendingMount bumps mountGeneration, so if it fires between\n // scheduling and execution, the microtask will see the mismatch.\n const expectedGen = mountGeneration;\n const result = scheduleByPriority(() => {\n mountScheduled = false;\n if (expectedGen !== mountGeneration) return; // cancelled\n mountComponent();\n }, priority);\n\n // Track idle callback ID for cleanup\n if (typeof result === 'number') {\n idleCallbackId = result;\n }\n }\n\n /**\n * Cancel any pending scheduled mount that hasn't started yet.\n * Bumps mountGeneration to also invalidate any in-flight async mounts.\n */\n function cancelPendingMount(): void {\n if (mountScheduled) {\n mountScheduled = false;\n mountGeneration++;\n // Cancel pending idle callback if one is tracked\n if (\n idleCallbackId !== undefined &&\n typeof cancelIdleCallback !== 'undefined'\n ) {\n cancelIdleCallback(idleCallbackId);\n idleCallbackId = undefined;\n }\n }\n }\n\n // Subscribe to lazy handle state for external retry support\n // This allows calling lazyHandle.retry() from error slot buttons\n const stopStateEffect = effect(() => {\n const handleState = lazyHandle.state();\n const elementState = element.getAttribute('data-defer-state');\n\n // If handle loaded externally (via retry) and we're in error state, try to mount\n if (\n handleState === 'loaded' &&\n !isMounted &&\n !isMounting &&\n elementState === 'error'\n ) {\n // Hide error slot\n if (errorEl) {\n errorEl.style.display = 'none';\n }\n // Mount the component - it will handle state transitions\n mountComponent();\n }\n });\n\n disposers.push(stopStateEffect);\n\n // Setup trigger based on mode\n if (trigger === 'visible') {\n // Visibility trigger using IntersectionObserver\n // IMPORTANT: Observe the placeholder (which is visible), not the hidden element\n // If no placeholder exists, create a sentinel element to observe\n let observeTarget: Element;\n let sentinelEl: HTMLElement | null = null;\n\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n observeTarget = placeholderEl;\n } else {\n // Create a minimal sentinel element to observe\n sentinelEl = document.createElement('span');\n sentinelEl.style.display = 'inline-block';\n sentinelEl.style.width = '1px';\n sentinelEl.style.height = '1px';\n parent.insertBefore(sentinelEl, element);\n observeTarget = sentinelEl;\n }\n\n const stopObserving = observeVisibilityOnce(observeTarget, triggerMount, {\n rootMargin: DEFAULT_VISIBILITY_MARGIN,\n });\n\n disposers.push(() => {\n stopObserving();\n // Remove sentinel if we created one\n if (sentinelEl && sentinelEl.parentNode) {\n sentinelEl.parentNode.removeChild(sentinelEl);\n }\n cleanup();\n });\n } else if (trigger === 'when' && whenExpr) {\n // Boolean trigger using effect\n const conditionGetter = compileExpression<boolean>(\n whenExpr,\n context,\n false\n );\n\n const stopEffect = effect(() => {\n const shouldShow = conditionGetter();\n\n if (shouldShow) {\n // Mount component (chunk is cached after first load, so remounting is fast)\n if (!isMounted && !isMounting && !mountScheduled) {\n triggerMount();\n }\n } else {\n // Cancel any scheduled-but-not-started mount first (handles rapid toggle)\n cancelPendingMount();\n\n // Destroy component when condition becomes false\n // This is consistent with React, Vue, Angular - no automatic show/hide\n if (isMounted || isMounting) {\n unmountComponent();\n }\n // Hide error slot when condition becomes false (after a failed load)\n if (errorEl) {\n errorEl.style.display = 'none';\n }\n }\n });\n\n disposers.push(() => {\n stopEffect();\n cleanup();\n });\n } else {\n if (import.meta.env?.DEV) {\n console.warn(`[pithy] @defer=\"when\" requires @when attribute`, element);\n }\n }\n }\n}\n"]}
|
|
@@ -33,11 +33,22 @@ export declare function clearBoundaryError(boundary: BoundaryInfo): void;
|
|
|
33
33
|
* Sets an error on a boundary with escalation logic
|
|
34
34
|
* If the boundary is already in error state, escalates to parent boundary
|
|
35
35
|
* Matches React behavior: first error wins, subsequent errors ignored
|
|
36
|
+
*
|
|
36
37
|
* @param boundary - The boundary to set error on
|
|
37
38
|
* @param error - The error to set
|
|
39
|
+
* @returns `true` if some boundary took ownership of `error`; `false` if it was
|
|
40
|
+
* dropped because this boundary was already showing an error and no ancestor
|
|
41
|
+
* boundary was free to take it.
|
|
42
|
+
*
|
|
43
|
+
* Callers must not assume the error was handled. A component rendering inside an
|
|
44
|
+
* *active* boundary's `@fallback` hits exactly the `false` path — the fallback is
|
|
45
|
+
* the part the user actually sees, so a crash there that nobody records ships a
|
|
46
|
+
* visibly broken page with a green build. `bindComponentTags` and
|
|
47
|
+
* `applyComponent` use the return value to decide between retracting an SSR
|
|
48
|
+
* crash record and adding one.
|
|
38
49
|
*/
|
|
39
|
-
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"setBoundaryError","stability":"stable","signature":"(boundary: BoundaryInfo, error: Error) =>
|
|
40
|
-
export declare function setBoundaryError(boundary: BoundaryInfo, error: Error):
|
|
50
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"setBoundaryError","stability":"stable","signature":"(boundary: BoundaryInfo, error: Error) => boolean"} */
|
|
51
|
+
export declare function setBoundaryError(boundary: BoundaryInfo, error: Error): boolean;
|
|
41
52
|
/**
|
|
42
53
|
* Runs a function within the context of a specific boundary
|
|
43
54
|
* Used for scoping async operations to the correct boundary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindErrorBoundary.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"bindErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindErrorBoundary.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAU,MAAM,EAAW,MAAM,kBAAkB,CAAC;AAI3D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,KAAK,GAAG,IA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