@pyreon/core 0.12.15 → 0.13.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.
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
5386
5386
  </script>
5387
5387
  <script>
5388
5388
  /*<!--*/
5389
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"92f3863f-1","name":"lifecycle.ts"},{"uid":"92f3863f-3","name":"component.ts"},{"uid":"92f3863f-5","name":"context.ts"},{"uid":"92f3863f-7","name":"h.ts"},{"uid":"92f3863f-9","name":"dynamic.ts"},{"uid":"92f3863f-11","name":"telemetry.ts"},{"uid":"92f3863f-13","name":"error-boundary.ts"},{"uid":"92f3863f-15","name":"for.ts"},{"uid":"92f3863f-17","name":"lazy.ts"},{"uid":"92f3863f-19","name":"map-array.ts"},{"uid":"92f3863f-21","name":"portal.ts"},{"uid":"92f3863f-23","name":"props.ts"},{"uid":"92f3863f-25","name":"ref.ts"},{"uid":"92f3863f-27","name":"show.ts"},{"uid":"92f3863f-29","name":"style.ts"},{"uid":"92f3863f-31","name":"suspense.ts"},{"uid":"92f3863f-33","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"92f3863f-1":{"renderedLength":2776,"gzipLength":1260,"brotliLength":0,"metaUid":"92f3863f-0"},"92f3863f-3":{"renderedLength":1430,"gzipLength":679,"brotliLength":0,"metaUid":"92f3863f-2"},"92f3863f-5":{"renderedLength":3089,"gzipLength":1336,"brotliLength":0,"metaUid":"92f3863f-4"},"92f3863f-7":{"renderedLength":1082,"gzipLength":597,"brotliLength":0,"metaUid":"92f3863f-6"},"92f3863f-9":{"renderedLength":339,"gzipLength":245,"brotliLength":0,"metaUid":"92f3863f-8"},"92f3863f-11":{"renderedLength":570,"gzipLength":346,"brotliLength":0,"metaUid":"92f3863f-10"},"92f3863f-13":{"renderedLength":1622,"gzipLength":822,"brotliLength":0,"metaUid":"92f3863f-12"},"92f3863f-15":{"renderedLength":700,"gzipLength":478,"brotliLength":0,"metaUid":"92f3863f-14"},"92f3863f-17":{"renderedLength":461,"gzipLength":273,"brotliLength":0,"metaUid":"92f3863f-16"},"92f3863f-19":{"renderedLength":1018,"gzipLength":571,"brotliLength":0,"metaUid":"92f3863f-18"},"92f3863f-21":{"renderedLength":818,"gzipLength":491,"brotliLength":0,"metaUid":"92f3863f-20"},"92f3863f-23":{"renderedLength":4151,"gzipLength":1595,"brotliLength":0,"metaUid":"92f3863f-22"},"92f3863f-25":{"renderedLength":86,"gzipLength":98,"brotliLength":0,"metaUid":"92f3863f-24"},"92f3863f-27":{"renderedLength":1892,"gzipLength":810,"brotliLength":0,"metaUid":"92f3863f-26"},"92f3863f-29":{"renderedLength":1858,"gzipLength":825,"brotliLength":0,"metaUid":"92f3863f-28"},"92f3863f-31":{"renderedLength":1096,"gzipLength":603,"brotliLength":0,"metaUid":"92f3863f-30"},"92f3863f-33":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"92f3863f-32"}},"nodeMetas":{"92f3863f-0":{"id":"/src/lifecycle.ts","moduleParts":{"index.js":"92f3863f-1"},"imported":[],"importedBy":[{"uid":"92f3863f-32"},{"uid":"92f3863f-2"},{"uid":"92f3863f-4"},{"uid":"92f3863f-12"}]},"92f3863f-2":{"id":"/src/component.ts","moduleParts":{"index.js":"92f3863f-3"},"imported":[{"uid":"92f3863f-0"}],"importedBy":[{"uid":"92f3863f-32"},{"uid":"92f3863f-12"}]},"92f3863f-4":{"id":"/src/context.ts","moduleParts":{"index.js":"92f3863f-5"},"imported":[{"uid":"92f3863f-0"}],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-6":{"id":"/src/h.ts","moduleParts":{"index.js":"92f3863f-7"},"imported":[],"importedBy":[{"uid":"92f3863f-32"},{"uid":"92f3863f-8"},{"uid":"92f3863f-16"},{"uid":"92f3863f-30"}]},"92f3863f-8":{"id":"/src/dynamic.ts","moduleParts":{"index.js":"92f3863f-9"},"imported":[{"uid":"92f3863f-6"}],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-10":{"id":"/src/telemetry.ts","moduleParts":{"index.js":"92f3863f-11"},"imported":[],"importedBy":[{"uid":"92f3863f-32"},{"uid":"92f3863f-12"}]},"92f3863f-12":{"id":"/src/error-boundary.ts","moduleParts":{"index.js":"92f3863f-13"},"imported":[{"uid":"92f3863f-34"},{"uid":"92f3863f-2"},{"uid":"92f3863f-0"},{"uid":"92f3863f-10"}],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-14":{"id":"/src/for.ts","moduleParts":{"index.js":"92f3863f-15"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-16":{"id":"/src/lazy.ts","moduleParts":{"index.js":"92f3863f-17"},"imported":[{"uid":"92f3863f-34"},{"uid":"92f3863f-6"}],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-18":{"id":"/src/map-array.ts","moduleParts":{"index.js":"92f3863f-19"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-20":{"id":"/src/portal.ts","moduleParts":{"index.js":"92f3863f-21"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-22":{"id":"/src/props.ts","moduleParts":{"index.js":"92f3863f-23"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-24":{"id":"/src/ref.ts","moduleParts":{"index.js":"92f3863f-25"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-26":{"id":"/src/show.ts","moduleParts":{"index.js":"92f3863f-27"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-28":{"id":"/src/style.ts","moduleParts":{"index.js":"92f3863f-29"},"imported":[],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-30":{"id":"/src/suspense.ts","moduleParts":{"index.js":"92f3863f-31"},"imported":[{"uid":"92f3863f-6"}],"importedBy":[{"uid":"92f3863f-32"}]},"92f3863f-32":{"id":"/src/index.ts","moduleParts":{"index.js":"92f3863f-33"},"imported":[{"uid":"92f3863f-2"},{"uid":"92f3863f-4"},{"uid":"92f3863f-8"},{"uid":"92f3863f-12"},{"uid":"92f3863f-14"},{"uid":"92f3863f-6"},{"uid":"92f3863f-16"},{"uid":"92f3863f-0"},{"uid":"92f3863f-18"},{"uid":"92f3863f-20"},{"uid":"92f3863f-22"},{"uid":"92f3863f-24"},{"uid":"92f3863f-26"},{"uid":"92f3863f-28"},{"uid":"92f3863f-30"},{"uid":"92f3863f-10"}],"importedBy":[],"isEntry":true},"92f3863f-34":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"92f3863f-12"},{"uid":"92f3863f-16"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5389
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"3de2ab69-1","name":"lifecycle.ts"},{"uid":"3de2ab69-3","name":"component.ts"},{"uid":"3de2ab69-5","name":"context.ts"},{"uid":"3de2ab69-7","name":"h.ts"},{"uid":"3de2ab69-9","name":"dynamic.ts"},{"uid":"3de2ab69-11","name":"telemetry.ts"},{"uid":"3de2ab69-13","name":"error-boundary.ts"},{"uid":"3de2ab69-15","name":"for.ts"},{"uid":"3de2ab69-17","name":"lazy.ts"},{"uid":"3de2ab69-19","name":"map-array.ts"},{"uid":"3de2ab69-21","name":"portal.ts"},{"uid":"3de2ab69-23","name":"props.ts"},{"uid":"3de2ab69-25","name":"ref.ts"},{"uid":"3de2ab69-27","name":"show.ts"},{"uid":"3de2ab69-29","name":"style.ts"},{"uid":"3de2ab69-31","name":"suspense.ts"},{"uid":"3de2ab69-33","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"3de2ab69-1":{"renderedLength":2776,"gzipLength":1260,"brotliLength":0,"metaUid":"3de2ab69-0"},"3de2ab69-3":{"renderedLength":1430,"gzipLength":679,"brotliLength":0,"metaUid":"3de2ab69-2"},"3de2ab69-5":{"renderedLength":2925,"gzipLength":1260,"brotliLength":0,"metaUid":"3de2ab69-4"},"3de2ab69-7":{"renderedLength":1082,"gzipLength":597,"brotliLength":0,"metaUid":"3de2ab69-6"},"3de2ab69-9":{"renderedLength":339,"gzipLength":245,"brotliLength":0,"metaUid":"3de2ab69-8"},"3de2ab69-11":{"renderedLength":570,"gzipLength":346,"brotliLength":0,"metaUid":"3de2ab69-10"},"3de2ab69-13":{"renderedLength":1622,"gzipLength":822,"brotliLength":0,"metaUid":"3de2ab69-12"},"3de2ab69-15":{"renderedLength":700,"gzipLength":478,"brotliLength":0,"metaUid":"3de2ab69-14"},"3de2ab69-17":{"renderedLength":461,"gzipLength":273,"brotliLength":0,"metaUid":"3de2ab69-16"},"3de2ab69-19":{"renderedLength":1018,"gzipLength":571,"brotliLength":0,"metaUid":"3de2ab69-18"},"3de2ab69-21":{"renderedLength":818,"gzipLength":491,"brotliLength":0,"metaUid":"3de2ab69-20"},"3de2ab69-23":{"renderedLength":4151,"gzipLength":1595,"brotliLength":0,"metaUid":"3de2ab69-22"},"3de2ab69-25":{"renderedLength":86,"gzipLength":98,"brotliLength":0,"metaUid":"3de2ab69-24"},"3de2ab69-27":{"renderedLength":1892,"gzipLength":810,"brotliLength":0,"metaUid":"3de2ab69-26"},"3de2ab69-29":{"renderedLength":1858,"gzipLength":825,"brotliLength":0,"metaUid":"3de2ab69-28"},"3de2ab69-31":{"renderedLength":1096,"gzipLength":603,"brotliLength":0,"metaUid":"3de2ab69-30"},"3de2ab69-33":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"3de2ab69-32"}},"nodeMetas":{"3de2ab69-0":{"id":"/src/lifecycle.ts","moduleParts":{"index.js":"3de2ab69-1"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"},{"uid":"3de2ab69-2"},{"uid":"3de2ab69-4"},{"uid":"3de2ab69-12"}]},"3de2ab69-2":{"id":"/src/component.ts","moduleParts":{"index.js":"3de2ab69-3"},"imported":[{"uid":"3de2ab69-0"}],"importedBy":[{"uid":"3de2ab69-32"},{"uid":"3de2ab69-12"}]},"3de2ab69-4":{"id":"/src/context.ts","moduleParts":{"index.js":"3de2ab69-5"},"imported":[{"uid":"3de2ab69-0"}],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-6":{"id":"/src/h.ts","moduleParts":{"index.js":"3de2ab69-7"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"},{"uid":"3de2ab69-8"},{"uid":"3de2ab69-16"},{"uid":"3de2ab69-30"}]},"3de2ab69-8":{"id":"/src/dynamic.ts","moduleParts":{"index.js":"3de2ab69-9"},"imported":[{"uid":"3de2ab69-6"}],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-10":{"id":"/src/telemetry.ts","moduleParts":{"index.js":"3de2ab69-11"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"},{"uid":"3de2ab69-12"}]},"3de2ab69-12":{"id":"/src/error-boundary.ts","moduleParts":{"index.js":"3de2ab69-13"},"imported":[{"uid":"3de2ab69-34"},{"uid":"3de2ab69-2"},{"uid":"3de2ab69-0"},{"uid":"3de2ab69-10"}],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-14":{"id":"/src/for.ts","moduleParts":{"index.js":"3de2ab69-15"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-16":{"id":"/src/lazy.ts","moduleParts":{"index.js":"3de2ab69-17"},"imported":[{"uid":"3de2ab69-34"},{"uid":"3de2ab69-6"}],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-18":{"id":"/src/map-array.ts","moduleParts":{"index.js":"3de2ab69-19"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-20":{"id":"/src/portal.ts","moduleParts":{"index.js":"3de2ab69-21"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-22":{"id":"/src/props.ts","moduleParts":{"index.js":"3de2ab69-23"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-24":{"id":"/src/ref.ts","moduleParts":{"index.js":"3de2ab69-25"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-26":{"id":"/src/show.ts","moduleParts":{"index.js":"3de2ab69-27"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-28":{"id":"/src/style.ts","moduleParts":{"index.js":"3de2ab69-29"},"imported":[],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-30":{"id":"/src/suspense.ts","moduleParts":{"index.js":"3de2ab69-31"},"imported":[{"uid":"3de2ab69-6"}],"importedBy":[{"uid":"3de2ab69-32"}]},"3de2ab69-32":{"id":"/src/index.ts","moduleParts":{"index.js":"3de2ab69-33"},"imported":[{"uid":"3de2ab69-2"},{"uid":"3de2ab69-4"},{"uid":"3de2ab69-8"},{"uid":"3de2ab69-12"},{"uid":"3de2ab69-14"},{"uid":"3de2ab69-6"},{"uid":"3de2ab69-16"},{"uid":"3de2ab69-0"},{"uid":"3de2ab69-18"},{"uid":"3de2ab69-20"},{"uid":"3de2ab69-22"},{"uid":"3de2ab69-24"},{"uid":"3de2ab69-26"},{"uid":"3de2ab69-28"},{"uid":"3de2ab69-30"},{"uid":"3de2ab69-10"}],"importedBy":[],"isEntry":true},"3de2ab69-34":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"3de2ab69-12"},{"uid":"3de2ab69-16"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5390
5390
 
5391
5391
  const run = () => {
5392
5392
  const width = window.innerWidth;
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { signal } from "@pyreon/reactivity";
2
2
 
3
3
  //#region src/lifecycle.ts
4
- const __DEV__$4 = import.meta.env?.DEV === true;
4
+ const __DEV__$3 = import.meta.env?.DEV === true;
5
5
  let _current = null;
6
6
  function setCurrentHooks(hooks) {
7
7
  _current = hooks;
@@ -40,7 +40,7 @@ function captureCallSite() {
40
40
  return "";
41
41
  }
42
42
  function warnOutsideSetup(hookName) {
43
- if (__DEV__$4 && !_current) {
43
+ if (__DEV__$3 && !_current) {
44
44
  const callSite = captureCallSite();
45
45
  const location = callSite ? `\n Called from: ${callSite}` : "";
46
46
  console.warn(`[Pyreon] ${hookName}() called outside component setup. Lifecycle hooks must be called synchronously during a component's setup function.` + location + (hookName === "onUnmount" ? "\n Hint: `provide()` internally calls onUnmount(). If you use provide(), ensure it runs during synchronous component setup — not inside effects, callbacks, or after awaits." : ""));
@@ -178,16 +178,13 @@ function setContextStackProvider(fn) {
178
178
  function getStack() {
179
179
  return _stackProvider();
180
180
  }
181
- const __DEV__$3 = import.meta.env?.DEV === true;
181
+ import.meta.env?.DEV;
182
182
  function pushContext(values) {
183
183
  getStack().push(values);
184
184
  }
185
185
  function popContext() {
186
186
  const stack = getStack();
187
- if (__DEV__$3 && stack.length === 0) {
188
- console.warn("[Pyreon] popContext() called on an empty context stack. This likely indicates a missing Provider.");
189
- return;
190
- }
187
+ if (stack.length === 0) return;
191
188
  stack.pop();
192
189
  }
193
190
  function useContext(context) {
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["__DEV__","__DEV__","__DEV__","__DEV__"],"sources":["../src/lifecycle.ts","../src/component.ts","../src/context.ts","../src/h.ts","../src/dynamic.ts","../src/telemetry.ts","../src/error-boundary.ts","../src/for.ts","../src/lazy.ts","../src/map-array.ts","../src/portal.ts","../src/props.ts","../src/ref.ts","../src/show.ts","../src/style.ts","../src/suspense.ts"],"sourcesContent":["import type { CleanupFn, LifecycleHooks } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n// The currently-executing component's hook storage, set by the renderer\n// before calling the component function, cleared immediately after.\nlet _current: LifecycleHooks | null = null\n\nexport function setCurrentHooks(hooks: LifecycleHooks | null) {\n _current = hooks\n}\n\nexport function getCurrentHooks(): LifecycleHooks | null {\n return _current\n}\n\n/**\n * Extract the first stack frame that's NOT inside the framework itself.\n * Walks the stack from top, skipping:\n * - V8/JSC internals (`at <anonymous>`, no filename)\n * - Framework files (packages/core/core/src/lifecycle.ts, etc.)\n * - The warning infra itself (warnOutsideSetup, the hook wrapper)\n *\n * Returns a string like \"at MyComponent (src/components/Foo.tsx:42:15)\"\n * — the call site a user needs to fix. Returns an empty string if no\n * user-code frame is found (unlikely in practice).\n */\nfunction captureCallSite(): string {\n const err = new Error()\n const stack = err.stack\n if (!stack) return ''\n const lines = stack.split('\\n')\n // Framework paths to skip — conservative, matches the packages that\n // contain lifecycle / provide / context internals and call these hooks.\n const skipPatterns = [\n /lifecycle\\.ts/,\n /\\/context\\.ts/,\n /\\/component\\.ts/,\n /\\/core\\/src\\//,\n /\\/runtime-dom\\/src\\//,\n /\\/runtime-server\\/src\\//,\n // node:internal frames\n /node:internal/,\n // chrome devtools source mappings\n /webpack-internal/,\n /<anonymous>/,\n ]\n for (const line of lines) {\n if (!line.includes('at ')) continue\n if (skipPatterns.some((p) => p.test(line))) continue\n // Strip leading \" at \" and return the rest\n return line.trim()\n }\n return ''\n}\n\nfunction warnOutsideSetup(hookName: string): void {\n if (__DEV__ && !_current) {\n const callSite = captureCallSite()\n const location = callSite ? `\\n Called from: ${callSite}` : ''\n // oxlint-disable-next-line no-console\n console.warn(\n `[Pyreon] ${hookName}() called outside component setup. ` +\n \"Lifecycle hooks must be called synchronously during a component's setup function.\" +\n location +\n (hookName === 'onUnmount'\n ? '\\n Hint: `provide()` internally calls onUnmount(). If you use provide(), ensure it runs during synchronous component setup — not inside effects, callbacks, or after awaits.'\n : ''),\n )\n }\n}\n\n/**\n * Register a callback to run after the component is mounted to the DOM.\n * Optionally return a cleanup function — it will run on unmount.\n */\nexport function onMount(fn: () => CleanupFn | void | undefined) {\n warnOutsideSetup('onMount')\n _current?.mount.push(fn)\n}\n\n/**\n * Register a callback to run when the component is removed from the DOM.\n */\nexport function onUnmount(fn: () => void) {\n warnOutsideSetup('onUnmount')\n _current?.unmount.push(fn)\n}\n\n/**\n * Register a callback to run after each reactive update.\n */\nexport function onUpdate(fn: () => void) {\n warnOutsideSetup('onUpdate')\n _current?.update.push(fn)\n}\n\n/**\n * Register an error handler for this component subtree.\n *\n * When an error is thrown during rendering or in a child component,\n * the nearest `onErrorCaptured` handler is called with the error.\n * Return `true` to mark the error as handled and stop propagation.\n *\n * @example\n * onErrorCaptured((err) => {\n * setError(String(err))\n * return true // handled — don't propagate\n * })\n */\nexport function onErrorCaptured(fn: (err: unknown) => boolean | undefined) {\n warnOutsideSetup('onErrorCaptured')\n _current?.error.push(fn)\n}\n","import { setCurrentHooks } from './lifecycle'\nimport type { ComponentFn, LifecycleHooks, Props, VNodeChild } from './types'\n\n/**\n * Identity wrapper — marks a function as a Pyreon component and preserves its type.\n * Useful for IDE tooling and future compiler optimisations.\n */\nexport function defineComponent<P extends Props>(fn: ComponentFn<P>): ComponentFn<P> {\n return fn\n}\n\n/**\n * Run a component function in a tracked context so that lifecycle hooks\n * registered inside it (onMount, onUnmount, onErrorCaptured, etc.) are captured.\n *\n * Called by the renderer — not intended for user code.\n */\nexport function runWithHooks<P extends Props>(\n fn: ComponentFn<P>,\n props: P,\n): { vnode: VNodeChild; hooks: LifecycleHooks } {\n const hooks: LifecycleHooks = { mount: [], unmount: [], update: [], error: [] }\n setCurrentHooks(hooks)\n let vnode: VNodeChild = null\n try {\n vnode = fn(props)\n } finally {\n setCurrentHooks(null)\n }\n return { vnode, hooks }\n}\n\n/**\n * Walk up error handlers collected during component rendering.\n * Returns true if any handler marked the error as handled.\n */\nexport function propagateError(err: unknown, hooks: LifecycleHooks): boolean {\n for (const handler of hooks.error) {\n if (handler(err) === true) return true\n }\n return false\n}\n\n// ─── Error boundary stack ────────────────────────────────────────────────────\n// Module-level stack of active ErrorBoundary handlers (innermost last).\n// ErrorBoundary pushes during its own setup (before children mount) so that\n// any child mountComponent error can dispatch up to the nearest boundary.\n\nconst _errorBoundaryStack: ((err: unknown) => boolean)[] = []\n\nexport function pushErrorBoundary(handler: (err: unknown) => boolean): void {\n _errorBoundaryStack.push(handler)\n}\n\nexport function popErrorBoundary(): void {\n _errorBoundaryStack.pop()\n}\n\n/**\n * Dispatch an error to the nearest active ErrorBoundary.\n * Returns true if the boundary handled it, false if none was registered.\n */\nexport function dispatchToErrorBoundary(err: unknown): boolean {\n const handler = _errorBoundaryStack[_errorBoundaryStack.length - 1]\n return handler ? handler(err) : false\n}\n","/**\n * Provide / inject — like React context or Vue provide/inject.\n *\n * Values flow down the component tree without prop-drilling.\n * The renderer maintains the context stack as it walks the VNode tree.\n */\n\nimport { onUnmount } from './lifecycle'\n\nexport interface Context<T> {\n readonly id: symbol\n readonly defaultValue: T\n}\n\n/** Branded marker for reactive contexts — distinguishes from regular Context at type level. */\ndeclare const REACTIVE_BRAND: unique symbol\n\n/**\n * A context whose value is a reactive accessor `() => T`.\n *\n * When you `useContext(reactiveCtx)`, TypeScript returns `() => T` —\n * you MUST call the accessor to read the value. This prevents the\n * destructuring trap that breaks reactivity with getter-based objects.\n *\n * @example\n * const ModeCtx = createReactiveContext<'light' | 'dark'>('light')\n * // Provider: provide(ModeCtx, () => modeSignal())\n * // Consumer: const getMode = useContext(ModeCtx); getMode() // 'light'\n */\nexport interface ReactiveContext<T> extends Context<() => T> {\n readonly [REACTIVE_BRAND]: T\n}\n\nexport function createContext<T>(defaultValue: T): Context<T> {\n return { id: Symbol('PyreonContext'), defaultValue }\n}\n\n/**\n * Create a reactive context. Consumers get `() => T` and must call it.\n * This is the safe pattern for values that change over time (mode, locale, etc.).\n */\nexport function createReactiveContext<T>(defaultValue: T): ReactiveContext<T> {\n return createContext<() => T>(() => defaultValue) as ReactiveContext<T>\n}\n\n// ─── Runtime context stack (managed by the renderer) ─────────────────────────\n\n// Default stack — used for CSR and single-threaded SSR.\n// On Node.js with concurrent requests, @pyreon/runtime-server replaces this with\n// an AsyncLocalStorage-backed provider via setContextStackProvider().\nconst _defaultStack: Map<symbol, unknown>[] = []\nlet _stackProvider: () => Map<symbol, unknown>[] = () => _defaultStack\n\n/**\n * Override the context stack provider. Called by @pyreon/runtime-server to\n * inject an AsyncLocalStorage-backed stack that isolates concurrent SSR requests.\n * Has no effect in the browser (CSR always uses the default module-level stack).\n */\nexport function setContextStackProvider(fn: () => Map<symbol, unknown>[]): void {\n _stackProvider = fn\n}\n\nfunction getStack(): Map<symbol, unknown>[] {\n return _stackProvider()\n}\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\nexport function pushContext(values: Map<symbol, unknown>) {\n getStack().push(values)\n}\n\nexport function popContext() {\n const stack = getStack()\n if (__DEV__ && stack.length === 0) {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Pyreon] popContext() called on an empty context stack. This likely indicates a missing Provider.',\n )\n return\n }\n stack.pop()\n}\n\n/**\n * Read the nearest provided value for a context.\n * Falls back to `context.defaultValue` if none found.\n *\n * For ReactiveContext<T>, returns `() => T` — you MUST call the accessor.\n * For regular Context<T>, returns `T` directly.\n */\nexport function useContext<T>(context: ReactiveContext<T>): () => T\nexport function useContext<T>(context: Context<T>): T\nexport function useContext<T>(context: Context<T>): T {\n const stack = getStack()\n for (let i = stack.length - 1; i >= 0; i--) {\n const frame = stack[i]\n if (frame?.has(context.id)) {\n return frame.get(context.id) as T\n }\n }\n return context.defaultValue\n}\n\n/**\n * Provide a context value for the current component's subtree.\n * Must be called during component setup (like onMount/onUnmount).\n * Automatically cleaned up when the component unmounts.\n *\n * @example\n * const ThemeProvider = ({ children }: { children: VNodeChild }) => {\n * provide(ThemeContext, { color: \"blue\" })\n * return children\n * }\n */\nexport function provide<T>(context: Context<T>, value: T): void {\n pushContext(new Map<symbol, unknown>([[context.id, value]]))\n onUnmount(() => popContext())\n}\n\n/**\n * Provide a value for `context` during `fn()`.\n * Used by the renderer when it encounters a `<Provider>` component.\n */\nexport function withContext<T>(context: Context<T>, value: T, fn: () => void) {\n const frame = new Map<symbol, unknown>([[context.id, value]])\n pushContext(frame)\n try {\n fn()\n } finally {\n popContext()\n }\n}\n\n// ─── Context snapshot for deferred mounting ─────────────────────────────────\n\nexport type ContextSnapshot = Map<symbol, unknown>[]\n\n/**\n * Capture a snapshot of the current context stack.\n *\n * Used by `mountReactive` to preserve the context that was active when a\n * reactive boundary (e.g. `<Show>`, `<For>`) was set up. When the boundary\n * later mounts new children inside an effect, the snapshot is restored so\n * those children can see ancestor providers via `useContext()`.\n */\nexport function captureContextStack(): ContextSnapshot {\n // Shallow copy — each frame (Map) is shared by reference, which is\n // correct because providers don't mutate frames after creation.\n return [...getStack()]\n}\n\n/**\n * Execute `fn()` with a previously captured context stack active.\n * Restores the original stack after `fn()` completes (even on throw).\n */\nexport function restoreContextStack<T>(snapshot: ContextSnapshot, fn: () => T): T {\n const stack = getStack()\n const savedLength = stack.length\n\n // Push all captured frames onto the current stack\n for (const frame of snapshot) {\n stack.push(frame)\n }\n\n try {\n return fn()\n } finally {\n // Remove only the frames we pushed (preserve anything added by fn)\n stack.length = savedLength\n }\n}\n","import type { ComponentFn, Props, VNode, VNodeChild } from './types'\n\n/** Marker for fragment nodes — renders children without a wrapper element */\nexport const Fragment: unique symbol = Symbol('Pyreon.Fragment')\n\n/**\n * Hyperscript function — the compiled output of JSX.\n * `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n *\n * Generic on P so TypeScript validates props match the component's signature\n * at the call site, then stores the result in the loosely-typed VNode.\n */\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nexport const EMPTY_PROPS: Props = {} as Props\n\n/** Makes `children` optional in P (if present) so it can be passed as rest args to h(). */\ntype PropsWithOptionalChildren<P extends Props> = Omit<P, 'children'> &\n ('children' extends keyof P ? { children?: P['children'] } : unknown)\n\n// Overload: component with typed props — children is optional in the props object\n// because it can be passed as rest args. Extra keys are allowed via `& Props`.\nexport function h<P extends Props>(\n type: ComponentFn<P>,\n props: (PropsWithOptionalChildren<P> & Props) | null,\n ...children: VNodeChild[]\n): VNode\n// Overload: intrinsic element, symbol, generic/dynamic component, or mixed union\nexport function h(\n type: string | ((p: any) => VNodeChild) | symbol,\n props: Props | null,\n ...children: VNodeChild[]\n): VNode\nexport function h<P extends Props>(\n type: string | ComponentFn<P> | symbol,\n props: P | null,\n ...children: VNodeChild[]\n): VNode {\n return {\n type: type as string | ComponentFn | symbol,\n props: (props ?? EMPTY_PROPS) as Props,\n children: normalizeChildren(children),\n key: (props?.key as string | number | null) ?? null,\n }\n}\n\nfunction normalizeChildren(children: VNodeChild[]): VNodeChild[] {\n // Fast path: no nested arrays — return as-is without allocating\n for (let i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return flattenChildren(children)\n }\n }\n return children\n}\n\nfunction flattenChildren(children: VNodeChild[]): VNodeChild[] {\n const result: VNodeChild[] = []\n for (const child of children) {\n if (Array.isArray(child)) {\n result.push(...flattenChildren(child as VNodeChild[]))\n } else {\n result.push(child)\n }\n }\n return result\n}\n","import { h } from './h'\nimport type { ComponentFn, Props, VNode } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\nexport interface DynamicProps extends Props {\n component: ComponentFn | string\n}\n\nexport function Dynamic(props: DynamicProps): VNode | null {\n const { component, ...rest } = props\n if (__DEV__ && !component) {\n // oxlint-disable-next-line no-console\n console.warn('[Pyreon] <Dynamic> received a falsy `component` prop. Nothing will be rendered.')\n }\n if (!component) return null\n return h(component as string | ComponentFn, rest as Props)\n}\n","/**\n * Error telemetry — hook into Pyreon's error reporting for Sentry, Datadog, etc.\n *\n * @example\n * import { registerErrorHandler } from \"@pyreon/core\"\n * import * as Sentry from \"@sentry/browser\"\n *\n * registerErrorHandler(ctx => {\n * Sentry.captureException(ctx.error, {\n * extra: { component: ctx.component, phase: ctx.phase },\n * })\n * })\n */\n\nexport interface ErrorContext {\n /** Component function name, or \"Anonymous\" */\n component: string\n /** Lifecycle phase where the error occurred */\n phase: 'setup' | 'render' | 'mount' | 'unmount' | 'effect'\n /** The thrown value */\n error: unknown\n /** Unix timestamp (ms) */\n timestamp: number\n /** Component props at the time of the error */\n props?: Record<string, unknown>\n}\n\nexport type ErrorHandler = (ctx: ErrorContext) => void\n\nlet _handlers: ErrorHandler[] = []\n\n/**\n * Register a global error handler. Called whenever a component throws in any\n * lifecycle phase. Returns an unregister function.\n */\nexport function registerErrorHandler(handler: ErrorHandler): () => void {\n _handlers.push(handler)\n return () => {\n _handlers = _handlers.filter((h) => h !== handler)\n }\n}\n\n/**\n * Internal — called by the runtime whenever a component error is caught.\n * Existing console.error calls are preserved; this is additive.\n */\nexport function reportError(ctx: ErrorContext): void {\n for (const h of _handlers) {\n try {\n h(ctx)\n } catch {\n // handler errors must never propagate back into the framework\n }\n }\n}\n","import { signal } from '@pyreon/reactivity'\nimport { popErrorBoundary, pushErrorBoundary } from './component'\nimport { onUnmount } from './lifecycle'\nimport { reportError } from './telemetry'\nimport type { VNodeChild, VNodeChildAtom } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n/**\n * ErrorBoundary — catches errors thrown by child components and renders a\n * fallback UI instead of crashing the whole tree.\n *\n * Also reports caught errors to any registered telemetry handlers.\n *\n * How error propagation works:\n * ErrorBoundary pushes a handler onto the module-level boundary stack\n * synchronously during its own setup (before children are mounted).\n * When mountComponent catches a child error, it calls dispatchToErrorBoundary()\n * which invokes the innermost boundary's handler.\n *\n * Usage:\n * h(ErrorBoundary, {\n * fallback: (err) => h(\"p\", null, `Error: ${err}`),\n * children: h(MyComponent, null),\n * })\n *\n * // or with JSX:\n * <ErrorBoundary fallback={(err) => <p>Error: {String(err)}</p>}>\n * <MyComponent />\n * </ErrorBoundary>\n */\nexport function ErrorBoundary(props: {\n /**\n * Rendered when a child throws. Receives the caught error and a `reset`\n * function — calling `reset()` clears the error and re-renders children.\n */\n fallback: (err: unknown, reset: () => void) => VNodeChild\n children?: VNodeChild\n}): VNodeChild {\n if (__DEV__ && typeof props.fallback !== 'function') {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Pyreon] <ErrorBoundary> expects `fallback` to be a function: (err, reset) => VNode. ' +\n `Received ${typeof props.fallback}.`,\n )\n }\n\n const error = signal<unknown>(null)\n const reset = () => error.set(null)\n\n const handler = (err: unknown): boolean => {\n if (error.peek() !== null) return false // already in error state — let outer boundary catch it\n error.set(err)\n reportError({ component: 'ErrorBoundary', phase: 'render', error: err, timestamp: Date.now() })\n return true\n }\n\n // Push synchronously — before children are mounted — so child errors see this boundary\n pushErrorBoundary(handler)\n onUnmount(() => popErrorBoundary())\n\n return (): VNodeChildAtom => {\n const err = error()\n if (err != null) return props.fallback(err, reset) as VNodeChildAtom\n const ch = props.children\n return (typeof ch === 'function' ? ch() : ch) as VNodeChildAtom\n }\n}\n","import type { NativeItem, Props, VNode } from './types'\n\n/**\n * Symbol used as the VNode type for a For list — runtime-dom handles it\n * via mountFor, bypassing the generic VNode reconciler.\n */\nexport const ForSymbol: unique symbol = Symbol('pyreon.For')\n\nexport interface ForProps<T> {\n each: () => T[]\n /** Keying function — use `by` not `key` (JSX extracts `key` for VNode reconciliation). */\n by: (item: T) => string | number\n children: (item: T) => VNode | NativeItem\n /**\n * @deprecated Use `by` instead of `key`. In Pyreon, `<For>` uses `by` for keying.\n * JSX reserves `key` for VNode reconciliation — it won't reach the component.\n */\n key?: never\n}\n\n/**\n * Efficient reactive list rendering.\n *\n * Unlike a plain `() => items().map(item => h(...))`, For never re-creates\n * VNodes for existing keys — only new keys invoke `children()`. Structural\n * mutations (swap, sort, filter) are O(n) key scan + O(k) DOM moves where k\n * is the number of actually displaced entries.\n *\n * Usage:\n * <For each={items} by={r => r.id}>{r => <li>...</li>}</For>\n */\nexport function For<T>(props: ForProps<T>): VNode {\n return {\n type: ForSymbol as unknown as string,\n props: props as unknown as Props,\n children: [],\n key: null,\n }\n}\n","import { signal } from '@pyreon/reactivity'\nimport { h } from './h'\nimport type { LazyComponent } from './suspense'\nimport type { ComponentFn, Props } from './types'\n\nexport function lazy<P extends Props>(\n load: () => Promise<{ default: ComponentFn<P> }>,\n): LazyComponent<P> {\n const loaded = signal<ComponentFn<P> | null>(null)\n const error = signal<Error | null>(null)\n\n load()\n .then((m) => loaded.set(m.default))\n .catch((e) => error.set(e instanceof Error ? e : new Error(String(e))))\n\n const wrapper = ((props: P) => {\n const err = error()\n if (err) throw err\n const comp = loaded()\n return comp ? h(comp as ComponentFn, props as Props) : null\n }) as LazyComponent<P>\n\n wrapper.__loading = () => loaded() === null && error() === null\n return wrapper\n}\n","/**\n * mapArray — keyed reactive list mapping.\n *\n * Creates each mapped item exactly once per key, then reuses it across\n * updates. When the source array is reordered or partially changed, only\n * new keys invoke `map()`; existing entries return the cached result.\n *\n * This makes structural list operations (swap, sort, filter) O(k) in\n * allocations where k is the number of new/removed keys, not O(n).\n *\n * The returned accessor reads `source()` reactively, so it can be passed\n * directly to the keyed-list reconciler.\n */\nexport function mapArray<T, U>(\n source: () => T[],\n getKey: (item: T) => string | number,\n map: (item: T) => U,\n): () => U[] {\n const cache = new Map<string | number, U>()\n\n return () => {\n const items = source()\n const result: U[] = []\n const newKeys = new Set<string | number>()\n\n for (const item of items) {\n const key = getKey(item)\n newKeys.add(key)\n if (!cache.has(key)) {\n cache.set(key, map(item))\n }\n result.push(cache.get(key) as U)\n }\n\n // Evict entries whose keys are no longer present\n for (const key of cache.keys()) {\n if (!newKeys.has(key)) cache.delete(key)\n }\n\n return result\n }\n}\n","import type { Props, VNode, VNodeChild } from './types'\n\n/**\n * Symbol used as the VNode type for a Portal — runtime-dom mounts the\n * children into `target` instead of the normal parent.\n */\nexport const PortalSymbol: unique symbol = Symbol('pyreon.Portal')\n\nexport interface PortalProps {\n /** DOM element to render children into (e.g. document.body). */\n target: Element\n children: VNodeChild\n}\n\n/**\n * Portal — renders `children` into a different DOM node than the\n * current parent tree.\n *\n * Useful for modals, tooltips, dropdowns, and any overlay that needs to\n * escape CSS overflow/stacking context restrictions.\n *\n * @example\n * // Render a modal at document.body level regardless of where in the\n * // component tree <Modal> is used:\n * Portal({ target: document.body, children: h(Modal, { onClose }) })\n *\n * // JSX:\n * <Portal target={document.body}>\n * <Modal onClose={close} />\n * </Portal>\n */\nexport function Portal(props: PortalProps): VNode {\n return {\n type: PortalSymbol as unknown as string,\n props: props as unknown as Props,\n children: [],\n key: null,\n }\n}\n","// Prop utilities for component authoring.\n\n/**\n * Split props into two groups: keys you want and the rest.\n * Unlike destructuring, this preserves reactivity (getters on the original object).\n *\n * @example\n * const [own, html] = splitProps(props, [\"label\", \"icon\"])\n * return <button {...html}><Icon name={own.icon} /> {own.label}</button>\n */\nexport function splitProps<T extends object, K extends (keyof T)[]>(\n props: T,\n keys: K,\n): [Pick<T, K[number]>, Omit<T, K[number]>] {\n const picked = {} as Pick<T, K[number]>\n const rest = {} as Omit<T, K[number]>\n const keySet = new Set<string | symbol>(keys as (string | symbol)[])\n\n // Reflect.ownKeys includes symbol-keyed properties; Object.keys drops them\n // silently. Without this, symbol-keyed props (e.g. branded reactive props\n // under Symbol.for('pyreon.reactiveProp')) would vanish from both picked\n // and rest.\n for (const key of Reflect.ownKeys(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, key)\n if (!desc) continue\n // Force configurable: true when copying to a fresh object. Source descriptors\n // may be non-configurable (default when created with `Object.defineProperty`\n // and the caller omitted `configurable`). If we preserved that, any later\n // `Object.defineProperty` on the same key — including subsequent splitProps\n // post-processing or test mocks — would throw \"Cannot redefine property\".\n const safe = { ...desc, configurable: true }\n if (keySet.has(key)) {\n Object.defineProperty(picked, key, safe)\n } else {\n Object.defineProperty(rest, key, safe)\n }\n }\n\n return [picked, rest]\n}\n\n/** Merge a getter-backed source property with an existing getter or value. */\nfunction mergeGetterWithExisting(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n existing: PropertyDescriptor,\n): void {\n const prevGet = existing.get ?? (() => existing.value)\n const nextGet = desc.get as () => unknown\n Object.defineProperty(result, key, {\n get: () => {\n const v = nextGet()\n return v !== undefined ? v : prevGet()\n },\n enumerable: true,\n configurable: true,\n })\n}\n\n/** Merge a static source property when the existing property has a getter. */\nfunction mergeStaticWithGetter(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n existingGet: () => unknown,\n): void {\n if (desc.value !== undefined) {\n Object.defineProperty(result, key, { ...desc, configurable: true })\n } else {\n Object.defineProperty(result, key, {\n get: existingGet,\n enumerable: true,\n configurable: true,\n })\n }\n}\n\n/** Apply a single source property onto the result object, handling getter/static combos. */\nfunction mergeProperty(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n): void {\n const existing = Object.getOwnPropertyDescriptor(result, key)\n if (desc.get && existing) {\n mergeGetterWithExisting(result, key, desc, existing)\n } else if (desc.get) {\n // Force configurable: true — source getters may have been defined via\n // `Object.defineProperty` without an explicit configurable flag (which\n // defaults to false). Without this, a later source in the same mergeProps\n // call that overrides the same key would crash with TypeError:\n // \"Cannot redefine property\".\n Object.defineProperty(result, key, { ...desc, configurable: true })\n } else if (existing?.get) {\n mergeStaticWithGetter(result, key, desc, existing.get)\n } else if (desc.value !== undefined || !existing) {\n // Both static — later value wins if defined\n Object.defineProperty(result, key, { ...desc, configurable: true })\n }\n}\n\n/**\n * Merge default values with component props. Defaults are used when\n * the prop is `undefined`. Preserves getter reactivity.\n *\n * @example\n * const merged = mergeProps({ size: \"md\", variant: \"primary\" }, props)\n * // merged.size is reactive — falls back to \"md\" when props.size is undefined\n */\nexport function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T {\n const result = {} as T\n for (const source of sources) {\n // See splitProps for why this uses Reflect.ownKeys instead of Object.keys.\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key)\n if (!desc) continue\n mergeProperty(result, key as string, desc)\n }\n }\n return result\n}\n\n/**\n * Brand symbol for compiler-emitted reactive prop wrappers.\n * Distinguishes `() => expr` wrappers from user-written accessor props\n * (like Show's `when={() => condition()}`).\n */\nexport const REACTIVE_PROP = Symbol.for('pyreon.reactiveProp')\n\n/** Symbol to access the underlying props signal for updates. */\nexport const PROPS_SIGNAL = Symbol.for('pyreon.propsSignal')\n\n/**\n * Create a branded reactive prop wrapper.\n * Called by the compiler for component prop expressions containing signal reads.\n */\nexport function _rp<T>(fn: () => T): () => T {\n ;(fn as any)[REACTIVE_PROP] = true\n return fn\n}\n\n/**\n * Convert compiler-emitted `_rp(() => expr)` prop values into getter properties.\n *\n * Only converts functions branded with REACTIVE_PROP — user-written accessor\n * props (like Show's when, For's each) are left as-is.\n *\n * Returns the same object if no reactive props found (fast path).\n */\nexport function makeReactiveProps(\n raw: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n let hasGetters = false\n\n for (const key of Object.keys(raw)) {\n const val = raw[key]\n\n if (typeof val === 'function' && (val as any)[REACTIVE_PROP]) {\n Object.defineProperty(result, key, {\n get: val as () => unknown,\n enumerable: true,\n configurable: true,\n })\n hasGetters = true\n } else {\n result[key] = val\n }\n }\n\n return hasGetters ? result : raw\n}\n\n// ─── Unique ID ───────────────────────────────────────────────────────────────\n\nlet _idCounter = 0\n\n/**\n * Generate a unique ID string for accessibility attributes (htmlFor, aria-describedby, etc.).\n * SSR-safe: uses a deterministic counter that resets per request context.\n *\n * @example\n * const id = createUniqueId()\n * return <>\n * <label for={id}>Name</label>\n * <input id={id} />\n * </>\n */\nexport function createUniqueId(): string {\n return `pyreon-${++_idCounter}`\n}\n\n/** Reset the ID counter (called by SSR per-request). */\nexport function _resetIdCounter(): void {\n _idCounter = 0\n}\n","/**\n * createRef — mutable container for a DOM element or component value.\n *\n * Usage:\n * const inputRef = createRef<HTMLInputElement>()\n * onMount(() => { inputRef.current?.focus() })\n * return <input ref={inputRef} />\n *\n * The runtime sets `ref.current` after the element is inserted into the DOM\n * and clears it to `null` when the element is removed.\n */\n\nexport interface Ref<T = unknown> {\n current: T | null\n}\n\n/** Callback ref — receives the element on mount and null on unmount. */\nexport type RefCallback<T = unknown> = (el: T | null) => void\n\n/**\n * Union of object ref and callback ref — accepted by the JSX ref prop.\n * Callback refs are called with the element on mount and with `null` on\n * unmount (matches React/Solid/Vue). Callback refs MUST accept `T | null`\n * — the previous `(el: T) => void` mount-only arm was removed in the\n * post-#233 cleanup because the runtime always invokes with null on\n * unmount and the narrower type silently lied to consumers.\n */\nexport type RefProp<T = unknown> = Ref<T> | RefCallback<T>\n\nexport function createRef<T = unknown>(): Ref<T> {\n return { current: null }\n}\n","import type { Props, VNode, VNodeChild, VNodeChildAtom } from './types'\n\n// ─── Show ─────────────────────────────────────────────────────────────────────\n\nexport interface ShowProps extends Props {\n /** Accessor — children render when truthy, fallback when falsy. */\n when: () => unknown\n fallback?: VNodeChild\n children?: VNodeChild\n}\n\n/**\n * Conditionally render children based on a reactive condition.\n *\n * @example\n * h(Show, { when: () => isLoggedIn() },\n * h(Dashboard, null)\n * )\n *\n * // With fallback:\n * h(Show, { when: () => user(), fallback: h(Login, null) },\n * h(Dashboard, null)\n * )\n */\nexport function Show(props: ShowProps): VNode | null {\n // Returns a reactive accessor; the renderer unwraps it at mount time.\n return ((): VNodeChildAtom =>\n (props.when()\n ? (props.children ?? null)\n : (props.fallback ?? null)) as VNodeChildAtom) as unknown as VNode\n}\n\n// ─── Switch / Match ───────────────────────────────────────────────────────────\n\nexport interface MatchProps extends Props {\n /** Accessor — this branch renders when truthy. */\n when: () => unknown\n children?: VNodeChild\n}\n\n/**\n * A branch inside `<Switch>`. Renders when `when()` is truthy.\n * Must be used as a direct child of `Switch`.\n *\n * `Match` acts as a pure type/identity marker — Switch identifies it by checking\n * `vnode.type === Match` rather than by the runtime return value.\n */\nexport function Match(_props: MatchProps): VNode | null {\n // Match is never mounted directly — Switch inspects Match VNodes by type identity.\n return null\n}\n\nexport interface SwitchProps extends Props {\n /** Rendered when no Match branch is truthy. */\n fallback?: VNodeChild\n children?: VNodeChild | VNodeChild[]\n}\n\n/**\n * Multi-branch conditional rendering. Evaluates each `Match` child in order,\n * renders the first whose `when()` is truthy, or `fallback` if none match.\n *\n * @example\n * h(Switch, { fallback: h(\"p\", null, \"404\") },\n * h(Match, { when: () => route() === \"/\" }, h(Home, null)),\n * h(Match, { when: () => route() === \"/about\" }, h(About, null)),\n * )\n */\nfunction isMatchVNode(branch: VNodeChild): branch is VNode {\n return (\n branch !== null &&\n typeof branch === 'object' &&\n !Array.isArray(branch) &&\n (branch as VNode).type === Match\n )\n}\n\nfunction resolveMatchChildren(matchVNode: VNode): VNodeChildAtom {\n if (matchVNode.children.length === 0) {\n return ((matchVNode.props as unknown as MatchProps).children ?? null) as VNodeChildAtom\n }\n if (matchVNode.children.length === 1) return matchVNode.children[0] as VNodeChildAtom\n return matchVNode.children as unknown as VNodeChildAtom\n}\n\nfunction normalizeBranches(children: SwitchProps['children']): VNodeChild[] {\n if (Array.isArray(children)) return children\n if (children != null) return [children]\n return []\n}\n\nexport function Switch(props: SwitchProps): VNode | null {\n // Returns a reactive accessor; the renderer unwraps it at mount time.\n return ((): VNodeChildAtom => {\n const branches = normalizeBranches(props.children)\n\n for (const branch of branches) {\n if (!isMatchVNode(branch)) continue\n const matchProps = branch.props as unknown as MatchProps\n if (matchProps.when()) return resolveMatchChildren(branch)\n }\n\n return (props.fallback ?? null) as VNodeChildAtom\n }) as unknown as VNode\n}\n\n// Keep MatchSymbol export for any code that was using it\nexport const MatchSymbol: unique symbol = Symbol('pyreon.Match')\n","// Shared style utilities used by both runtime-dom and runtime-server.\n\n// CSS properties where numeric values are unitless (e.g. `opacity: 0.5`, `zIndex: 10`).\n// All other numeric values get \"px\" appended automatically (e.g. `height: 100` → `\"100px\"`).\nexport const CSS_UNITLESS = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n])\n\n// ─── Class utilities ─────────────────────────────────────────────────────────\n\n/** Value accepted by the `class` prop — string, array, object, or nested mix. */\nexport type ClassValue =\n | string\n | number\n | boolean\n | null\n | undefined\n | ClassValue[]\n | Record<string, boolean | null | undefined | (() => boolean)>\n\nfunction cxObject(obj: Record<string, boolean | null | undefined | (() => boolean)>): string {\n let result = ''\n for (const key in obj) {\n const v = obj[key]\n const truthy = typeof v === 'function' ? v() : v\n if (truthy) result = result ? `${result} ${key}` : key\n }\n return result\n}\n\nfunction cxArray(arr: ClassValue[]): string {\n let result = ''\n for (const item of arr) {\n const resolved = cx(item)\n if (resolved) result = result ? `${result} ${resolved}` : resolved\n }\n return result\n}\n\n/** Resolve a ClassValue into a flat class string (like clsx/cx). */\nexport function cx(value: ClassValue): string {\n if (value == null || value === false || value === true) return ''\n if (typeof value === 'string') return value\n if (typeof value === 'number') return String(value)\n if (Array.isArray(value)) return cxArray(value)\n return cxObject(value)\n}\n\n// ─── Style utilities ─────────────────────────────────────────────────────────\n\n/** Convert a camelCase CSS property name to kebab-case. */\nexport function toKebabCase(str: string): string {\n return str.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n}\n\n/** Normalize a style value — appends \"px\" to numbers for non-unitless properties. */\nexport function normalizeStyleValue(key: string, value: unknown): string {\n return typeof value === 'number' && !CSS_UNITLESS.has(key) ? `${value}px` : String(value)\n}\n","import { Fragment, h } from './h'\nimport type { Props, VNode, VNodeChild } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n/** Internal marker attached to lazy()-wrapped components */\nexport type LazyComponent<P extends Props = Props> = ((props: P) => VNodeChild) & {\n __loading: () => boolean\n}\n\n/**\n * Suspense — shows `fallback` while a lazy child component is still loading.\n *\n * Works in tandem with `lazy()` from `@pyreon/react-compat` (or `@pyreon/core/lazy`).\n * The child VNode's `.type.__loading()` signal drives the switch.\n *\n * Usage:\n * const Page = lazy(() => import(\"./Page\"))\n *\n * h(Suspense, { fallback: h(Spinner, null) }, h(Page, null))\n * // or with JSX:\n * <Suspense fallback={<Spinner />}><Page /></Suspense>\n */\nexport function Suspense(props: { fallback: VNodeChild; children?: VNodeChild }): VNode {\n if (__DEV__ && props.fallback === undefined) {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Pyreon] <Suspense> is missing a `fallback` prop. Provide fallback UI to show while loading.',\n )\n }\n\n return h(Fragment, null, () => {\n const ch = props.children\n const childNode = typeof ch === 'function' ? ch() : ch\n\n // Check if the child is a VNode whose type is a lazy component still loading\n const isLoading =\n childNode != null &&\n typeof childNode === 'object' &&\n !Array.isArray(childNode) &&\n typeof (childNode as VNode).type === 'function' &&\n ((childNode as VNode).type as unknown as LazyComponent).__loading?.()\n\n if (isLoading) {\n const fb = props.fallback\n return typeof fb === 'function' ? fb() : fb\n }\n return childNode\n })\n}\n"],"mappings":";;;AAKA,MAAMA,YAAU,OAAO,KAAK,KAAK,QAAQ;AAIzC,IAAI,WAAkC;AAEtC,SAAgB,gBAAgB,OAA8B;AAC5D,YAAW;;;;;;;;;;;;;AAkBb,SAAS,kBAA0B;CAEjC,MAAM,yBADM,IAAI,OAAO,EACL;AAClB,KAAI,CAAC,MAAO,QAAO;CACnB,MAAM,QAAQ,MAAM,MAAM,KAAK;CAG/B,MAAM,eAAe;EACnB;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACD;AACD,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,CAAC,KAAK,SAAS,MAAM,CAAE;AAC3B,MAAI,aAAa,MAAM,MAAM,EAAE,KAAK,KAAK,CAAC,CAAE;AAE5C,SAAO,KAAK,MAAM;;AAEpB,QAAO;;AAGT,SAAS,iBAAiB,UAAwB;AAChD,KAAIA,aAAW,CAAC,UAAU;EACxB,MAAM,WAAW,iBAAiB;EAClC,MAAM,WAAW,WAAW,oBAAoB,aAAa;AAE7D,UAAQ,KACN,YAAY,SAAS,wHAEnB,YACC,aAAa,cACV,kLACA,IACP;;;;;;;AAQL,SAAgB,QAAQ,IAAwC;AAC9D,kBAAiB,UAAU;AAC3B,WAAU,MAAM,KAAK,GAAG;;;;;AAM1B,SAAgB,UAAU,IAAgB;AACxC,kBAAiB,YAAY;AAC7B,WAAU,QAAQ,KAAK,GAAG;;;;;AAM5B,SAAgB,SAAS,IAAgB;AACvC,kBAAiB,WAAW;AAC5B,WAAU,OAAO,KAAK,GAAG;;;;;;;;;;;;;;;AAgB3B,SAAgB,gBAAgB,IAA2C;AACzE,kBAAiB,kBAAkB;AACnC,WAA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AAG,aAAa;;AAE5D,QAAO;;;AAIT,SAAgB,GAAG,OAA2B;AAC5C,KAAI,SAAS,QAAQ,UAAU,SAAS,UAAU,KAAM,QAAO;AAC/D,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,OAAO,UAAU,SAAU,QAAO,OAAO,MAAM;AACnD,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,QAAQ,MAAM;AAC/C,QAAO,SAAS,MAAM;;;AAMxB,SAAgB,YAAY,KAAqB;AAC/C,QAAO,IAAI,QAAQ,WAAW,MAAM,IAAI,EAAE,aAAa,GAAG;;;AAI5D,SAAgB,oBAAoB,KAAa,OAAwB;AACvE,QAAO,OAAO,UAAU,YAAY,CAAC,aAAa,IAAI,IAAI,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM;;;;;AC9F3F,MAAM,UAAU,OAAO,KAAK,KAAK,QAAQ;;;;;;;;;;;;;;AAoBzC,SAAgB,SAAS,OAA+D;AACtF,KAAI,WAAW,MAAM,aAAa,OAEhC,SAAQ,KACN,+FACD;AAGH,QAAO,EAAE,UAAU,YAAY;EAC7B,MAAM,KAAK,MAAM;EACjB,MAAM,YAAY,OAAO,OAAO,aAAa,IAAI,GAAG;AAUpD,MANE,aAAa,QACb,OAAO,cAAc,YACrB,CAAC,MAAM,QAAQ,UAAU,IACzB,OAAQ,UAAoB,SAAS,cACnC,UAAoB,KAAkC,aAAa,EAExD;GACb,MAAM,KAAK,MAAM;AACjB,UAAO,OAAO,OAAO,aAAa,IAAI,GAAG;;AAE3C,SAAO;GACP"}
1
+ {"version":3,"file":"index.js","names":["__DEV__","__DEV__","__DEV__"],"sources":["../src/lifecycle.ts","../src/component.ts","../src/context.ts","../src/h.ts","../src/dynamic.ts","../src/telemetry.ts","../src/error-boundary.ts","../src/for.ts","../src/lazy.ts","../src/map-array.ts","../src/portal.ts","../src/props.ts","../src/ref.ts","../src/show.ts","../src/style.ts","../src/suspense.ts"],"sourcesContent":["import type { CleanupFn, LifecycleHooks } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n// The currently-executing component's hook storage, set by the renderer\n// before calling the component function, cleared immediately after.\nlet _current: LifecycleHooks | null = null\n\nexport function setCurrentHooks(hooks: LifecycleHooks | null) {\n _current = hooks\n}\n\nexport function getCurrentHooks(): LifecycleHooks | null {\n return _current\n}\n\n/**\n * Extract the first stack frame that's NOT inside the framework itself.\n * Walks the stack from top, skipping:\n * - V8/JSC internals (`at <anonymous>`, no filename)\n * - Framework files (packages/core/core/src/lifecycle.ts, etc.)\n * - The warning infra itself (warnOutsideSetup, the hook wrapper)\n *\n * Returns a string like \"at MyComponent (src/components/Foo.tsx:42:15)\"\n * — the call site a user needs to fix. Returns an empty string if no\n * user-code frame is found (unlikely in practice).\n */\nfunction captureCallSite(): string {\n const err = new Error()\n const stack = err.stack\n if (!stack) return ''\n const lines = stack.split('\\n')\n // Framework paths to skip — conservative, matches the packages that\n // contain lifecycle / provide / context internals and call these hooks.\n const skipPatterns = [\n /lifecycle\\.ts/,\n /\\/context\\.ts/,\n /\\/component\\.ts/,\n /\\/core\\/src\\//,\n /\\/runtime-dom\\/src\\//,\n /\\/runtime-server\\/src\\//,\n // node:internal frames\n /node:internal/,\n // chrome devtools source mappings\n /webpack-internal/,\n /<anonymous>/,\n ]\n for (const line of lines) {\n if (!line.includes('at ')) continue\n if (skipPatterns.some((p) => p.test(line))) continue\n // Strip leading \" at \" and return the rest\n return line.trim()\n }\n return ''\n}\n\nfunction warnOutsideSetup(hookName: string): void {\n if (__DEV__ && !_current) {\n const callSite = captureCallSite()\n const location = callSite ? `\\n Called from: ${callSite}` : ''\n // oxlint-disable-next-line no-console\n console.warn(\n `[Pyreon] ${hookName}() called outside component setup. ` +\n \"Lifecycle hooks must be called synchronously during a component's setup function.\" +\n location +\n (hookName === 'onUnmount'\n ? '\\n Hint: `provide()` internally calls onUnmount(). If you use provide(), ensure it runs during synchronous component setup — not inside effects, callbacks, or after awaits.'\n : ''),\n )\n }\n}\n\n/**\n * Register a callback to run after the component is mounted to the DOM.\n * Optionally return a cleanup function — it will run on unmount.\n */\nexport function onMount(fn: () => CleanupFn | void | undefined) {\n warnOutsideSetup('onMount')\n _current?.mount.push(fn)\n}\n\n/**\n * Register a callback to run when the component is removed from the DOM.\n */\nexport function onUnmount(fn: () => void) {\n warnOutsideSetup('onUnmount')\n _current?.unmount.push(fn)\n}\n\n/**\n * Register a callback to run after each reactive update.\n */\nexport function onUpdate(fn: () => void) {\n warnOutsideSetup('onUpdate')\n _current?.update.push(fn)\n}\n\n/**\n * Register an error handler for this component subtree.\n *\n * When an error is thrown during rendering or in a child component,\n * the nearest `onErrorCaptured` handler is called with the error.\n * Return `true` to mark the error as handled and stop propagation.\n *\n * @example\n * onErrorCaptured((err) => {\n * setError(String(err))\n * return true // handled — don't propagate\n * })\n */\nexport function onErrorCaptured(fn: (err: unknown) => boolean | undefined) {\n warnOutsideSetup('onErrorCaptured')\n _current?.error.push(fn)\n}\n","import { setCurrentHooks } from './lifecycle'\nimport type { ComponentFn, LifecycleHooks, Props, VNodeChild } from './types'\n\n/**\n * Identity wrapper — marks a function as a Pyreon component and preserves its type.\n * Useful for IDE tooling and future compiler optimisations.\n */\nexport function defineComponent<P extends Props>(fn: ComponentFn<P>): ComponentFn<P> {\n return fn\n}\n\n/**\n * Run a component function in a tracked context so that lifecycle hooks\n * registered inside it (onMount, onUnmount, onErrorCaptured, etc.) are captured.\n *\n * Called by the renderer — not intended for user code.\n */\nexport function runWithHooks<P extends Props>(\n fn: ComponentFn<P>,\n props: P,\n): { vnode: VNodeChild; hooks: LifecycleHooks } {\n const hooks: LifecycleHooks = { mount: [], unmount: [], update: [], error: [] }\n setCurrentHooks(hooks)\n let vnode: VNodeChild = null\n try {\n vnode = fn(props)\n } finally {\n setCurrentHooks(null)\n }\n return { vnode, hooks }\n}\n\n/**\n * Walk up error handlers collected during component rendering.\n * Returns true if any handler marked the error as handled.\n */\nexport function propagateError(err: unknown, hooks: LifecycleHooks): boolean {\n for (const handler of hooks.error) {\n if (handler(err) === true) return true\n }\n return false\n}\n\n// ─── Error boundary stack ────────────────────────────────────────────────────\n// Module-level stack of active ErrorBoundary handlers (innermost last).\n// ErrorBoundary pushes during its own setup (before children mount) so that\n// any child mountComponent error can dispatch up to the nearest boundary.\n\nconst _errorBoundaryStack: ((err: unknown) => boolean)[] = []\n\nexport function pushErrorBoundary(handler: (err: unknown) => boolean): void {\n _errorBoundaryStack.push(handler)\n}\n\nexport function popErrorBoundary(): void {\n _errorBoundaryStack.pop()\n}\n\n/**\n * Dispatch an error to the nearest active ErrorBoundary.\n * Returns true if the boundary handled it, false if none was registered.\n */\nexport function dispatchToErrorBoundary(err: unknown): boolean {\n const handler = _errorBoundaryStack[_errorBoundaryStack.length - 1]\n return handler ? handler(err) : false\n}\n","/**\n * Provide / inject — like React context or Vue provide/inject.\n *\n * Values flow down the component tree without prop-drilling.\n * The renderer maintains the context stack as it walks the VNode tree.\n */\n\nimport { onUnmount } from './lifecycle'\n\nexport interface Context<T> {\n readonly id: symbol\n readonly defaultValue: T\n}\n\n/** Branded marker for reactive contexts — distinguishes from regular Context at type level. */\ndeclare const REACTIVE_BRAND: unique symbol\n\n/**\n * A context whose value is a reactive accessor `() => T`.\n *\n * When you `useContext(reactiveCtx)`, TypeScript returns `() => T` —\n * you MUST call the accessor to read the value. This prevents the\n * destructuring trap that breaks reactivity with getter-based objects.\n *\n * @example\n * const ModeCtx = createReactiveContext<'light' | 'dark'>('light')\n * // Provider: provide(ModeCtx, () => modeSignal())\n * // Consumer: const getMode = useContext(ModeCtx); getMode() // 'light'\n */\nexport interface ReactiveContext<T> extends Context<() => T> {\n readonly [REACTIVE_BRAND]: T\n}\n\nexport function createContext<T>(defaultValue: T): Context<T> {\n return { id: Symbol('PyreonContext'), defaultValue }\n}\n\n/**\n * Create a reactive context. Consumers get `() => T` and must call it.\n * This is the safe pattern for values that change over time (mode, locale, etc.).\n */\nexport function createReactiveContext<T>(defaultValue: T): ReactiveContext<T> {\n return createContext<() => T>(() => defaultValue) as ReactiveContext<T>\n}\n\n// ─── Runtime context stack (managed by the renderer) ─────────────────────────\n\n// Default stack — used for CSR and single-threaded SSR.\n// On Node.js with concurrent requests, @pyreon/runtime-server replaces this with\n// an AsyncLocalStorage-backed provider via setContextStackProvider().\nconst _defaultStack: Map<symbol, unknown>[] = []\nlet _stackProvider: () => Map<symbol, unknown>[] = () => _defaultStack\n\n/**\n * Override the context stack provider. Called by @pyreon/runtime-server to\n * inject an AsyncLocalStorage-backed stack that isolates concurrent SSR requests.\n * Has no effect in the browser (CSR always uses the default module-level stack).\n */\nexport function setContextStackProvider(fn: () => Map<symbol, unknown>[]): void {\n _stackProvider = fn\n}\n\nfunction getStack(): Map<symbol, unknown>[] {\n return _stackProvider()\n}\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\nexport function pushContext(values: Map<symbol, unknown>) {\n getStack().push(values)\n}\n\nexport function popContext() {\n const stack = getStack()\n if (stack.length === 0) return\n stack.pop()\n}\n\n/**\n * Read the nearest provided value for a context.\n * Falls back to `context.defaultValue` if none found.\n *\n * For ReactiveContext<T>, returns `() => T` — you MUST call the accessor.\n * For regular Context<T>, returns `T` directly.\n */\nexport function useContext<T>(context: ReactiveContext<T>): () => T\nexport function useContext<T>(context: Context<T>): T\nexport function useContext<T>(context: Context<T>): T {\n const stack = getStack()\n for (let i = stack.length - 1; i >= 0; i--) {\n const frame = stack[i]\n if (frame?.has(context.id)) {\n return frame.get(context.id) as T\n }\n }\n return context.defaultValue\n}\n\n/**\n * Provide a context value for the current component's subtree.\n * Must be called during component setup (like onMount/onUnmount).\n * Automatically cleaned up when the component unmounts.\n *\n * @example\n * const ThemeProvider = ({ children }: { children: VNodeChild }) => {\n * provide(ThemeContext, { color: \"blue\" })\n * return children\n * }\n */\nexport function provide<T>(context: Context<T>, value: T): void {\n pushContext(new Map<symbol, unknown>([[context.id, value]]))\n onUnmount(() => popContext())\n}\n\n/**\n * Provide a value for `context` during `fn()`.\n * Used by the renderer when it encounters a `<Provider>` component.\n */\nexport function withContext<T>(context: Context<T>, value: T, fn: () => void) {\n const frame = new Map<symbol, unknown>([[context.id, value]])\n pushContext(frame)\n try {\n fn()\n } finally {\n popContext()\n }\n}\n\n// ─── Context snapshot for deferred mounting ─────────────────────────────────\n\nexport type ContextSnapshot = Map<symbol, unknown>[]\n\n/**\n * Capture a snapshot of the current context stack.\n *\n * Used by `mountReactive` to preserve the context that was active when a\n * reactive boundary (e.g. `<Show>`, `<For>`) was set up. When the boundary\n * later mounts new children inside an effect, the snapshot is restored so\n * those children can see ancestor providers via `useContext()`.\n */\nexport function captureContextStack(): ContextSnapshot {\n // Shallow copy — each frame (Map) is shared by reference, which is\n // correct because providers don't mutate frames after creation.\n return [...getStack()]\n}\n\n/**\n * Execute `fn()` with a previously captured context stack active.\n * Restores the original stack after `fn()` completes (even on throw).\n */\nexport function restoreContextStack<T>(snapshot: ContextSnapshot, fn: () => T): T {\n const stack = getStack()\n const savedLength = stack.length\n\n // Push all captured frames onto the current stack\n for (const frame of snapshot) {\n stack.push(frame)\n }\n\n try {\n return fn()\n } finally {\n // Remove only the frames we pushed (preserve anything added by fn)\n stack.length = savedLength\n }\n}\n","import type { ComponentFn, Props, VNode, VNodeChild } from './types'\n\n/** Marker for fragment nodes — renders children without a wrapper element */\nexport const Fragment: unique symbol = Symbol('Pyreon.Fragment')\n\n/**\n * Hyperscript function — the compiled output of JSX.\n * `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n *\n * Generic on P so TypeScript validates props match the component's signature\n * at the call site, then stores the result in the loosely-typed VNode.\n */\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nexport const EMPTY_PROPS: Props = {} as Props\n\n/** Makes `children` optional in P (if present) so it can be passed as rest args to h(). */\ntype PropsWithOptionalChildren<P extends Props> = Omit<P, 'children'> &\n ('children' extends keyof P ? { children?: P['children'] } : unknown)\n\n// Overload: component with typed props — children is optional in the props object\n// because it can be passed as rest args. Extra keys are allowed via `& Props`.\nexport function h<P extends Props>(\n type: ComponentFn<P>,\n props: (PropsWithOptionalChildren<P> & Props) | null,\n ...children: VNodeChild[]\n): VNode\n// Overload: intrinsic element, symbol, generic/dynamic component, or mixed union\nexport function h(\n type: string | ((p: any) => VNodeChild) | symbol,\n props: Props | null,\n ...children: VNodeChild[]\n): VNode\nexport function h<P extends Props>(\n type: string | ComponentFn<P> | symbol,\n props: P | null,\n ...children: VNodeChild[]\n): VNode {\n return {\n type: type as string | ComponentFn | symbol,\n props: (props ?? EMPTY_PROPS) as Props,\n children: normalizeChildren(children),\n key: (props?.key as string | number | null) ?? null,\n }\n}\n\nfunction normalizeChildren(children: VNodeChild[]): VNodeChild[] {\n // Fast path: no nested arrays — return as-is without allocating\n for (let i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return flattenChildren(children)\n }\n }\n return children\n}\n\nfunction flattenChildren(children: VNodeChild[]): VNodeChild[] {\n const result: VNodeChild[] = []\n for (const child of children) {\n if (Array.isArray(child)) {\n result.push(...flattenChildren(child as VNodeChild[]))\n } else {\n result.push(child)\n }\n }\n return result\n}\n","import { h } from './h'\nimport type { ComponentFn, Props, VNode } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\nexport interface DynamicProps extends Props {\n component: ComponentFn | string\n}\n\nexport function Dynamic(props: DynamicProps): VNode | null {\n const { component, ...rest } = props\n if (__DEV__ && !component) {\n // oxlint-disable-next-line no-console\n console.warn('[Pyreon] <Dynamic> received a falsy `component` prop. Nothing will be rendered.')\n }\n if (!component) return null\n return h(component as string | ComponentFn, rest as Props)\n}\n","/**\n * Error telemetry — hook into Pyreon's error reporting for Sentry, Datadog, etc.\n *\n * @example\n * import { registerErrorHandler } from \"@pyreon/core\"\n * import * as Sentry from \"@sentry/browser\"\n *\n * registerErrorHandler(ctx => {\n * Sentry.captureException(ctx.error, {\n * extra: { component: ctx.component, phase: ctx.phase },\n * })\n * })\n */\n\nexport interface ErrorContext {\n /** Component function name, or \"Anonymous\" */\n component: string\n /** Lifecycle phase where the error occurred */\n phase: 'setup' | 'render' | 'mount' | 'unmount' | 'effect'\n /** The thrown value */\n error: unknown\n /** Unix timestamp (ms) */\n timestamp: number\n /** Component props at the time of the error */\n props?: Record<string, unknown>\n}\n\nexport type ErrorHandler = (ctx: ErrorContext) => void\n\nlet _handlers: ErrorHandler[] = []\n\n/**\n * Register a global error handler. Called whenever a component throws in any\n * lifecycle phase. Returns an unregister function.\n */\nexport function registerErrorHandler(handler: ErrorHandler): () => void {\n _handlers.push(handler)\n return () => {\n _handlers = _handlers.filter((h) => h !== handler)\n }\n}\n\n/**\n * Internal — called by the runtime whenever a component error is caught.\n * Existing console.error calls are preserved; this is additive.\n */\nexport function reportError(ctx: ErrorContext): void {\n for (const h of _handlers) {\n try {\n h(ctx)\n } catch {\n // handler errors must never propagate back into the framework\n }\n }\n}\n","import { signal } from '@pyreon/reactivity'\nimport { popErrorBoundary, pushErrorBoundary } from './component'\nimport { onUnmount } from './lifecycle'\nimport { reportError } from './telemetry'\nimport type { VNodeChild, VNodeChildAtom } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n/**\n * ErrorBoundary — catches errors thrown by child components and renders a\n * fallback UI instead of crashing the whole tree.\n *\n * Also reports caught errors to any registered telemetry handlers.\n *\n * How error propagation works:\n * ErrorBoundary pushes a handler onto the module-level boundary stack\n * synchronously during its own setup (before children are mounted).\n * When mountComponent catches a child error, it calls dispatchToErrorBoundary()\n * which invokes the innermost boundary's handler.\n *\n * Usage:\n * h(ErrorBoundary, {\n * fallback: (err) => h(\"p\", null, `Error: ${err}`),\n * children: h(MyComponent, null),\n * })\n *\n * // or with JSX:\n * <ErrorBoundary fallback={(err) => <p>Error: {String(err)}</p>}>\n * <MyComponent />\n * </ErrorBoundary>\n */\nexport function ErrorBoundary(props: {\n /**\n * Rendered when a child throws. Receives the caught error and a `reset`\n * function — calling `reset()` clears the error and re-renders children.\n */\n fallback: (err: unknown, reset: () => void) => VNodeChild\n children?: VNodeChild\n}): VNodeChild {\n if (__DEV__ && typeof props.fallback !== 'function') {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Pyreon] <ErrorBoundary> expects `fallback` to be a function: (err, reset) => VNode. ' +\n `Received ${typeof props.fallback}.`,\n )\n }\n\n const error = signal<unknown>(null)\n const reset = () => error.set(null)\n\n const handler = (err: unknown): boolean => {\n if (error.peek() !== null) return false // already in error state — let outer boundary catch it\n error.set(err)\n reportError({ component: 'ErrorBoundary', phase: 'render', error: err, timestamp: Date.now() })\n return true\n }\n\n // Push synchronously — before children are mounted — so child errors see this boundary\n pushErrorBoundary(handler)\n onUnmount(() => popErrorBoundary())\n\n return (): VNodeChildAtom => {\n const err = error()\n if (err != null) return props.fallback(err, reset) as VNodeChildAtom\n const ch = props.children\n return (typeof ch === 'function' ? ch() : ch) as VNodeChildAtom\n }\n}\n","import type { NativeItem, Props, VNode } from './types'\n\n/**\n * Symbol used as the VNode type for a For list — runtime-dom handles it\n * via mountFor, bypassing the generic VNode reconciler.\n */\nexport const ForSymbol: unique symbol = Symbol('pyreon.For')\n\nexport interface ForProps<T> {\n each: () => T[]\n /** Keying function — use `by` not `key` (JSX extracts `key` for VNode reconciliation). */\n by: (item: T) => string | number\n children: (item: T) => VNode | NativeItem\n /**\n * @deprecated Use `by` instead of `key`. In Pyreon, `<For>` uses `by` for keying.\n * JSX reserves `key` for VNode reconciliation — it won't reach the component.\n */\n key?: never\n}\n\n/**\n * Efficient reactive list rendering.\n *\n * Unlike a plain `() => items().map(item => h(...))`, For never re-creates\n * VNodes for existing keys — only new keys invoke `children()`. Structural\n * mutations (swap, sort, filter) are O(n) key scan + O(k) DOM moves where k\n * is the number of actually displaced entries.\n *\n * Usage:\n * <For each={items} by={r => r.id}>{r => <li>...</li>}</For>\n */\nexport function For<T>(props: ForProps<T>): VNode {\n return {\n type: ForSymbol as unknown as string,\n props: props as unknown as Props,\n children: [],\n key: null,\n }\n}\n","import { signal } from '@pyreon/reactivity'\nimport { h } from './h'\nimport type { LazyComponent } from './suspense'\nimport type { ComponentFn, Props } from './types'\n\nexport function lazy<P extends Props>(\n load: () => Promise<{ default: ComponentFn<P> }>,\n): LazyComponent<P> {\n const loaded = signal<ComponentFn<P> | null>(null)\n const error = signal<Error | null>(null)\n\n load()\n .then((m) => loaded.set(m.default))\n .catch((e) => error.set(e instanceof Error ? e : new Error(String(e))))\n\n const wrapper = ((props: P) => {\n const err = error()\n if (err) throw err\n const comp = loaded()\n return comp ? h(comp as ComponentFn, props as Props) : null\n }) as LazyComponent<P>\n\n wrapper.__loading = () => loaded() === null && error() === null\n return wrapper\n}\n","/**\n * mapArray — keyed reactive list mapping.\n *\n * Creates each mapped item exactly once per key, then reuses it across\n * updates. When the source array is reordered or partially changed, only\n * new keys invoke `map()`; existing entries return the cached result.\n *\n * This makes structural list operations (swap, sort, filter) O(k) in\n * allocations where k is the number of new/removed keys, not O(n).\n *\n * The returned accessor reads `source()` reactively, so it can be passed\n * directly to the keyed-list reconciler.\n */\nexport function mapArray<T, U>(\n source: () => T[],\n getKey: (item: T) => string | number,\n map: (item: T) => U,\n): () => U[] {\n const cache = new Map<string | number, U>()\n\n return () => {\n const items = source()\n const result: U[] = []\n const newKeys = new Set<string | number>()\n\n for (const item of items) {\n const key = getKey(item)\n newKeys.add(key)\n if (!cache.has(key)) {\n cache.set(key, map(item))\n }\n result.push(cache.get(key) as U)\n }\n\n // Evict entries whose keys are no longer present\n for (const key of cache.keys()) {\n if (!newKeys.has(key)) cache.delete(key)\n }\n\n return result\n }\n}\n","import type { Props, VNode, VNodeChild } from './types'\n\n/**\n * Symbol used as the VNode type for a Portal — runtime-dom mounts the\n * children into `target` instead of the normal parent.\n */\nexport const PortalSymbol: unique symbol = Symbol('pyreon.Portal')\n\nexport interface PortalProps {\n /** DOM element to render children into (e.g. document.body). */\n target: Element\n children: VNodeChild\n}\n\n/**\n * Portal — renders `children` into a different DOM node than the\n * current parent tree.\n *\n * Useful for modals, tooltips, dropdowns, and any overlay that needs to\n * escape CSS overflow/stacking context restrictions.\n *\n * @example\n * // Render a modal at document.body level regardless of where in the\n * // component tree <Modal> is used:\n * Portal({ target: document.body, children: h(Modal, { onClose }) })\n *\n * // JSX:\n * <Portal target={document.body}>\n * <Modal onClose={close} />\n * </Portal>\n */\nexport function Portal(props: PortalProps): VNode {\n return {\n type: PortalSymbol as unknown as string,\n props: props as unknown as Props,\n children: [],\n key: null,\n }\n}\n","// Prop utilities for component authoring.\n\n/**\n * Split props into two groups: keys you want and the rest.\n * Unlike destructuring, this preserves reactivity (getters on the original object).\n *\n * @example\n * const [own, html] = splitProps(props, [\"label\", \"icon\"])\n * return <button {...html}><Icon name={own.icon} /> {own.label}</button>\n */\nexport function splitProps<T extends object, K extends (keyof T)[]>(\n props: T,\n keys: K,\n): [Pick<T, K[number]>, Omit<T, K[number]>] {\n const picked = {} as Pick<T, K[number]>\n const rest = {} as Omit<T, K[number]>\n const keySet = new Set<string | symbol>(keys as (string | symbol)[])\n\n // Reflect.ownKeys includes symbol-keyed properties; Object.keys drops them\n // silently. Without this, symbol-keyed props (e.g. branded reactive props\n // under Symbol.for('pyreon.reactiveProp')) would vanish from both picked\n // and rest.\n for (const key of Reflect.ownKeys(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, key)\n if (!desc) continue\n // Force configurable: true when copying to a fresh object. Source descriptors\n // may be non-configurable (default when created with `Object.defineProperty`\n // and the caller omitted `configurable`). If we preserved that, any later\n // `Object.defineProperty` on the same key — including subsequent splitProps\n // post-processing or test mocks — would throw \"Cannot redefine property\".\n const safe = { ...desc, configurable: true }\n if (keySet.has(key)) {\n Object.defineProperty(picked, key, safe)\n } else {\n Object.defineProperty(rest, key, safe)\n }\n }\n\n return [picked, rest]\n}\n\n/** Merge a getter-backed source property with an existing getter or value. */\nfunction mergeGetterWithExisting(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n existing: PropertyDescriptor,\n): void {\n const prevGet = existing.get ?? (() => existing.value)\n const nextGet = desc.get as () => unknown\n Object.defineProperty(result, key, {\n get: () => {\n const v = nextGet()\n return v !== undefined ? v : prevGet()\n },\n enumerable: true,\n configurable: true,\n })\n}\n\n/** Merge a static source property when the existing property has a getter. */\nfunction mergeStaticWithGetter(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n existingGet: () => unknown,\n): void {\n if (desc.value !== undefined) {\n Object.defineProperty(result, key, { ...desc, configurable: true })\n } else {\n Object.defineProperty(result, key, {\n get: existingGet,\n enumerable: true,\n configurable: true,\n })\n }\n}\n\n/** Apply a single source property onto the result object, handling getter/static combos. */\nfunction mergeProperty(\n result: Record<string, unknown>,\n key: string,\n desc: PropertyDescriptor,\n): void {\n const existing = Object.getOwnPropertyDescriptor(result, key)\n if (desc.get && existing) {\n mergeGetterWithExisting(result, key, desc, existing)\n } else if (desc.get) {\n // Force configurable: true — source getters may have been defined via\n // `Object.defineProperty` without an explicit configurable flag (which\n // defaults to false). Without this, a later source in the same mergeProps\n // call that overrides the same key would crash with TypeError:\n // \"Cannot redefine property\".\n Object.defineProperty(result, key, { ...desc, configurable: true })\n } else if (existing?.get) {\n mergeStaticWithGetter(result, key, desc, existing.get)\n } else if (desc.value !== undefined || !existing) {\n // Both static — later value wins if defined\n Object.defineProperty(result, key, { ...desc, configurable: true })\n }\n}\n\n/**\n * Merge default values with component props. Defaults are used when\n * the prop is `undefined`. Preserves getter reactivity.\n *\n * @example\n * const merged = mergeProps({ size: \"md\", variant: \"primary\" }, props)\n * // merged.size is reactive — falls back to \"md\" when props.size is undefined\n */\nexport function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T {\n const result = {} as T\n for (const source of sources) {\n // See splitProps for why this uses Reflect.ownKeys instead of Object.keys.\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key)\n if (!desc) continue\n mergeProperty(result, key as string, desc)\n }\n }\n return result\n}\n\n/**\n * Brand symbol for compiler-emitted reactive prop wrappers.\n * Distinguishes `() => expr` wrappers from user-written accessor props\n * (like Show's `when={() => condition()}`).\n */\nexport const REACTIVE_PROP = Symbol.for('pyreon.reactiveProp')\n\n/** Symbol to access the underlying props signal for updates. */\nexport const PROPS_SIGNAL = Symbol.for('pyreon.propsSignal')\n\n/**\n * Create a branded reactive prop wrapper.\n * Called by the compiler for component prop expressions containing signal reads.\n */\nexport function _rp<T>(fn: () => T): () => T {\n ;(fn as any)[REACTIVE_PROP] = true\n return fn\n}\n\n/**\n * Convert compiler-emitted `_rp(() => expr)` prop values into getter properties.\n *\n * Only converts functions branded with REACTIVE_PROP — user-written accessor\n * props (like Show's when, For's each) are left as-is.\n *\n * Returns the same object if no reactive props found (fast path).\n */\nexport function makeReactiveProps(\n raw: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n let hasGetters = false\n\n for (const key of Object.keys(raw)) {\n const val = raw[key]\n\n if (typeof val === 'function' && (val as any)[REACTIVE_PROP]) {\n Object.defineProperty(result, key, {\n get: val as () => unknown,\n enumerable: true,\n configurable: true,\n })\n hasGetters = true\n } else {\n result[key] = val\n }\n }\n\n return hasGetters ? result : raw\n}\n\n// ─── Unique ID ───────────────────────────────────────────────────────────────\n\nlet _idCounter = 0\n\n/**\n * Generate a unique ID string for accessibility attributes (htmlFor, aria-describedby, etc.).\n * SSR-safe: uses a deterministic counter that resets per request context.\n *\n * @example\n * const id = createUniqueId()\n * return <>\n * <label for={id}>Name</label>\n * <input id={id} />\n * </>\n */\nexport function createUniqueId(): string {\n return `pyreon-${++_idCounter}`\n}\n\n/** Reset the ID counter (called by SSR per-request). */\nexport function _resetIdCounter(): void {\n _idCounter = 0\n}\n","/**\n * createRef — mutable container for a DOM element or component value.\n *\n * Usage:\n * const inputRef = createRef<HTMLInputElement>()\n * onMount(() => { inputRef.current?.focus() })\n * return <input ref={inputRef} />\n *\n * The runtime sets `ref.current` after the element is inserted into the DOM\n * and clears it to `null` when the element is removed.\n */\n\nexport interface Ref<T = unknown> {\n current: T | null\n}\n\n/** Callback ref — receives the element on mount and null on unmount. */\nexport type RefCallback<T = unknown> = (el: T | null) => void\n\n/**\n * Union of object ref and callback ref — accepted by the JSX ref prop.\n * Callback refs are called with the element on mount and with `null` on\n * unmount (matches React/Solid/Vue). Callback refs MUST accept `T | null`\n * — the previous `(el: T) => void` mount-only arm was removed in the\n * post-#233 cleanup because the runtime always invokes with null on\n * unmount and the narrower type silently lied to consumers.\n */\nexport type RefProp<T = unknown> = Ref<T> | RefCallback<T>\n\nexport function createRef<T = unknown>(): Ref<T> {\n return { current: null }\n}\n","import type { Props, VNode, VNodeChild, VNodeChildAtom } from './types'\n\n// ─── Show ─────────────────────────────────────────────────────────────────────\n\nexport interface ShowProps extends Props {\n /** Accessor — children render when truthy, fallback when falsy. */\n when: () => unknown\n fallback?: VNodeChild\n children?: VNodeChild\n}\n\n/**\n * Conditionally render children based on a reactive condition.\n *\n * @example\n * h(Show, { when: () => isLoggedIn() },\n * h(Dashboard, null)\n * )\n *\n * // With fallback:\n * h(Show, { when: () => user(), fallback: h(Login, null) },\n * h(Dashboard, null)\n * )\n */\nexport function Show(props: ShowProps): VNode | null {\n // Returns a reactive accessor; the renderer unwraps it at mount time.\n return ((): VNodeChildAtom =>\n (props.when()\n ? (props.children ?? null)\n : (props.fallback ?? null)) as VNodeChildAtom) as unknown as VNode\n}\n\n// ─── Switch / Match ───────────────────────────────────────────────────────────\n\nexport interface MatchProps extends Props {\n /** Accessor — this branch renders when truthy. */\n when: () => unknown\n children?: VNodeChild\n}\n\n/**\n * A branch inside `<Switch>`. Renders when `when()` is truthy.\n * Must be used as a direct child of `Switch`.\n *\n * `Match` acts as a pure type/identity marker — Switch identifies it by checking\n * `vnode.type === Match` rather than by the runtime return value.\n */\nexport function Match(_props: MatchProps): VNode | null {\n // Match is never mounted directly — Switch inspects Match VNodes by type identity.\n return null\n}\n\nexport interface SwitchProps extends Props {\n /** Rendered when no Match branch is truthy. */\n fallback?: VNodeChild\n children?: VNodeChild | VNodeChild[]\n}\n\n/**\n * Multi-branch conditional rendering. Evaluates each `Match` child in order,\n * renders the first whose `when()` is truthy, or `fallback` if none match.\n *\n * @example\n * h(Switch, { fallback: h(\"p\", null, \"404\") },\n * h(Match, { when: () => route() === \"/\" }, h(Home, null)),\n * h(Match, { when: () => route() === \"/about\" }, h(About, null)),\n * )\n */\nfunction isMatchVNode(branch: VNodeChild): branch is VNode {\n return (\n branch !== null &&\n typeof branch === 'object' &&\n !Array.isArray(branch) &&\n (branch as VNode).type === Match\n )\n}\n\nfunction resolveMatchChildren(matchVNode: VNode): VNodeChildAtom {\n if (matchVNode.children.length === 0) {\n return ((matchVNode.props as unknown as MatchProps).children ?? null) as VNodeChildAtom\n }\n if (matchVNode.children.length === 1) return matchVNode.children[0] as VNodeChildAtom\n return matchVNode.children as unknown as VNodeChildAtom\n}\n\nfunction normalizeBranches(children: SwitchProps['children']): VNodeChild[] {\n if (Array.isArray(children)) return children\n if (children != null) return [children]\n return []\n}\n\nexport function Switch(props: SwitchProps): VNode | null {\n // Returns a reactive accessor; the renderer unwraps it at mount time.\n return ((): VNodeChildAtom => {\n const branches = normalizeBranches(props.children)\n\n for (const branch of branches) {\n if (!isMatchVNode(branch)) continue\n const matchProps = branch.props as unknown as MatchProps\n if (matchProps.when()) return resolveMatchChildren(branch)\n }\n\n return (props.fallback ?? null) as VNodeChildAtom\n }) as unknown as VNode\n}\n\n// Keep MatchSymbol export for any code that was using it\nexport const MatchSymbol: unique symbol = Symbol('pyreon.Match')\n","// Shared style utilities used by both runtime-dom and runtime-server.\n\n// CSS properties where numeric values are unitless (e.g. `opacity: 0.5`, `zIndex: 10`).\n// All other numeric values get \"px\" appended automatically (e.g. `height: 100` → `\"100px\"`).\nexport const CSS_UNITLESS = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n])\n\n// ─── Class utilities ─────────────────────────────────────────────────────────\n\n/** Value accepted by the `class` prop — string, array, object, or nested mix. */\nexport type ClassValue =\n | string\n | number\n | boolean\n | null\n | undefined\n | ClassValue[]\n | Record<string, boolean | null | undefined | (() => boolean)>\n\nfunction cxObject(obj: Record<string, boolean | null | undefined | (() => boolean)>): string {\n let result = ''\n for (const key in obj) {\n const v = obj[key]\n const truthy = typeof v === 'function' ? v() : v\n if (truthy) result = result ? `${result} ${key}` : key\n }\n return result\n}\n\nfunction cxArray(arr: ClassValue[]): string {\n let result = ''\n for (const item of arr) {\n const resolved = cx(item)\n if (resolved) result = result ? `${result} ${resolved}` : resolved\n }\n return result\n}\n\n/** Resolve a ClassValue into a flat class string (like clsx/cx). */\nexport function cx(value: ClassValue): string {\n if (value == null || value === false || value === true) return ''\n if (typeof value === 'string') return value\n if (typeof value === 'number') return String(value)\n if (Array.isArray(value)) return cxArray(value)\n return cxObject(value)\n}\n\n// ─── Style utilities ─────────────────────────────────────────────────────────\n\n/** Convert a camelCase CSS property name to kebab-case. */\nexport function toKebabCase(str: string): string {\n return str.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n}\n\n/** Normalize a style value — appends \"px\" to numbers for non-unitless properties. */\nexport function normalizeStyleValue(key: string, value: unknown): string {\n return typeof value === 'number' && !CSS_UNITLESS.has(key) ? `${value}px` : String(value)\n}\n","import { Fragment, h } from './h'\nimport type { Props, VNode, VNodeChild } from './types'\n\n// Dev-mode gate: see `pyreon/no-process-dev-gate` lint rule for why this\n// uses `import.meta.env.DEV` instead of `typeof process !== 'undefined'`.\n// @ts-ignore — `import.meta.env.DEV` is provided by Vite/Rolldown at build time\nconst __DEV__ = import.meta.env?.DEV === true\n\n/** Internal marker attached to lazy()-wrapped components */\nexport type LazyComponent<P extends Props = Props> = ((props: P) => VNodeChild) & {\n __loading: () => boolean\n}\n\n/**\n * Suspense — shows `fallback` while a lazy child component is still loading.\n *\n * Works in tandem with `lazy()` from `@pyreon/react-compat` (or `@pyreon/core/lazy`).\n * The child VNode's `.type.__loading()` signal drives the switch.\n *\n * Usage:\n * const Page = lazy(() => import(\"./Page\"))\n *\n * h(Suspense, { fallback: h(Spinner, null) }, h(Page, null))\n * // or with JSX:\n * <Suspense fallback={<Spinner />}><Page /></Suspense>\n */\nexport function Suspense(props: { fallback: VNodeChild; children?: VNodeChild }): VNode {\n if (__DEV__ && props.fallback === undefined) {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Pyreon] <Suspense> is missing a `fallback` prop. Provide fallback UI to show while loading.',\n )\n }\n\n return h(Fragment, null, () => {\n const ch = props.children\n const childNode = typeof ch === 'function' ? ch() : ch\n\n // Check if the child is a VNode whose type is a lazy component still loading\n const isLoading =\n childNode != null &&\n typeof childNode === 'object' &&\n !Array.isArray(childNode) &&\n typeof (childNode as VNode).type === 'function' &&\n ((childNode as VNode).type as unknown as LazyComponent).__loading?.()\n\n if (isLoading) {\n const fb = props.fallback\n return typeof fb === 'function' ? fb() : fb\n }\n return childNode\n })\n}\n"],"mappings":";;;AAKA,MAAMA,YAAU,OAAO,KAAK,KAAK,QAAQ;AAIzC,IAAI,WAAkC;AAEtC,SAAgB,gBAAgB,OAA8B;AAC5D,YAAW;;;;;;;;;;;;;AAkBb,SAAS,kBAA0B;CAEjC,MAAM,yBADM,IAAI,OAAO,EACL;AAClB,KAAI,CAAC,MAAO,QAAO;CACnB,MAAM,QAAQ,MAAM,MAAM,KAAK;CAG/B,MAAM,eAAe;EACnB;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACD;AACD,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,CAAC,KAAK,SAAS,MAAM,CAAE;AAC3B,MAAI,aAAa,MAAM,MAAM,EAAE,KAAK,KAAK,CAAC,CAAE;AAE5C,SAAO,KAAK,MAAM;;AAEpB,QAAO;;AAGT,SAAS,iBAAiB,UAAwB;AAChD,KAAIA,aAAW,CAAC,UAAU;EACxB,MAAM,WAAW,iBAAiB;EAClC,MAAM,WAAW,WAAW,oBAAoB,aAAa;AAE7D,UAAQ,KACN,YAAY,SAAS,wHAEnB,YACC,aAAa,cACV,kLACA,IACP;;;;;;;AAQL,SAAgB,QAAQ,IAAwC;AAC9D,kBAAiB,UAAU;AAC3B,WAAU,MAAM,KAAK,GAAG;;;;;AAM1B,SAAgB,UAAU,IAAgB;AACxC,kBAAiB,YAAY;AAC7B,WAAU,QAAQ,KAAK,GAAG;;;;;AAM5B,SAAgB,SAAS,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KAAK;EACtB,MAAM,WAAW,GAAG,KAAK;AACzB,MAAI,SAAU,UAAS,SAAS,GAAG,OAAO,GAAG,aAAa;;AAE5D,QAAO;;;AAIT,SAAgB,GAAG,OAA2B;AAC5C,KAAI,SAAS,QAAQ,UAAU,SAAS,UAAU,KAAM,QAAO;AAC/D,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,OAAO,UAAU,SAAU,QAAO,OAAO,MAAM;AACnD,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,QAAQ,MAAM;AAC/C,QAAO,SAAS,MAAM;;;AAMxB,SAAgB,YAAY,KAAqB;AAC/C,QAAO,IAAI,QAAQ,WAAW,MAAM,IAAI,EAAE,aAAa,GAAG;;;AAI5D,SAAgB,oBAAoB,KAAa,OAAwB;AACvE,QAAO,OAAO,UAAU,YAAY,CAAC,aAAa,IAAI,IAAI,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM;;;;;AC9F3F,MAAM,UAAU,OAAO,KAAK,KAAK,QAAQ;;;;;;;;;;;;;;AAoBzC,SAAgB,SAAS,OAA+D;AACtF,KAAI,WAAW,MAAM,aAAa,OAEhC,SAAQ,KACN,+FACD;AAGH,QAAO,EAAE,UAAU,YAAY;EAC7B,MAAM,KAAK,MAAM;EACjB,MAAM,YAAY,OAAO,OAAO,aAAa,IAAI,GAAG;AAUpD,MANE,aAAa,QACb,OAAO,cAAc,YACrB,CAAC,MAAM,QAAQ,UAAU,IACzB,OAAQ,UAAoB,SAAS,cACnC,UAAoB,KAAkC,aAAa,EAExD;GACb,MAAM,KAAK,MAAM;AACjB,UAAO,OAAO,OAAO,aAAa,IAAI,GAAG;;AAE3C,SAAO;GACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/component.ts","../../../src/context.ts","../../../src/dynamic.ts","../../../src/error-boundary.ts","../../../src/for.ts","../../../src/h.ts","../../../src/ref.ts","../../../src/style.ts","../../../src/jsx-runtime.ts","../../../src/suspense.ts","../../../src/lazy.ts","../../../src/lifecycle.ts","../../../src/map-array.ts","../../../src/portal.ts","../../../src/props.ts","../../../src/show.ts","../../../src/telemetry.ts"],"mappings":";KAGY,cAAA,GAAiB,KAAA;AAAA,KACjB,UAAA,GAAa,cAAA,GAAiB,cAAA,YAA0B,cAAA,GAAiB,cAAA;AAAA,UAEpE,KAAA;;EAEf,IAAA,WAAe,WAAA;EACf,KAAA,EAAO,KAAA;EACP,QAAA,EAAU,UAAA;EACV,GAAA;AAAA;AAAA,KAKU,KAAA,GAAQ,MAAA;;;;;KAQR,WAAA,WAAsB,KAAA,GAAQ,KAAA,KAAU,KAAA,EAAO,CAAA,KAAM,UAAA;;KAKrD,YAAA,MAAkB,CAAA,SAAU,WAAA,YAAuB,CAAA,GAAI,CAAA;;KAGvD,oBAAA,aAAiC,KAAA,YAAiB,KAAA,6BAC5D,SAAA,EAAW,WAAA,CAAY,GAAA,MACpB,WAAA,CAAY,CAAA,qBAAsB,GAAA,GAAM,CAAA;;;AA5B7C;UAiCiB,iBAAA;EACf,KAAA,EAAO,KAAA;EAhCQ;EAkCf,MAAA;EACA,OAAA;AAAA;AAAA,KAMU,SAAA;;;;;;UASK,UAAA;EAAA,SACN,UAAA;EACT,EAAA,EAAI,WAAA;EACJ,OAAA;AAAA;AAAA,UAGe,cAAA;EACf,KAAA,SAAc,SAAA;EACd,OAAA;EACA,MAAA;EA3CU;EA6CV,KAAA,IAAS,GAAA;AAAA;;;AAlEX;;;;AAAA,iBCIgB,eAAA,WAA0B,KAAA,CAAA,CAAO,EAAA,EAAI,WAAA,CAAY,CAAA,IAAK,WAAA,CAAY,CAAA;ADHlF;;;;;;AAAA,iBCagB,YAAA,WAAuB,KAAA,CAAA,CACrC,EAAA,EAAI,WAAA,CAAY,CAAA,GAChB,KAAA,EAAO,CAAA;EACJ,KAAA,EAAO,UAAA;EAAY,KAAA,EAAO,cAAA;AAAA;;;;;iBAgBf,cAAA,CAAe,GAAA,WAAc,KAA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;;;AfhIH;;;;;;;;iBeqKgB,cAAA,CAAA;;;UCzLC,SAAA,SAAkB,KAAA;EhBDT;EgBGxB,IAAA;EACA,QAAA,GAAW,UAAA;EACX,QAAA,GAAW,UAAA;AAAA;;;;;;;;;;;;;;iBAgBG,IAAA,CAAK,KAAA,EAAO,SAAA,GAAY,KAAA;AAAA,UAUvB,UAAA,SAAmB,KAAA;EhB5Bd;EgB8BpB,IAAA;EACA,QAAA,GAAW,UAAA;AAAA;;;;;;;;iBAUG,KAAA,CAAM,MAAA,EAAQ,UAAA,GAAa,KAAA;AAAA,UAK1B,WAAA,SAAoB,KAAA;EhBzCnC;EgB2CA,QAAA,GAAW,UAAA;EACX,QAAA,GAAW,UAAA,GAAa,UAAA;AAAA;AAAA,iBAoCV,MAAA,CAAO,KAAA,EAAO,WAAA,GAAc,KAAA;AAAA,cAgB/B,WAAA;;;;AhBxGb;;;;;AACA;;;;;;;UiBUiB,YAAA;EjBVkF;EiBYjG,SAAA;EjBZwC;EiBcxC,KAAA;EjBdmF;EiBgBnF,KAAA;EjBhBiG;EiBkBjG,SAAA;EjBhBoB;EiBkBpB,KAAA,GAAQ,MAAA;AAAA;AAAA,KAGE,YAAA,IAAgB,GAAA,EAAK,YAAA;;;;;iBAQjB,oBAAA,CAAqB,OAAA,EAAS,YAAA;;;;;iBAW9B,WAAA,CAAY,GAAA,EAAK,YAAA"}
1
+ {"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/component.ts","../../../src/context.ts","../../../src/dynamic.ts","../../../src/error-boundary.ts","../../../src/for.ts","../../../src/h.ts","../../../src/ref.ts","../../../src/style.ts","../../../src/jsx-runtime.ts","../../../src/suspense.ts","../../../src/lazy.ts","../../../src/lifecycle.ts","../../../src/map-array.ts","../../../src/portal.ts","../../../src/props.ts","../../../src/show.ts","../../../src/telemetry.ts"],"mappings":";KAGY,cAAA,GAAiB,KAAA;AAAA,KACjB,UAAA,GAAa,cAAA,GAAiB,cAAA,YAA0B,c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AAY,KAAA;AAAA,UAUvB,UAAA,SAAmB,KAAA;EhB5Bd;EgB8BpB,IAAA;EACA,QAAA,GAAW,UAAA;AAAA;;;;;;;;iBAUG,KAAA,CAAM,MAAA,EAAQ,UAAA,GAAa,KAAA;AAAA,UAK1B,WAAA,SAAoB,KAAA;EhBzCnC;EgB2CA,QAAA,GAAW,UAAA;EACX,QAAA,GAAW,UAAA,GAAa,UAAA;AAAA;AAAA,iBAoCV,MAAA,CAAO,KAAA,EAAO,WAAA,GAAc,KAAA;AAAA,cAgB/B,WAAA;;;;AhBxGb;;;;;AACA;;;;;;;UiBUiB,YAAA;EjBVkF;EiBYjG,SAAA;EjBZwC;EiBcxC,KAAA;EjBdmF;EiBgBnF,KAAA;EjBhBiG;EiBkBjG,SAAA;EjBhBoB;EiBkBpB,KAAA,GAAQ,MAAA;AAAA;AAAA,KAGE,YAAA,IAAgB,GAAA,EAAK,YAAA;;;;;iBAQjB,oBAAA,CAAqB,OAAA,EAAS,YAAA;;;;;iBAW9B,WAAA,CAAY,GAAA,EAAK,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/core",
3
- "version": "0.12.15",
3
+ "version": "0.13.0",
4
4
  "description": "Core component model and lifecycle for Pyreon",
5
5
  "homepage": "https://github.com/pyreon/pyreon/tree/main/packages/core#readme",
6
6
  "bugs": {
@@ -52,6 +52,9 @@
52
52
  "prepublishOnly": "bun run build"
53
53
  },
54
54
  "dependencies": {
55
- "@pyreon/reactivity": "^0.12.15"
55
+ "@pyreon/reactivity": "^0.13.0"
56
+ },
57
+ "devDependencies": {
58
+ "@pyreon/manifest": "0.13.0"
56
59
  }
57
60
  }
package/src/context.ts CHANGED
@@ -75,13 +75,7 @@ export function pushContext(values: Map<symbol, unknown>) {
75
75
 
76
76
  export function popContext() {
77
77
  const stack = getStack()
78
- if (__DEV__ && stack.length === 0) {
79
- // oxlint-disable-next-line no-console
80
- console.warn(
81
- '[Pyreon] popContext() called on an empty context stack. This likely indicates a missing Provider.',
82
- )
83
- return
84
- }
78
+ if (stack.length === 0) return
85
79
  stack.pop()
86
80
  }
87
81
 
@@ -0,0 +1,531 @@
1
+ import { defineManifest } from '@pyreon/manifest'
2
+
3
+ export default defineManifest({
4
+ name: '@pyreon/core',
5
+ title: 'Complete API',
6
+ tagline:
7
+ 'VNode, h(), Fragment, lifecycle, context, JSX runtime, Suspense, ErrorBoundary, lazy(), Dynamic, cx(), splitProps, mergeProps, createUniqueId',
8
+ description:
9
+ 'Component model and lifecycle for Pyreon. Provides the VNode type system, `h()` hyperscript function, JSX automatic runtime (`@pyreon/core/jsx-runtime`), lifecycle hooks (`onMount`, `onUnmount`), two-tier context system (`createContext` for static values, `createReactiveContext` for signal-backed values), control-flow components (`Show`, `Switch`/`Match`, `For`, `Suspense`, `ErrorBoundary`), code-splitting via `lazy()`, dynamic rendering via `Dynamic`, and props utilities (`splitProps`, `mergeProps`, `cx`, `createUniqueId`). Components are plain functions (`ComponentFn<P> = (props: P) => VNodeChild`) that run ONCE — reactivity comes from reading signals inside reactive scopes, not from re-running the component.',
10
+ category: 'universal',
11
+ longExample: `import { h, Fragment, onMount, onUnmount, provide, createContext, createReactiveContext, useContext, Show, Switch, Match, For, Suspense, ErrorBoundary, lazy, Dynamic, cx, splitProps, mergeProps, createUniqueId, untrack } from "@pyreon/core"
12
+ import { signal, computed } from "@pyreon/reactivity"
13
+
14
+ // Context — static (destructure-safe) vs reactive (must call to read)
15
+ const ThemeCtx = createContext<"light" | "dark">("light")
16
+ const ModeCtx = createReactiveContext<"light" | "dark">("light")
17
+
18
+ const App = (props: { children: any }) => {
19
+ const mode = signal<"light" | "dark">("dark")
20
+ provide(ThemeCtx, "dark") // static — safe to destructure
21
+ provide(ModeCtx, () => mode()) // reactive — consumer must call
22
+
23
+ return <>{props.children}</>
24
+ }
25
+
26
+ // Lifecycle
27
+ const Timer = () => {
28
+ const count = signal(0)
29
+ onMount(() => {
30
+ const id = setInterval(() => count.update(n => n + 1), 1000)
31
+ return () => clearInterval(id) // cleanup runs on unmount
32
+ })
33
+ return <div>{() => count()}</div>
34
+ }
35
+
36
+ // Control flow — reactive conditional rendering
37
+ const Page = (props: { items: { id: number; name: string }[]; loggedIn: () => boolean }) => (
38
+ <div>
39
+ <Show when={props.loggedIn()} fallback={<p>Please log in</p>}>
40
+ <For each={props.items} by={item => item.id}>
41
+ {item => <li>{item.name}</li>}
42
+ </For>
43
+ </Show>
44
+ </div>
45
+ )
46
+
47
+ // Props utilities — preserve reactivity
48
+ const Button = (props: { class?: string; size?: string; onClick: () => void; children: any }) => {
49
+ const [local, rest] = splitProps(props, ["class", "size"])
50
+ const merged = mergeProps({ size: "md" }, local)
51
+ const id = createUniqueId()
52
+ return <button id={id} {...rest} class={cx("btn", \`btn-\${merged.size}\`, local.class)} />
53
+ }
54
+
55
+ // Code splitting
56
+ const HeavyPage = lazy(() => import("./HeavyPage"))
57
+ const LazyApp = () => (
58
+ <Suspense fallback={<div>Loading...</div>}>
59
+ <HeavyPage />
60
+ </Suspense>
61
+ )`,
62
+ features: [
63
+ 'h() — hyperscript function producing VNodes, JSX compiles to h() or _tpl()',
64
+ 'Fragment — group children without a wrapper DOM element',
65
+ 'onMount / onUnmount — lifecycle hooks, onMount supports cleanup return',
66
+ 'createContext / createReactiveContext — two-tier context system',
67
+ 'provide / useContext — push and read context values',
68
+ 'Show / Switch+Match — reactive conditional rendering',
69
+ 'For — keyed reactive list rendering with by prop',
70
+ 'Suspense / ErrorBoundary — async and error boundaries',
71
+ 'lazy() / Dynamic — code splitting and dynamic component rendering',
72
+ 'splitProps / mergeProps — reactivity-preserving props utilities',
73
+ 'cx() — class value combiner (strings, objects, arrays, nested)',
74
+ 'createUniqueId — SSR-safe unique ID generation',
75
+ ],
76
+ api: [
77
+ {
78
+ name: 'h',
79
+ kind: 'function',
80
+ signature:
81
+ 'h<P extends Props>(type: ComponentFn<P> | string | symbol, props: P | null, ...children: VNodeChild[]): VNode',
82
+ summary:
83
+ 'Create a VNode from a component function, HTML tag string, or symbol (Fragment, Portal). Low-level API — prefer JSX which compiles to `h()` calls (or `_tpl()` + `_bind()` for template-optimized paths). Children are stored in `vnode.children`; components must merge them via `props.children = vnode.children.length === 1 ? vnode.children[0] : vnode.children`.',
84
+ example: `const vnode = h("div", { class: "container" },
85
+ h("h1", null, "Hello"),
86
+ h(Counter, { initial: 0 })
87
+ )`,
88
+ mistakes: [
89
+ '`h("div", "text")` — second arg is always props (or null). Text children go in the third+ positions: `h("div", null, "text")`',
90
+ '`h(MyComponent, { children: <span /> })` — children go as rest args, not a prop: `h(MyComponent, null, <span />)`',
91
+ '`h("input", { className: "x" })` — use `class` not `className` (Pyreon uses standard HTML attributes)',
92
+ '`h("input", { onChange: handler })` — use `onInput` for keypress-by-keypress updates (native DOM events)',
93
+ ],
94
+ seeAlso: ['Fragment', 'Dynamic', 'lazy'],
95
+ },
96
+ {
97
+ name: 'Fragment',
98
+ kind: 'constant',
99
+ signature: 'Fragment: symbol',
100
+ summary:
101
+ 'Symbol used as the type for fragment VNodes that group children without producing a wrapper DOM element. In JSX, `<>...</>` compiles to `h(Fragment, null, ...)`. Useful when a component needs to return multiple sibling elements.',
102
+ example: `// JSX:
103
+ <>
104
+ <h1>Title</h1>
105
+ <p>Content</p>
106
+ </>
107
+
108
+ // h() API:
109
+ h(Fragment, null, h("h1", null, "Title"), h("p", null, "Content"))`,
110
+ seeAlso: ['h'],
111
+ },
112
+ {
113
+ name: 'onMount',
114
+ kind: 'function',
115
+ signature: 'onMount(fn: () => CleanupFn | void): void',
116
+ summary:
117
+ 'Register a callback that runs after the component mounts into the DOM. The callback can optionally return a cleanup function that runs on unmount — this is the idiomatic pattern for event listeners, timers, and subscriptions. Must be called during component setup (the synchronous function body), not inside effects or async callbacks.',
118
+ example: `const Timer = () => {
119
+ const count = signal(0)
120
+
121
+ onMount(() => {
122
+ const id = setInterval(() => count.update(n => n + 1), 1000)
123
+ return () => clearInterval(id) // cleanup on unmount
124
+ })
125
+
126
+ return <div>{() => count()}</div>
127
+ }`,
128
+ mistakes: [
129
+ 'Forgetting cleanup: `onMount(() => { const id = setInterval(...) })` leaks the interval. Return cleanup: `return () => clearInterval(id)`',
130
+ 'Using `onMount` + separate `onUnmount` for paired setup/teardown — prefer returning cleanup from `onMount` instead',
131
+ 'Calling `onMount` inside an `effect()` or async callback — it only works during synchronous component setup',
132
+ 'Accessing DOM refs before mount — the callback runs AFTER mount, which is the right place for DOM measurements',
133
+ ],
134
+ seeAlso: ['onUnmount', 'onUpdate'],
135
+ },
136
+ {
137
+ name: 'onUnmount',
138
+ kind: 'function',
139
+ signature: 'onUnmount(fn: () => void): void',
140
+ summary:
141
+ 'Register a callback that runs when the component is removed from the DOM. For paired setup/teardown, prefer returning a cleanup function from `onMount` instead — it co-locates the cleanup with the setup. `onUnmount` is useful when cleanup needs to reference state computed separately from the mount callback.',
142
+ example: `onUnmount(() => {
143
+ console.log("Component removed from DOM")
144
+ })`,
145
+ seeAlso: ['onMount'],
146
+ },
147
+ {
148
+ name: 'onUpdate',
149
+ kind: 'function',
150
+ signature: 'onUpdate(fn: () => void): void',
151
+ summary:
152
+ 'Register a callback that runs after the component updates (reactive dependencies change and DOM patches complete). Rarely needed — most update logic belongs in `effect()` or `computed()`. Useful for imperative DOM measurements that need to run after all reactive updates have flushed.',
153
+ example: `onUpdate(() => {
154
+ console.log("Component updated, DOM is current")
155
+ })`,
156
+ seeAlso: ['onMount', 'onUnmount'],
157
+ },
158
+ {
159
+ name: 'onErrorCaptured',
160
+ kind: 'function',
161
+ signature: 'onErrorCaptured(fn: (error: unknown) => boolean | void): void',
162
+ summary:
163
+ 'Register an error handler that captures errors thrown by descendant components. Return `false` to prevent the error from propagating further up the tree. Works alongside `ErrorBoundary` for programmatic error handling.',
164
+ example: `onErrorCaptured((error) => {
165
+ console.error("Caught:", error)
166
+ return false // stop propagation
167
+ })`,
168
+ seeAlso: ['ErrorBoundary'],
169
+ },
170
+ {
171
+ name: 'createContext',
172
+ kind: 'function',
173
+ signature: 'createContext<T>(defaultValue: T): Context<T>',
174
+ summary:
175
+ 'Create a static context. `useContext()` returns the value directly (`T`), so it is safe to destructure. Use this for values that do not change after being provided (theme name, locale string, config object). For values that change reactively (mode signal, locale signal), use `createReactiveContext` instead — otherwise consumers capture a stale snapshot at setup time.',
176
+ example: `const ThemeCtx = createContext<"light" | "dark">("light")
177
+
178
+ // Provide:
179
+ const App = () => {
180
+ provide(ThemeCtx, "dark")
181
+ return <Child />
182
+ }
183
+
184
+ // Consume:
185
+ const Child = () => {
186
+ const theme = useContext(ThemeCtx) // "dark" — safe to destructure
187
+ return <div class={theme}>...</div>
188
+ }`,
189
+ mistakes: [
190
+ '`provide(ThemeCtx, () => modeSignal())` with a static context — the consumer receives the function itself, not the signal value. Use `createReactiveContext` for dynamic values',
191
+ 'Destructuring a reactive context value: `const { mode } = useContext(reactiveCtx)` captures once. Keep the object reference and access lazily',
192
+ 'Calling `useContext` outside a component body — it reads from the component context stack, which only exists during setup',
193
+ ],
194
+ seeAlso: ['createReactiveContext', 'provide', 'useContext'],
195
+ },
196
+ {
197
+ name: 'createReactiveContext',
198
+ kind: 'function',
199
+ signature: 'createReactiveContext<T>(defaultValue: T): ReactiveContext<T>',
200
+ summary:
201
+ 'Create a reactive context. `useContext()` returns `() => T` — an accessor that must be called to read the current value. Use this for values that change over time (mode, locale, user). The accessor subscribes to updates when read inside reactive scopes (`effect()`, JSX thunks, `computed()`).',
202
+ example: `const ModeCtx = createReactiveContext<"light" | "dark">("light")
203
+
204
+ // Provide:
205
+ const App = () => {
206
+ const mode = signal<"light" | "dark">("dark")
207
+ provide(ModeCtx, () => mode())
208
+ return <Child />
209
+ }
210
+
211
+ // Consume:
212
+ const Child = () => {
213
+ const getMode = useContext(ModeCtx) // () => "dark"
214
+ return <div class={getMode()}>...</div>
215
+ }`,
216
+ seeAlso: ['createContext', 'provide', 'useContext'],
217
+ },
218
+ {
219
+ name: 'provide',
220
+ kind: 'function',
221
+ signature: 'provide<T>(ctx: Context<T> | ReactiveContext<T>, value: T): void',
222
+ summary:
223
+ 'Push a context value for all descendant components. Auto-cleans up on unmount. Must be called during component setup (synchronous function body). Preferred over manual `pushContext`/`popContext`. For reactive values, provide a getter function to a `ReactiveContext`: `provide(ModeCtx, () => modeSignal())`.',
224
+ example: `const ThemeCtx = createContext<"light" | "dark">("light")
225
+
226
+ function App() {
227
+ provide(ThemeCtx, "dark")
228
+ return <Child />
229
+ }`,
230
+ mistakes: [
231
+ '`provide(ctx, "static")` for a value that changes — use `createReactiveContext` + `provide(ctx, () => signal())`',
232
+ 'Calling `provide` inside `onMount` or `effect` — it must run during synchronous component setup',
233
+ 'Providing the same context twice in one component — the second `provide` shadows the first for that subtree',
234
+ ],
235
+ seeAlso: ['createContext', 'createReactiveContext', 'useContext'],
236
+ },
237
+ {
238
+ name: 'useContext',
239
+ kind: 'function',
240
+ signature: 'useContext<T>(ctx: Context<T>): T',
241
+ summary:
242
+ 'Read the nearest provided value for a context. For static `Context<T>`, returns `T` directly. For `ReactiveContext<T>`, returns `() => T` — must call the accessor to read. Falls back to the default value if no ancestor provides the context.',
243
+ example: `const theme = useContext(ThemeContext) // static: returns T
244
+ const getMode = useContext(ModeCtx) // reactive: returns () => T`,
245
+ seeAlso: ['provide', 'createContext', 'createReactiveContext'],
246
+ },
247
+ {
248
+ name: 'Show',
249
+ kind: 'component',
250
+ signature: '<Show when={condition} fallback={alternative}>{children}</Show>',
251
+ summary:
252
+ 'Reactive conditional rendering. Mounts children when `when` is truthy, unmounts and shows `fallback` when falsy. More efficient than ternary for signal-driven conditions because it avoids re-evaluating the entire branch expression on every signal change — `Show` only transitions between mounted/unmounted when the boolean flips.',
253
+ example: `<Show when={isLoggedIn()} fallback={<LoginForm />}>
254
+ <Dashboard />
255
+ </Show>`,
256
+ mistakes: [
257
+ '`{cond() ? <A /> : <B />}` — works but less efficient than `<Show>` for signal-driven conditions',
258
+ '`<Show when={items().length}>` — works (truthy check), but be explicit: `<Show when={items().length > 0}>`',
259
+ '`<Show when={user}>` without calling the signal — must call: `<Show when={user()}>`',
260
+ ],
261
+ seeAlso: ['Switch', 'Match', 'For'],
262
+ },
263
+ {
264
+ name: 'Switch',
265
+ kind: 'component',
266
+ signature: '<Switch fallback={default}>{Match children}</Switch>',
267
+ summary:
268
+ 'Multi-branch conditional rendering. Renders the first `<Match>` child whose `when` prop is truthy. If no match, renders the `fallback`. More readable than nested `<Show>` for multi-way conditions.',
269
+ example: `<Switch fallback={<p>Unknown status</p>}>
270
+ <Match when={status() === "loading"}>
271
+ <Spinner />
272
+ </Match>
273
+ <Match when={status() === "error"}>
274
+ <ErrorDisplay />
275
+ </Match>
276
+ <Match when={status() === "success"}>
277
+ <Results />
278
+ </Match>
279
+ </Switch>`,
280
+ seeAlso: ['Match', 'Show'],
281
+ },
282
+ {
283
+ name: 'Match',
284
+ kind: 'component',
285
+ signature: '<Match when={condition}>{children}</Match>',
286
+ summary:
287
+ 'A branch inside a `<Switch>`. Renders its children when `when` is truthy and it is the first truthy `<Match>` in the parent `<Switch>`. Must be a direct child of `<Switch>`.',
288
+ example: `<Switch>
289
+ <Match when={tab() === "home"}><Home /></Match>
290
+ <Match when={tab() === "settings"}><Settings /></Match>
291
+ </Switch>`,
292
+ seeAlso: ['Switch', 'Show'],
293
+ },
294
+ {
295
+ name: 'For',
296
+ kind: 'component',
297
+ signature: '<For each={items} by={keyFn}>{renderFn}</For>',
298
+ summary:
299
+ 'Keyed reactive list rendering. Uses the `by` prop (not `key`) for the key function because JSX extracts `key` as a special VNode reconciliation prop. The render function receives each item and its index. Internally uses an LIS-based reconciler for minimal DOM mutations when the list changes.',
300
+ example: `const items = signal([
301
+ { id: 1, name: "Apple" },
302
+ { id: 2, name: "Banana" },
303
+ ])
304
+
305
+ <For each={items()} by={item => item.id}>
306
+ {(item, index) => <li>{item.name}</li>}
307
+ </For>`,
308
+ mistakes: [
309
+ '`<For each={items}>` — must call the signal: `<For each={items()}>`',
310
+ '`<For each={items()} key={...}>` — use `by` not `key` (JSX reserves `key` for VNode reconciliation)',
311
+ '`{items().map(...)}` — use `<For>` for reactive list rendering; `.map()` re-creates all DOM nodes on every change',
312
+ '`<For each={items()} by={index}>` — using array index as key defeats the reconciler; use a stable identity like `item.id`',
313
+ ],
314
+ seeAlso: ['Show', 'mapArray'],
315
+ },
316
+ {
317
+ name: 'Suspense',
318
+ kind: 'component',
319
+ signature: '<Suspense fallback={loadingUI}>{children}</Suspense>',
320
+ summary:
321
+ 'Async boundary that shows `fallback` while any `lazy()` component or async child inside is loading. SSR mode streams the fallback immediately and swaps in the resolved content when ready (30s timeout). Nested Suspense boundaries are independent — an inner boundary resolving does not affect the outer.',
322
+ example: `const LazyPage = lazy(() => import("./HeavyPage"))
323
+
324
+ <Suspense fallback={<div>Loading...</div>}>
325
+ <LazyPage />
326
+ </Suspense>`,
327
+ seeAlso: ['lazy', 'ErrorBoundary'],
328
+ },
329
+ {
330
+ name: 'ErrorBoundary',
331
+ kind: 'component',
332
+ signature: '<ErrorBoundary onCatch={handler} fallback={errorUI}>{children}</ErrorBoundary>',
333
+ summary:
334
+ 'Catches render errors thrown by descendant components. The `fallback` receives the error object for display. `onCatch` fires with the error for logging/telemetry. Without an ErrorBoundary, uncaught errors propagate to the nearest `registerErrorHandler` or crash the app.',
335
+ example: `<ErrorBoundary
336
+ onCatch={(err) => console.error(err)}
337
+ fallback={(err) => <div>Error: {err.message}</div>}
338
+ >
339
+ <App />
340
+ </ErrorBoundary>`,
341
+ seeAlso: ['Suspense', 'onErrorCaptured'],
342
+ },
343
+ {
344
+ name: 'lazy',
345
+ kind: 'function',
346
+ signature:
347
+ 'lazy(loader: () => Promise<{ default: ComponentFn }>, options?: LazyOptions): LazyComponent',
348
+ summary:
349
+ 'Wrap a dynamic import for code splitting. Returns a component that integrates with `Suspense` — the parent Suspense boundary shows its fallback until the import resolves. The loaded component is cached after first resolution.',
350
+ example: `const Settings = lazy(() => import("./pages/Settings"))
351
+
352
+ // Use in JSX (wrap with Suspense):
353
+ <Suspense fallback={<Spinner />}>
354
+ <Settings />
355
+ </Suspense>`,
356
+ seeAlso: ['Suspense', 'Dynamic'],
357
+ },
358
+ {
359
+ name: 'Dynamic',
360
+ kind: 'component',
361
+ signature: '<Dynamic component={comp} {...props} />',
362
+ summary:
363
+ 'Renders a component by reference or string tag name. Useful when the component to render is determined at runtime (tab panels, plugin systems, polymorphic containers). When `component` changes, the previous component unmounts and the new one mounts.',
364
+ example: `const components = { home: HomePage, about: AboutPage }
365
+ const current = signal("home")
366
+
367
+ <Dynamic component={components[current()]} />`,
368
+ seeAlso: ['lazy', 'h'],
369
+ },
370
+ {
371
+ name: 'cx',
372
+ kind: 'function',
373
+ signature: 'cx(...values: ClassValue[]): string',
374
+ summary:
375
+ 'Combine class values into a single string. Accepts strings, booleans (falsy values ignored), objects (`{ active: true }`), and arrays (nested). The `class` prop on JSX elements already accepts `ClassValue` directly, so explicit `cx()` is only needed when building class strings outside JSX or when composing values from multiple sources.',
376
+ example: `cx("foo", "bar") // "foo bar"
377
+ cx("base", isActive && "active") // conditional
378
+ cx({ base: true, active: isActive() }) // object syntax
379
+ cx(["a", ["b", { c: true }]]) // nested arrays
380
+
381
+ // class prop accepts ClassValue directly:
382
+ <div class={["base", cond && "active"]} />
383
+ <div class={{ base: true, active: isActive() }} />`,
384
+ seeAlso: ['splitProps', 'mergeProps'],
385
+ },
386
+ {
387
+ name: 'splitProps',
388
+ kind: 'function',
389
+ signature:
390
+ 'splitProps<T, K extends keyof T>(props: T, keys: K[]): [Pick<T, K>, Omit<T, K>]',
391
+ summary:
392
+ 'Split a props object into two parts: the picked keys and the rest. Both halves preserve signal reactivity — reads through either half still track the original reactive prop getters. This is the Pyreon replacement for `const { x, ...rest } = props` destructuring, which captures values once and loses reactivity.',
393
+ example: `const Button = (props: { class?: string; onClick: () => void; children: VNodeChild }) => {
394
+ const [local, rest] = splitProps(props, ["class"])
395
+ return <button {...rest} class={cx("btn", local.class)} />
396
+ }`,
397
+ mistakes: [
398
+ '`const { class: cls, ...rest } = props` — destructuring captures once, loses reactivity. Use `splitProps(props, ["class"])`',
399
+ 'Passing a non-props object — `splitProps` relies on reactive getter descriptors that the compiler creates on props objects',
400
+ 'Forgetting that symbol-keyed props are preserved — `splitProps` uses `Reflect.ownKeys` so symbols (like `REACTIVE_PROP`) survive',
401
+ ],
402
+ seeAlso: ['mergeProps', 'cx'],
403
+ },
404
+ {
405
+ name: 'mergeProps',
406
+ kind: 'function',
407
+ signature: 'mergeProps<T extends object[]>(...sources: T): MergedProps<T>',
408
+ summary:
409
+ 'Merge multiple props objects with last-source-wins semantics. Reads are lazy — the merged object delegates to the source objects via getters, so signal reactivity is preserved. Commonly used to inject default props: `mergeProps({ size: "md" }, props)`. Forces `configurable: true` on copied descriptors to prevent "Cannot redefine property" errors.',
410
+ example: `const Button = (props: { size?: string; variant?: string }) => {
411
+ const merged = mergeProps({ size: "md", variant: "primary" }, props)
412
+ return <button class={\`btn-\${merged.size} btn-\${merged.variant}\`} />
413
+ }`,
414
+ mistakes: [
415
+ '`Object.assign({}, defaults, props)` — loses reactivity. Use `mergeProps(defaults, props)` instead',
416
+ '`mergeProps(props, defaults)` — wrong order. Defaults go FIRST, actual props last (last source wins)',
417
+ ],
418
+ seeAlso: ['splitProps', 'cx'],
419
+ },
420
+ {
421
+ name: 'createUniqueId',
422
+ kind: 'function',
423
+ signature: 'createUniqueId(): string',
424
+ summary:
425
+ 'Generate a unique string ID ("pyreon-1", "pyreon-2", ...) that is consistent between server and client when called in the same order. SSR-safe — the counter resets per request context. Use for `id`/`for`/`aria-*` attribute pairing in components.',
426
+ example: `const LabeledInput = (props: { label: string }) => {
427
+ const id = createUniqueId()
428
+ return (
429
+ <>
430
+ <label for={id}>{props.label}</label>
431
+ <input id={id} />
432
+ </>
433
+ )
434
+ }`,
435
+ seeAlso: ['splitProps'],
436
+ },
437
+ {
438
+ name: 'Portal',
439
+ kind: 'component',
440
+ signature: '<Portal target={element}>{children}</Portal>',
441
+ summary:
442
+ 'Render children into a DOM element outside the component tree (typically `document.body`). Useful for modals, tooltips, and overlays that need to escape parent overflow/z-index stacking contexts. Context values from the Portal source tree are preserved.',
443
+ example: `<Portal target={document.body}>
444
+ <div class="modal-overlay">
445
+ <div class="modal">Content</div>
446
+ </div>
447
+ </Portal>`,
448
+ seeAlso: ['Dynamic'],
449
+ },
450
+ {
451
+ name: 'mapArray',
452
+ kind: 'function',
453
+ signature: 'mapArray<T, U>(list: () => T[], mapFn: (item: T, index: () => number) => U): () => U[]',
454
+ summary:
455
+ 'Low-level reactive array mapping used internally by `<For>`. Maps a reactive array signal through a transform function, caching results per item identity. Prefer `<For>` in JSX — use `mapArray` only when you need a reactive derived array outside of rendering.',
456
+ example: `const items = signal([1, 2, 3])
457
+ const doubled = mapArray(() => items(), (item) => item * 2)
458
+ // doubled() → [2, 4, 6] — updates reactively`,
459
+ seeAlso: ['For'],
460
+ },
461
+ {
462
+ name: 'createRef',
463
+ kind: 'function',
464
+ signature: 'createRef<T>(): Ref<T>',
465
+ summary:
466
+ 'Create a mutable ref object (`{ current: T | null }`) for holding DOM element references. Pass as the `ref` prop on JSX elements — the runtime sets `.current` after mount and clears it on unmount. Callback refs (`(el: T | null) => void`) are also supported via `RefProp<T>`.',
467
+ example: `const inputRef = createRef<HTMLInputElement>()
468
+ onMount(() => inputRef.current?.focus())
469
+ return <input ref={inputRef} />`,
470
+ seeAlso: ['onMount'],
471
+ },
472
+ {
473
+ name: 'untrack',
474
+ kind: 'function',
475
+ signature: '(fn: () => T) => T',
476
+ summary:
477
+ 'Execute a function reading signals WITHOUT subscribing to them. Alias for `runUntracked` from `@pyreon/reactivity`. Use inside effects when you need a one-shot snapshot of a signal value without the effect re-running when that signal changes.',
478
+ example: `effect(() => {
479
+ const current = count() // tracked
480
+ const other = untrack(() => otherSignal()) // NOT tracked
481
+ })`,
482
+ seeAlso: ['@pyreon/reactivity'],
483
+ },
484
+ {
485
+ name: 'ExtractProps',
486
+ kind: 'type',
487
+ signature: 'type ExtractProps<T> = T extends ComponentFn<infer P> ? P : T',
488
+ summary:
489
+ 'Extracts the props type from a `ComponentFn`. Passes through unchanged if `T` is not a `ComponentFn`. Useful for HOC patterns and typed wrappers that need to infer the wrapped component\'s prop interface.',
490
+ example: `const Greet: ComponentFn<{ name: string }> = ({ name }) => <h1>{name}</h1>
491
+ type Props = ExtractProps<typeof Greet> // { name: string }`,
492
+ seeAlso: ['HigherOrderComponent'],
493
+ },
494
+ {
495
+ name: 'HigherOrderComponent',
496
+ kind: 'type',
497
+ signature: 'type HigherOrderComponent<HOP, P> = ComponentFn<HOP & P>',
498
+ summary:
499
+ 'Typed HOC pattern where `HOP` is the props the HOC adds and `P` is the wrapped component\'s own props. The resulting component accepts both sets of props.',
500
+ example: `function withLogger<P>(Wrapped: ComponentFn<P>): HigherOrderComponent<{ logLevel?: string }, P> {
501
+ return (props) => {
502
+ console.log(\`[\${props.logLevel ?? "info"}] Rendering\`)
503
+ return <Wrapped {...props} />
504
+ }
505
+ }`,
506
+ seeAlso: ['ExtractProps'],
507
+ },
508
+ ],
509
+ gotchas: [
510
+ {
511
+ label: 'Components run once',
512
+ note: 'Pyreon components are plain functions that execute a single time. Reactivity comes from reading signals inside reactive scopes (JSX expression thunks, `effect()`, `computed()`), not from re-running the component function. `if (!cond()) return null` at the top level runs once and is static — use `return (() => { if (!cond()) return null; return <div /> })` for reactive conditional rendering.',
513
+ },
514
+ {
515
+ label: 'Destructuring props kills reactivity',
516
+ note: '`const { name } = props` captures the value at setup time — it becomes static. Use `props.name` inside reactive scopes, or `splitProps(props, ["name"])` for rest patterns. The compiler handles `const x = props.y; return <div>{x}</div>` by inlining `props.y` back at the use site, but only for `const` (not `let`/`var`).',
517
+ },
518
+ {
519
+ label: 'Two context types',
520
+ note: '`createContext<T>` returns `T` from `useContext()` — safe to destructure. `createReactiveContext<T>` returns `() => T` — must call to read. Using the wrong one is a common source of stale-value bugs (static context for dynamic values) or unnecessary ceremony (reactive context for constants).',
521
+ },
522
+ {
523
+ label: 'For uses by, not key',
524
+ note: 'The `<For>` component uses the `by` prop for its key function because JSX extracts `key` as a special VNode reconciliation prop. Writing `<For each={items()} key={fn}>` silently passes the key to the VNode system instead of the list reconciler.',
525
+ },
526
+ {
527
+ label: 'JSX uses standard HTML attributes',
528
+ note: 'Use `class` not `className`, `for` not `htmlFor`, `onInput` not `onChange` for per-keystroke updates. Pyreon maps to native DOM events, not the React synthetic event system.',
529
+ },
530
+ ],
531
+ })
@@ -110,12 +110,10 @@ describe('pushContext / popContext', () => {
110
110
  expect(useContext(ctx)).toBe(0) // default
111
111
  })
112
112
 
113
- test('popContext on empty stack warns in dev mode', () => {
113
+ test('popContext on empty stack is a silent no-op', () => {
114
114
  const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})
115
115
  popContext()
116
- expect(warnSpy).toHaveBeenCalledWith(
117
- expect.stringContaining('popContext() called on an empty context stack'),
118
- )
116
+ expect(warnSpy).not.toHaveBeenCalled()
119
117
  warnSpy.mockRestore()
120
118
  })
121
119
  })
@@ -0,0 +1,95 @@
1
+ import {
2
+ renderApiReferenceEntries,
3
+ renderLlmsFullSection,
4
+ renderLlmsTxtLine,
5
+ } from '@pyreon/manifest'
6
+ import coreManifest from '../manifest'
7
+
8
+ describe('gen-docs — core snapshot', () => {
9
+ it('renders @pyreon/core to its expected llms.txt bullet', () => {
10
+ expect(renderLlmsTxtLine(coreManifest)).toMatchInlineSnapshot(`"- @pyreon/core — VNode, h(), Fragment, lifecycle, context, JSX runtime, Suspense, ErrorBoundary, lazy(), Dynamic, cx(), splitProps, mergeProps, createUniqueId. Pyreon components are plain functions that execute a single time. Reactivity comes from reading signals inside reactive scopes (JSX expression thunks, \`effect()\`, \`computed()\`), not from re-running the component function. \`if (!cond()) return null\` at the top level runs once and is static — use \`return (() => { if (!cond()) return null; return <div /> })\` for reactive conditional rendering."`)
11
+ })
12
+
13
+ it('renders @pyreon/core to its expected llms-full.txt section — full body snapshot', () => {
14
+ expect(renderLlmsFullSection(coreManifest)).toMatchInlineSnapshot(`
15
+ "## @pyreon/core — Complete API
16
+
17
+ Component model and lifecycle for Pyreon. Provides the VNode type system, \`h()\` hyperscript function, JSX automatic runtime (\`@pyreon/core/jsx-runtime\`), lifecycle hooks (\`onMount\`, \`onUnmount\`), two-tier context system (\`createContext\` for static values, \`createReactiveContext\` for signal-backed values), control-flow components (\`Show\`, \`Switch\`/\`Match\`, \`For\`, \`Suspense\`, \`ErrorBoundary\`), code-splitting via \`lazy()\`, dynamic rendering via \`Dynamic\`, and props utilities (\`splitProps\`, \`mergeProps\`, \`cx\`, \`createUniqueId\`). Components are plain functions (\`ComponentFn<P> = (props: P) => VNodeChild\`) that run ONCE — reactivity comes from reading signals inside reactive scopes, not from re-running the component.
18
+
19
+ \`\`\`typescript
20
+ import { h, Fragment, onMount, onUnmount, provide, createContext, createReactiveContext, useContext, Show, Switch, Match, For, Suspense, ErrorBoundary, lazy, Dynamic, cx, splitProps, mergeProps, createUniqueId, untrack } from "@pyreon/core"
21
+ import { signal, computed } from "@pyreon/reactivity"
22
+
23
+ // Context — static (destructure-safe) vs reactive (must call to read)
24
+ const ThemeCtx = createContext<"light" | "dark">("light")
25
+ const ModeCtx = createReactiveContext<"light" | "dark">("light")
26
+
27
+ const App = (props: { children: any }) => {
28
+ const mode = signal<"light" | "dark">("dark")
29
+ provide(ThemeCtx, "dark") // static — safe to destructure
30
+ provide(ModeCtx, () => mode()) // reactive — consumer must call
31
+
32
+ return <>{props.children}</>
33
+ }
34
+
35
+ // Lifecycle
36
+ const Timer = () => {
37
+ const count = signal(0)
38
+ onMount(() => {
39
+ const id = setInterval(() => count.update(n => n + 1), 1000)
40
+ return () => clearInterval(id) // cleanup runs on unmount
41
+ })
42
+ return <div>{() => count()}</div>
43
+ }
44
+
45
+ // Control flow — reactive conditional rendering
46
+ const Page = (props: { items: { id: number; name: string }[]; loggedIn: () => boolean }) => (
47
+ <div>
48
+ <Show when={props.loggedIn()} fallback={<p>Please log in</p>}>
49
+ <For each={props.items} by={item => item.id}>
50
+ {item => <li>{item.name}</li>}
51
+ </For>
52
+ </Show>
53
+ </div>
54
+ )
55
+
56
+ // Props utilities — preserve reactivity
57
+ const Button = (props: { class?: string; size?: string; onClick: () => void; children: any }) => {
58
+ const [local, rest] = splitProps(props, ["class", "size"])
59
+ const merged = mergeProps({ size: "md" }, local)
60
+ const id = createUniqueId()
61
+ return <button id={id} {...rest} class={cx("btn", \`btn-\${merged.size}\`, local.class)} />
62
+ }
63
+
64
+ // Code splitting
65
+ const HeavyPage = lazy(() => import("./HeavyPage"))
66
+ const LazyApp = () => (
67
+ <Suspense fallback={<div>Loading...</div>}>
68
+ <HeavyPage />
69
+ </Suspense>
70
+ )
71
+ \`\`\`
72
+
73
+ > **Components run once**: Pyreon components are plain functions that execute a single time. Reactivity comes from reading signals inside reactive scopes (JSX expression thunks, \`effect()\`, \`computed()\`), not from re-running the component function. \`if (!cond()) return null\` at the top level runs once and is static — use \`return (() => { if (!cond()) return null; return <div /> })\` for reactive conditional rendering.
74
+ >
75
+ > **Destructuring props kills reactivity**: \`const { name } = props\` captures the value at setup time — it becomes static. Use \`props.name\` inside reactive scopes, or \`splitProps(props, ["name"])\` for rest patterns. The compiler handles \`const x = props.y; return <div>{x}</div>\` by inlining \`props.y\` back at the use site, but only for \`const\` (not \`let\`/\`var\`).
76
+ >
77
+ > **Two context types**: \`createContext<T>\` returns \`T\` from \`useContext()\` — safe to destructure. \`createReactiveContext<T>\` returns \`() => T\` — must call to read. Using the wrong one is a common source of stale-value bugs (static context for dynamic values) or unnecessary ceremony (reactive context for constants).
78
+ >
79
+ > **For uses by, not key**: The \`<For>\` component uses the \`by\` prop for its key function because JSX extracts \`key\` as a special VNode reconciliation prop. Writing \`<For each={items()} key={fn}>\` silently passes the key to the VNode system instead of the list reconciler.
80
+ >
81
+ > **JSX uses standard HTML attributes**: Use \`class\` not \`className\`, \`for\` not \`htmlFor\`, \`onInput\` not \`onChange\` for per-keystroke updates. Pyreon maps to native DOM events, not the React synthetic event system.
82
+ "
83
+ `)
84
+ })
85
+
86
+ it('renders @pyreon/core to MCP api-reference entries — one per api[] item', () => {
87
+ const record = renderApiReferenceEntries(coreManifest)
88
+ expect(Object.keys(record).length).toBe(28)
89
+ expect(Object.keys(record)).toContain('core/h')
90
+ // Spot-check the flagship API — h() is the hyperscript function
91
+ const h = record['core/h']!
92
+ expect(h.notes).toContain('JSX')
93
+ expect(h.mistakes?.split('\n').length).toBeGreaterThan(2)
94
+ })
95
+ })