@pyreon/solid-compat 0.2.1 → 0.3.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/index.ts","uid":"89dbe469-1"}]}],"isRoot":true},"nodeParts":{"89dbe469-1":{"renderedLength":3135,"gzipLength":1041,"brotliLength":0,"metaUid":"89dbe469-0"}},"nodeMetas":{"89dbe469-0":{"id":"/src/index.ts","moduleParts":{"index.js":"89dbe469-1"},"imported":[{"uid":"89dbe469-2"},{"uid":"89dbe469-3"}],"importedBy":[],"isEntry":true},"89dbe469-2":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"89dbe469-0"}]},"89dbe469-3":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"89dbe469-0"}]}},"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":"c5b6d630-1","name":"jsx-runtime.ts"},{"uid":"c5b6d630-3","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"c5b6d630-1":{"renderedLength":246,"gzipLength":186,"brotliLength":0,"metaUid":"c5b6d630-0"},"c5b6d630-3":{"renderedLength":5835,"gzipLength":1732,"brotliLength":0,"metaUid":"c5b6d630-2"}},"nodeMetas":{"c5b6d630-0":{"id":"/src/jsx-runtime.ts","moduleParts":{"index.js":"c5b6d630-1"},"imported":[{"uid":"c5b6d630-4"},{"uid":"c5b6d630-5"}],"importedBy":[{"uid":"c5b6d630-2"}]},"c5b6d630-2":{"id":"/src/index.ts","moduleParts":{"index.js":"c5b6d630-3"},"imported":[{"uid":"c5b6d630-4"},{"uid":"c5b6d630-5"},{"uid":"c5b6d630-0"}],"importedBy":[],"isEntry":true},"c5b6d630-4":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"c5b6d630-2"},{"uid":"c5b6d630-0"}]},"c5b6d630-5":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"c5b6d630-2"},{"uid":"c5b6d630-0"}]}},"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,8 +1,34 @@
1
- import { ErrorBoundary, For, Match, Show, Suspense, Switch, createContext as pyreonCreateContext, onMount as pyreonOnMount, onUnmount as pyreonOnUnmount, useContext as pyreonUseContext } from "@pyreon/core";
2
- import { batch as pyreonBatch, computed, createSelector as pyreonCreateSelector, effect, effectScope, getCurrentScope, runUntracked, setCurrentScope, signal } from "@pyreon/reactivity";
1
+ import { ErrorBoundary, For, Match, Show, Suspense, Switch, createContext as pyreonCreateContext, onMount as onMount$1, onUnmount, useContext as pyreonUseContext } from "@pyreon/core";
2
+ import { batch as pyreonBatch, computed, createSelector as createSelector$1, effect, effectScope, getCurrentScope, runUntracked, setCurrentScope, signal } from "@pyreon/reactivity";
3
3
 
4
+ //#region src/jsx-runtime.ts
5
+ let _currentCtx = null;
6
+ let _hookIndex = 0;
7
+ function getCurrentCtx() {
8
+ return _currentCtx;
9
+ }
10
+ function getHookIndex() {
11
+ return _hookIndex++;
12
+ }
13
+ const _CHILD_INSTANCE = Symbol.for("pyreon.childInstance");
14
+
15
+ //#endregion
4
16
  //#region src/index.ts
5
17
  function createSignal(initialValue) {
18
+ const ctx = getCurrentCtx();
19
+ if (ctx) {
20
+ const idx = getHookIndex();
21
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = signal(initialValue);
22
+ const s = ctx.hooks[idx];
23
+ const { scheduleRerender } = ctx;
24
+ const getter = () => s();
25
+ const setter = (v) => {
26
+ if (typeof v === "function") s.update(v);
27
+ else s.set(v);
28
+ scheduleRerender();
29
+ };
30
+ return [getter, setter];
31
+ }
6
32
  const s = signal(initialValue);
7
33
  const getter = () => s();
8
34
  const setter = (v) => {
@@ -11,13 +37,57 @@ function createSignal(initialValue) {
11
37
  };
12
38
  return [getter, setter];
13
39
  }
40
+ /**
41
+ * Solid-compatible `createEffect` — creates a reactive side effect.
42
+ *
43
+ * In component context: hook-indexed, only created on first render. The effect
44
+ * uses Pyreon's native tracking so signal reads are automatically tracked.
45
+ * A re-entrance guard prevents infinite loops from signal writes inside
46
+ * the effect.
47
+ */
14
48
  function createEffect(fn) {
49
+ const ctx = getCurrentCtx();
50
+ if (ctx) {
51
+ const idx = getHookIndex();
52
+ if (idx < ctx.hooks.length) return;
53
+ let running = false;
54
+ const e = effect(() => {
55
+ if (running) return;
56
+ running = true;
57
+ try {
58
+ fn();
59
+ } finally {
60
+ running = false;
61
+ }
62
+ });
63
+ const stop = () => e.dispose();
64
+ ctx.hooks[idx] = stop;
65
+ ctx.unmountCallbacks.push(stop);
66
+ return;
67
+ }
15
68
  effect(fn);
16
69
  }
70
+ /**
71
+ * Solid-compatible `createRenderEffect` — same as createEffect.
72
+ * In Solid, this runs during the render phase; here it runs as a Pyreon effect.
73
+ */
17
74
  function createRenderEffect(fn) {
18
- effect(fn);
75
+ createEffect(fn);
19
76
  }
77
+ /**
78
+ * Solid-compatible `createMemo` — derives a value from reactive sources.
79
+ *
80
+ * In component context: hook-indexed, only created on first render.
81
+ * Uses Pyreon's native computed for auto-tracking.
82
+ */
20
83
  function createMemo(fn) {
84
+ const ctx = getCurrentCtx();
85
+ if (ctx) {
86
+ const idx = getHookIndex();
87
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = computed(fn);
88
+ const c = ctx.hooks[idx];
89
+ return () => c();
90
+ }
21
91
  const c = computed(fn);
22
92
  return () => c();
23
93
  }
@@ -49,6 +119,48 @@ function on(deps, fn) {
49
119
  return result;
50
120
  };
51
121
  }
122
+ function onMount(fn) {
123
+ const ctx = getCurrentCtx();
124
+ if (ctx) {
125
+ const idx = getHookIndex();
126
+ if (idx >= ctx.hooks.length) {
127
+ ctx.hooks[idx] = true;
128
+ ctx.pendingEffects.push({
129
+ fn: () => {
130
+ fn();
131
+ },
132
+ deps: void 0,
133
+ cleanup: void 0
134
+ });
135
+ }
136
+ return;
137
+ }
138
+ onMount$1(fn);
139
+ }
140
+ /**
141
+ * Solid-compatible `onCleanup` — registers a callback to run when the component unmounts.
142
+ */
143
+ function onCleanup(fn) {
144
+ const ctx = getCurrentCtx();
145
+ if (ctx) {
146
+ const idx = getHookIndex();
147
+ if (idx >= ctx.hooks.length) {
148
+ ctx.hooks[idx] = true;
149
+ ctx.unmountCallbacks.push(fn);
150
+ }
151
+ return;
152
+ }
153
+ onUnmount(fn);
154
+ }
155
+ function createSelector(source) {
156
+ const ctx = getCurrentCtx();
157
+ if (ctx) {
158
+ const idx = getHookIndex();
159
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = createSelector$1(source);
160
+ return ctx.hooks[idx];
161
+ }
162
+ return createSelector$1(source);
163
+ }
52
164
  function mergeProps(...sources) {
53
165
  const target = {};
54
166
  for (const source of sources) {
@@ -102,25 +214,33 @@ function children(fn) {
102
214
  });
103
215
  }
104
216
  function lazy(loader) {
105
- let resolved = null;
106
- let error = null;
217
+ const loaded = signal(null);
218
+ const error = signal(null);
107
219
  let promise = null;
108
220
  const load = () => {
109
221
  if (!promise) promise = loader().then((mod) => {
110
- resolved = mod.default;
222
+ loaded.set(mod.default);
111
223
  return mod;
112
224
  }).catch((err) => {
113
- error = err instanceof Error ? err : new Error(String(err));
225
+ const e = err instanceof Error ? err : new Error(String(err));
226
+ error.set(e);
114
227
  promise = null;
115
- throw error;
228
+ throw e;
116
229
  });
117
230
  return promise;
118
231
  };
119
232
  const LazyComponent = ((props) => {
120
- if (error) throw error;
121
- if (!resolved) throw load();
122
- return resolved(props);
233
+ const err = error();
234
+ if (err) throw err;
235
+ const comp = loaded();
236
+ if (!comp) return null;
237
+ return comp(props);
123
238
  });
239
+ LazyComponent.__loading = () => {
240
+ const isLoading = loaded() === null && error() === null;
241
+ if (isLoading) load();
242
+ return isLoading;
243
+ };
124
244
  LazyComponent.preload = load;
125
245
  return LazyComponent;
126
246
  }
@@ -138,5 +258,5 @@ function runWithOwner(owner, fn) {
138
258
  }
139
259
 
140
260
  //#endregion
141
- export { ErrorBoundary, For, Match, Show, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, pyreonCreateSelector as createSelector, createSignal, getOwner, lazy, mergeProps, on, pyreonOnUnmount as onCleanup, pyreonOnMount as onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
261
+ export { ErrorBoundary, For, Match, Show, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, createSelector, createSignal, getOwner, lazy, mergeProps, on, onCleanup, onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
142
262
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["pyreonSignal","pyreonComputed"],"sources":["../src/index.ts"],"sourcesContent":["// @pyreon/solid-compat — SolidJS-compatible API shims running on Pyreon's reactive engine\n\nimport type { ComponentFn, Props, VNodeChild } from \"@pyreon/core\"\nimport {\n ErrorBoundary,\n For,\n Match,\n createContext as pyreonCreateContext,\n onMount as pyreonOnMount,\n onUnmount as pyreonOnUnmount,\n useContext as pyreonUseContext,\n Show,\n Suspense,\n Switch,\n} from \"@pyreon/core\"\nimport {\n type EffectScope,\n effectScope,\n getCurrentScope,\n batch as pyreonBatch,\n computed as pyreonComputed,\n createSelector as pyreonCreateSelector,\n effect as pyreonEffect,\n signal as pyreonSignal,\n runUntracked,\n setCurrentScope,\n} from \"@pyreon/reactivity\"\n\n// ─── createSignal ────────────────────────────────────────────────────────────\n\nexport type SignalGetter<T> = () => T\nexport type SignalSetter<T> = (v: T | ((prev: T) => T)) => void\n\nexport function createSignal<T>(initialValue: T): [SignalGetter<T>, SignalSetter<T>] {\n const s = pyreonSignal<T>(initialValue)\n\n const getter: SignalGetter<T> = () => s()\n\n const setter: SignalSetter<T> = (v) => {\n if (typeof v === \"function\") {\n s.update(v as (prev: T) => T)\n } else {\n s.set(v)\n }\n }\n\n return [getter, setter]\n}\n\n// ─── createEffect ────────────────────────────────────────────────────────────\n\nexport function createEffect(fn: () => void): void {\n pyreonEffect(fn)\n}\n\n// ─── createRenderEffect ──────────────────────────────────────────────────────\n\nexport function createRenderEffect(fn: () => void): void {\n pyreonEffect(fn)\n}\n\n// ─── createComputed (legacy Solid API) ───────────────────────────────────────\n\nexport { createEffect as createComputed }\n\n// ─── createMemo ──────────────────────────────────────────────────────────────\n\nexport function createMemo<T>(fn: () => T): () => T {\n const c = pyreonComputed(fn)\n return () => c()\n}\n\n// ─── createRoot ──────────────────────────────────────────────────────────────\n\nexport function createRoot<T>(fn: (dispose: () => void) => T): T {\n const scope = effectScope()\n const prev = getCurrentScope()\n setCurrentScope(scope)\n try {\n return fn(() => scope.stop())\n } finally {\n setCurrentScope(prev)\n }\n}\n\n// ─── on ──────────────────────────────────────────────────────────────────────\n\ntype AccessorArray = readonly (() => unknown)[]\ntype OnEffectFunction<D, V> = (input: D, prevInput: D | undefined, prev: V | undefined) => V\n\nexport function on<S extends (() => unknown) | AccessorArray, V>(\n deps: S,\n fn: OnEffectFunction<\n S extends () => infer R ? R : S extends readonly (() => infer R)[] ? R[] : never,\n V\n >,\n): () => V | undefined {\n type D = S extends () => infer R ? R : S extends readonly (() => infer R)[] ? R[] : never\n\n let prevInput: D | undefined\n let prevValue: V | undefined\n let initialized = false\n\n return () => {\n // Read dependencies to register tracking\n const input: D = (\n Array.isArray(deps) ? (deps as (() => unknown)[]).map((d) => d()) : (deps as () => unknown)()\n ) as D\n\n if (!initialized) {\n initialized = true\n prevValue = fn(input, undefined, undefined)\n prevInput = input\n return prevValue\n }\n\n const result = runUntracked(() => fn(input, prevInput, prevValue))\n prevInput = input\n prevValue = result\n return result\n }\n}\n\n// ─── batch ───────────────────────────────────────────────────────────────────\n\nexport { pyreonBatch as batch }\n\n// ─── untrack ─────────────────────────────────────────────────────────────────\n\nexport { runUntracked as untrack }\n\n// ─── onMount / onCleanup ─────────────────────────────────────────────────────\n\nexport { pyreonOnMount as onMount, pyreonOnUnmount as onCleanup }\n\n// ─── createSelector ──────────────────────────────────────────────────────────\n\nexport { pyreonCreateSelector as createSelector }\n\n// ─── mergeProps ──────────────────────────────────────────────────────────────\n\ntype UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (\n k: infer I,\n) => void\n ? I\n : never\n\ntype MergeProps<T extends object[]> = UnionToIntersection<T[number]>\n\nexport function mergeProps<T extends object[]>(...sources: [...T]): MergeProps<T> {\n const target = {} as Record<PropertyKey, unknown>\n for (const source of sources) {\n const descriptors = Object.getOwnPropertyDescriptors(source)\n for (const key of Reflect.ownKeys(descriptors)) {\n const desc = descriptors[key as string]\n if (!desc) continue\n // Preserve getters for reactivity\n if (desc.get) {\n Object.defineProperty(target, key, {\n get: desc.get,\n enumerable: true,\n configurable: true,\n })\n } else {\n Object.defineProperty(target, key, {\n value: desc.value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n }\n }\n }\n return target as MergeProps<T>\n}\n\n// ─── splitProps ──────────────────────────────────────────────────────────────\n\nexport function splitProps<T extends Record<string, unknown>, 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 Record<string, unknown>\n const keySet = new Set<string>(keys.flat() as string[])\n\n const descriptors = Object.getOwnPropertyDescriptors(props)\n for (const key of Reflect.ownKeys(descriptors)) {\n const desc = descriptors[key as string]\n if (!desc) continue\n const target = typeof key === \"string\" && keySet.has(key) ? picked : rest\n if (desc.get) {\n Object.defineProperty(target, key, {\n get: desc.get,\n enumerable: true,\n configurable: true,\n })\n } else {\n Object.defineProperty(target, key, {\n value: desc.value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n return [picked, rest as Omit<T, K[number]>]\n}\n\n// ─── children ────────────────────────────────────────────────────────────────\n\nexport function children(fn: () => VNodeChild): () => VNodeChild {\n const memo = createMemo(() => {\n const result = fn()\n // Resolve function children (reactive getters)\n if (typeof result === \"function\") return (result as () => VNodeChild)()\n return result\n })\n return memo\n}\n\n// ─── lazy ────────────────────────────────────────────────────────────────────\n\nexport function lazy<P extends Props>(\n loader: () => Promise<{ default: ComponentFn<P> }>,\n): ComponentFn<P> & { preload: () => Promise<{ default: ComponentFn<P> }> } {\n let resolved: ComponentFn<P> | null = null\n let error: Error | null = null\n let promise: Promise<{ default: ComponentFn<P> }> | null = null\n\n const load = () => {\n if (!promise) {\n promise = loader()\n .then((mod) => {\n resolved = mod.default\n return mod\n })\n .catch((err) => {\n error = err instanceof Error ? err : new Error(String(err))\n // Allow retry on next render by resetting the promise\n promise = null\n throw error\n })\n }\n return promise\n }\n\n const LazyComponent = ((props: P) => {\n if (error) throw error\n if (!resolved) {\n // Throw the promise so Suspense can catch it\n throw load()\n }\n return resolved(props)\n }) as ComponentFn<P> & { preload: () => Promise<{ default: ComponentFn<P> }> }\n\n LazyComponent.preload = load\n\n return LazyComponent\n}\n\n// ─── createContext / useContext ───────────────────────────────────────────────\n\nexport { pyreonCreateContext as createContext, pyreonUseContext as useContext }\n\n// ─── getOwner / runWithOwner ─────────────────────────────────────────────────\n\nexport function getOwner(): EffectScope | null {\n return getCurrentScope()\n}\n\nexport function runWithOwner<T>(owner: EffectScope | null, fn: () => T): T {\n const prev = getCurrentScope()\n setCurrentScope(owner)\n try {\n return fn()\n } finally {\n setCurrentScope(prev)\n }\n}\n\n// ─── Re-exports from @pyreon/core ──────────────────────────────────────────────\n\nexport { ErrorBoundary, For, Match, Show, Su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,MAAO,OAAM;AACjB,MAAI,CAAC,SAEH,OAAM,MAAM;AAEd,SAAO,SAAS,MAAM;;AAGxB,eAAc,UAAU;AAExB,QAAO;;AAST,SAAgB,WAA+B;AAC7C,QAAO,iBAAiB;;AAG1B,SAAgB,aAAgB,OAA2B,IAAgB;CACzE,MAAM,OAAO,iBAAiB;AAC9B,iBAAgB,MAAM;AACtB,KAAI;AACF,SAAO,IAAI;WACH;AACR,kBAAgB,KAAK"}
1
+ {"version":3,"file":"index.js","names":["pyreonSignal","pyreonEffect","pyreonComputed","pyreonCreateSelector"],"sources":["../src/jsx-runtime.ts","../src/index.ts"],"sourcesContent":["/**\n * Compat JSX runtime for SolidJS compatibility mode.\n *\n * When `jsxImportSource` is redirected to `@pyreon/solid-compat` (via the vite\n * plugin's `compat: \"solid\"` option), OXC rewrites JSX to import from this file.\n *\n * For component VNodes, we wrap the component function so it returns a reactive\n * accessor — enabling Solid-style re-renders on state change while Pyreon's\n * existing renderer handles all DOM work.\n *\n * The component body runs inside `runUntracked` to prevent signal reads (from\n * createSignal getters) from being tracked by the reactive accessor. Only the\n * version signal triggers re-renders.\n *\n * ## Child instance preservation\n *\n * When a parent component re-renders, mountReactive does a full teardown+rebuild\n * of the DOM tree. Without preservation, child components get brand new\n * RenderContexts with empty hooks arrays — causing `onMount` and `onCleanup`\n * to fire again, which can trigger infinite re-render loops.\n *\n * To fix this, we store child RenderContexts in the parent's hooks array (indexed\n * by the parent's hook counter). When the child wrapper is called again after a\n * parent re-render, it reuses the existing ctx (preserving hooks state), so\n * hook-indexed guards like `if (idx >= ctx.hooks.length) return` work correctly\n * and lifecycle hooks don't re-fire.\n */\n\nimport type { ComponentFn, Props, VNode, VNodeChild } from \"@pyreon/core\"\nimport {\n ErrorBoundary,\n For,\n Fragment,\n h,\n Match,\n onUnmount,\n Show,\n Suspense,\n Switch,\n} from \"@pyreon/core\"\nimport { runUntracked, signal } from \"@pyreon/reactivity\"\n\nexport { Fragment }\n\n// ─── Render context (used by hooks) ──────────────────────────────────────────\n\nexport interface RenderContext {\n hooks: unknown[]\n scheduleRerender: () => void\n /** Effect entries pending execution after render */\n pendingEffects: EffectEntry[]\n /** Layout effect entries pending execution after render */\n pendingLayoutEffects: EffectEntry[]\n /** Set to true when the component is unmounted */\n unmounted: boolean\n /** Callbacks to run on unmount (lifecycle + effect cleanups) */\n unmountCallbacks: (() => void)[]\n}\n\nexport interface EffectEntry {\n // biome-ignore lint/suspicious/noConfusingVoidType: matches Solid's effect signature\n fn: () => (() => void) | void\n deps: unknown[] | undefined\n cleanup: (() => void) | undefined\n}\n\nlet _currentCtx: RenderContext | null = null\nlet _hookIndex = 0\n\nexport function getCurrentCtx(): RenderContext | null {\n return _currentCtx\n}\n\nexport function getHookIndex(): number {\n return _hookIndex++\n}\n\nexport function beginRender(ctx: RenderContext): void {\n _currentCtx = ctx\n _hookIndex = 0\n ctx.pendingEffects = []\n ctx.pendingLayoutEffects = []\n}\n\nexport function endRender(): void {\n _currentCtx = null\n _hookIndex = 0\n}\n\n// ─── Effect runners ──────────────────────────────────────────────────────────\n\nfunction runLayoutEffects(entries: EffectEntry[]): void {\n for (const entry of entries) {\n if (entry.cleanup) entry.cleanup()\n const cleanup = entry.fn()\n entry.cleanup = typeof cleanup === \"function\" ? cleanup : undefined\n }\n}\n\nfunction scheduleEffects(ctx: RenderContext, entries: EffectEntry[]): void {\n if (entries.length === 0) return\n queueMicrotask(() => {\n for (const entry of entries) {\n if (ctx.unmounted) return\n if (entry.cleanup) entry.cleanup()\n const cleanup = entry.fn()\n entry.cleanup = typeof cleanup === \"function\" ? cleanup : undefined\n }\n })\n}\n\n// ─── Child instance preservation ─────────────────────────────────────────────\n\n/** Stored in the parent's hooks array to preserve child state across re-renders */\ninterface ChildInstance {\n ctx: RenderContext\n version: ReturnType<typeof signal<number>>\n updateScheduled: boolean\n}\n\n// Internal prop keys for passing parent context info to child wrappers\nconst _CHILD_INSTANCE = Symbol.for(\"pyreon.childInstance\")\nconst noop = () => {\n /* noop */\n}\n\n// ─── Component wrapping ──────────────────────────────────────────────────────\n\n// biome-ignore lint/complexity/noBannedTypes: Function is needed for generic component wrapping\nconst _wrapperCache = new WeakMap<Function, ComponentFn>()\n\n// Pyreon core components that must NOT be wrapped — they rely on internal reactivity\n// biome-ignore lint/complexity/noBannedTypes: Function is needed for generic component set\nconst _nativeComponents: Set<Function> = new Set([\n Show,\n For,\n Switch,\n Match,\n Suspense,\n ErrorBoundary,\n])\n\n// biome-ignore lint/complexity/noBannedTypes: Function is needed for generic component wrapping\nfunction wrapCompatComponent(solidComponent: Function): ComponentFn {\n if (_nativeComponents.has(solidComponent)) return solidComponent as ComponentFn\n\n let wrapped = _wrapperCache.get(solidComponent)\n if (wrapped) return wrapped\n\n // The wrapper returns a reactive accessor (() => VNodeChild) which Pyreon's\n // mountChild treats as a reactive expression via mountReactive.\n wrapped = ((props: Props) => {\n // Check for a preserved child instance from the parent's hooks\n const existing = (props as Record<symbol, unknown>)[_CHILD_INSTANCE] as\n | ChildInstance\n | undefined\n\n const ctx: RenderContext = existing?.ctx ?? {\n hooks: [],\n scheduleRerender: () => {\n // Will be replaced below after version signal is created\n },\n pendingEffects: [],\n pendingLayoutEffects: [],\n unmounted: false,\n unmountCallbacks: [],\n }\n\n // When reusing an existing ctx after parent re-render, reset unmounted flag\n // and clear stale unmount callbacks (they belong to the previous mount cycle)\n if (existing) {\n ctx.unmounted = false\n ctx.unmountCallbacks = []\n }\n\n const version = existing?.version ?? signal(0)\n\n // Use a shared updateScheduled flag (preserved across parent re-renders)\n let updateScheduled = existing?.updateScheduled ?? false\n\n ctx.scheduleRerender = () => {\n if (ctx.unmounted || updateScheduled) return\n updateScheduled = true\n queueMicrotask(() => {\n updateScheduled = false\n if (!ctx.unmounted) version.set(version.peek() + 1)\n })\n }\n\n // Register cleanup when component unmounts\n onUnmount(() => {\n ctx.unmounted = true\n for (const cb of ctx.unmountCallbacks) cb()\n })\n\n // Strip the internal prop before passing to the component\n const { [_CHILD_INSTANCE]: _stripped, ...cleanProps } = props as Record<\n string | symbol,\n unknown\n >\n\n // Return reactive accessor — Pyreon's mountChild calls mountReactive\n return () => {\n version() // tracked read — triggers re-execution when state changes\n beginRender(ctx)\n // runUntracked prevents signal reads (from createSignal getters) from\n // being tracked by this accessor — only the version signal should trigger re-renders\n const result = runUntracked(() => (solidComponent as ComponentFn)(cleanProps as Props))\n const layoutEffects = ctx.pendingLayoutEffects\n const effects = ctx.pendingEffects\n endRender()\n\n runLayoutEffects(layoutEffects)\n scheduleEffects(ctx, effects)\n\n return result\n }\n }) as unknown as ComponentFn\n\n // Forward __loading from lazy components so Pyreon's Suspense can detect them\n if (\"__loading\" in solidComponent) {\n ;(wrapped as unknown as Record<string, unknown>).__loading = (\n solidComponent as unknown as Record<string, unknown>\n ).__loading\n }\n\n _wrapperCache.set(solidComponent, wrapped)\n return wrapped\n}\n\n// ─── Child instance lookup ───────────────────────────────────────────────────\n\nfunction createChildInstance(): ChildInstance {\n return {\n ctx: {\n hooks: [],\n scheduleRerender: noop,\n pendingEffects: [],\n pendingLayoutEffects: [],\n unmounted: false,\n unmountCallbacks: [],\n },\n version: signal(0),\n updateScheduled: false,\n }\n}\n\n/**\n * During a parent component render, get or create the child instance at the\n * current hook index. Returns undefined when called outside a component render.\n */\nfunction resolveChildInstance(): ChildInstance | undefined {\n const parentCtx = _currentCtx\n if (!parentCtx) return undefined\n\n const idx = _hookIndex++\n if (idx < parentCtx.hooks.length) {\n return parentCtx.hooks[idx] as ChildInstance\n }\n const instance = createChildInstance()\n parentCtx.hooks[idx] = instance\n return instance\n}\n\n// ─── JSX functions ───────────────────────────────────────────────────────────\n\nexport function jsx(\n type: string | ComponentFn | symbol,\n props: Props & { children?: VNodeChild | VNodeChild[] },\n key?: string | number | null,\n): VNode {\n const { children, ...rest } = props\n const propsWithKey = (key != null ? { ...rest, key } : rest) as Props\n\n if (typeof type === \"function\") {\n if (_nativeComponents.has(type)) {\n const componentProps = children !== undefined ? { ...propsWithKey, children } : propsWithKey\n return h(type as ComponentFn, componentProps)\n }\n\n const wrapped = wrapCompatComponent(type)\n const componentProps =\n children !== undefined ? { ...propsWithKey, children } : { ...propsWithKey }\n\n const childInstance = resolveChildInstance()\n if (childInstance) {\n ;(componentProps as Record<symbol, unknown>)[_CHILD_INSTANCE] = childInstance\n }\n\n return h(wrapped, componentProps)\n }\n\n // DOM element or symbol (Fragment): children go in vnode.children\n const childArray = children === undefined ? [] : Array.isArray(children) ? children : [children]\n\n return h(type, propsWithKey, ...(childArray as VNodeChild[]))\n}\n\nexport const jsxs = jsx\nexport const jsxDEV = jsx\n","/**\n * @pyreon/solid-compat\n *\n * Fully SolidJS-compatible API powered by Pyreon's reactive engine.\n *\n * Components re-render on state change via the compat JSX runtime wrapper.\n * Signals use Pyreon's native signal system internally (enabling auto-tracking\n * for createEffect/createMemo), while the component body runs inside\n * `runUntracked` to prevent signal reads from being tracked by the reactive\n * accessor. Only the version signal triggers re-renders.\n *\n * USAGE:\n * import { createSignal, createEffect } from \"solid-js\" // aliased by vite plugin\n */\n\nimport type { ComponentFn, LazyComponent, Props, VNodeChild } from \"@pyreon/core\"\nimport {\n ErrorBoundary,\n For,\n Match,\n createContext as pyreonCreateContext,\n onMount as pyreonOnMount,\n onUnmount as pyreonOnUnmount,\n useContext as pyreonUseContext,\n Show,\n Suspense,\n Switch,\n} from \"@pyreon/core\"\nimport {\n type EffectScope,\n effectScope,\n getCurrentScope,\n batch as pyreonBatch,\n computed as pyreonComputed,\n createSelector as pyreonCreateSelector,\n effect as pyreonEffect,\n signal as pyreonSignal,\n runUntracked,\n setCurrentScope,\n} from \"@pyreon/reactivity\"\nimport { getCurrentCtx, getHookIndex } from \"./jsx-runtime\"\n\n// ─── createSignal ────────────────────────────────────────────────────────────\n\nexport type SignalGetter<T> = () => T\nexport type SignalSetter<T> = (v: T | ((prev: T) => T)) => void\n\nexport function createSignal<T>(initialValue: T): [SignalGetter<T>, SignalSetter<T>] {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx >= ctx.hooks.length) {\n ctx.hooks[idx] = pyreonSignal<T>(initialValue)\n }\n const s = ctx.hooks[idx] as ReturnType<typeof pyreonSignal<T>>\n const { scheduleRerender } = ctx\n\n const getter: SignalGetter<T> = () => s()\n const setter: SignalSetter<T> = (v) => {\n if (typeof v === \"function\") {\n s.update(v as (prev: T) => T)\n } else {\n s.set(v)\n }\n scheduleRerender()\n }\n return [getter, setter]\n }\n\n // Outside component — plain Pyreon signal\n const s = pyreonSignal<T>(initialValue)\n const getter: SignalGetter<T> = () => s()\n const setter: SignalSetter<T> = (v) => {\n if (typeof v === \"function\") {\n s.update(v as (prev: T) => T)\n } else {\n s.set(v)\n }\n }\n return [getter, setter]\n}\n\n// ─── createEffect ────────────────────────────────────────────────────────────\n\n/**\n * Solid-compatible `createEffect` — creates a reactive side effect.\n *\n * In component context: hook-indexed, only created on first render. The effect\n * uses Pyreon's native tracking so signal reads are automatically tracked.\n * A re-entrance guard prevents infinite loops from signal writes inside\n * the effect.\n */\nexport function createEffect(fn: () => void): void {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx < ctx.hooks.length) return // Already registered on first render\n\n let running = false\n const e = pyreonEffect(() => {\n if (running) return\n running = true\n try {\n fn()\n } finally {\n running = false\n }\n })\n const stop = () => e.dispose()\n ctx.hooks[idx] = stop\n ctx.unmountCallbacks.push(stop)\n return\n }\n\n // Outside component\n pyreonEffect(fn)\n}\n\n// ─── createRenderEffect ──────────────────────────────────────────────────────\n\n/**\n * Solid-compatible `createRenderEffect` — same as createEffect.\n * In Solid, this runs during the render phase; here it runs as a Pyreon effect.\n */\nexport function createRenderEffect(fn: () => void): void {\n createEffect(fn)\n}\n\n// ─── createComputed (legacy Solid API) ───────────────────────────────────────\n\nexport { createEffect as createComputed }\n\n// ─── createMemo ──────────────────────────────────────────────────────────────\n\n/**\n * Solid-compatible `createMemo` — derives a value from reactive sources.\n *\n * In component context: hook-indexed, only created on first render.\n * Uses Pyreon's native computed for auto-tracking.\n */\nexport function createMemo<T>(fn: () => T): () => T {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx >= ctx.hooks.length) {\n ctx.hooks[idx] = pyreonComputed(fn)\n }\n const c = ctx.hooks[idx] as ReturnType<typeof pyreonComputed<T>>\n return () => c()\n }\n\n // Outside component\n const c = pyreonComputed(fn)\n return () => c()\n}\n\n// ─── createRoot ──────────────────────────────────────────────────────────────\n\nexport function createRoot<T>(fn: (dispose: () => void) => T): T {\n const scope = effectScope()\n const prev = getCurrentScope()\n setCurrentScope(scope)\n try {\n return fn(() => scope.stop())\n } finally {\n setCurrentScope(prev)\n }\n}\n\n// ─── on ──────────────────────────────────────────────────────────────────────\n\ntype AccessorArray = readonly (() => unknown)[]\ntype OnEffectFunction<D, V> = (input: D, prevInput: D | undefined, prev: V | undefined) => V\n\nexport function on<S extends (() => unknown) | AccessorArray, V>(\n deps: S,\n fn: OnEffectFunction<\n S extends () => infer R ? R : S extends readonly (() => infer R)[] ? R[] : never,\n V\n >,\n): () => V | undefined {\n type D = S extends () => infer R ? R : S extends readonly (() => infer R)[] ? R[] : never\n\n let prevInput: D | undefined\n let prevValue: V | undefined\n let initialized = false\n\n return () => {\n // Read dependencies to register tracking\n const input: D = (\n Array.isArray(deps) ? (deps as (() => unknown)[]).map((d) => d()) : (deps as () => unknown)()\n ) as D\n\n if (!initialized) {\n initialized = true\n prevValue = fn(input, undefined, undefined)\n prevInput = input\n return prevValue\n }\n\n const result = runUntracked(() => fn(input, prevInput, prevValue))\n prevInput = input\n prevValue = result\n return result\n }\n}\n\n// ─── batch ───────────────────────────────────────────────────────────────────\n\nexport { pyreonBatch as batch }\n\n// ─── untrack ─────────────────────────────────────────────────────────────────\n\nexport { runUntracked as untrack }\n\n// ─── onMount / onCleanup ─────────────────────────────────────────────────────\n\n/**\n * Solid-compatible `onMount` — runs once after the component's first render.\n */\ntype CleanupFn = () => void\nexport function onMount(fn: () => CleanupFn | undefined): void {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx >= ctx.hooks.length) {\n ctx.hooks[idx] = true\n ctx.pendingEffects.push({\n fn: () => {\n fn()\n return undefined\n },\n deps: undefined,\n cleanup: undefined,\n })\n }\n return\n }\n\n // Outside component\n pyreonOnMount(fn)\n}\n\n/**\n * Solid-compatible `onCleanup` — registers a callback to run when the component unmounts.\n */\nexport function onCleanup(fn: () => void): void {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx >= ctx.hooks.length) {\n ctx.hooks[idx] = true\n ctx.unmountCallbacks.push(fn)\n }\n return\n }\n\n // Outside component\n pyreonOnUnmount(fn)\n}\n\n// ─── createSelector ──────────────────────────────────────────────────────────\n\nexport function createSelector<T>(source: () => T): (key: T) => boolean {\n const ctx = getCurrentCtx()\n if (ctx) {\n const idx = getHookIndex()\n if (idx >= ctx.hooks.length) {\n ctx.hooks[idx] = pyreonCreateSelector(source)\n }\n return ctx.hooks[idx] as (key: T) => boolean\n }\n\n return pyreonCreateSelector(source)\n}\n\n// ─── mergeProps ──────────────────────────────────────────────────────────────\n\ntype UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (\n k: infer I,\n) => void\n ? I\n : never\n\ntype MergeProps<T extends object[]> = UnionToIntersection<T[number]>\n\nexport function mergeProps<T extends object[]>(...sources: [...T]): MergeProps<T> {\n const target = {} as Record<PropertyKey, unknown>\n for (const source of sources) {\n const descriptors = Object.getOwnPropertyDescriptors(source)\n for (const key of Reflect.ownKeys(descriptors)) {\n const desc = descriptors[key as string]\n if (!desc) continue\n // Preserve getters for reactivity\n if (desc.get) {\n Object.defineProperty(target, key, {\n get: desc.get,\n enumerable: true,\n configurable: true,\n })\n } else {\n Object.defineProperty(target, key, {\n value: desc.value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n }\n }\n }\n return target as MergeProps<T>\n}\n\n// ─── splitProps ──────────────────────────────────────────────────────────────\n\nexport function splitProps<T extends Record<string, unknown>, 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 Record<string, unknown>\n const keySet = new Set<string>(keys.flat() as string[])\n\n const descriptors = Object.getOwnPropertyDescriptors(props)\n for (const key of Reflect.ownKeys(descriptors)) {\n const desc = descriptors[key as string]\n if (!desc) continue\n const target = typeof key === \"string\" && keySet.has(key) ? picked : rest\n if (desc.get) {\n Object.defineProperty(target, key, {\n get: desc.get,\n enumerable: true,\n configurable: true,\n })\n } else {\n Object.defineProperty(target, key, {\n value: desc.value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n return [picked, rest as Omit<T, K[number]>]\n}\n\n// ─── children ────────────────────────────────────────────────────────────────\n\nexport function children(fn: () => VNodeChild): () => VNodeChild {\n const memo = createMemo(() => {\n const result = fn()\n // Resolve function children (reactive getters)\n if (typeof result === \"function\") return (result as () => VNodeChild)()\n return result\n })\n return memo\n}\n\n// ─── lazy ────────────────────────────────────────────────────────────────────\n\nexport function lazy<P extends Props>(\n loader: () => Promise<{ default: ComponentFn<P> }>,\n): LazyComponent<P> & { preload: () => Promise<{ default: ComponentFn<P> }> } {\n const loaded = pyreonSignal<ComponentFn<P> | null>(null)\n const error = pyreonSignal<Error | null>(null)\n let promise: Promise<{ default: ComponentFn<P> }> | null = null\n\n const load = () => {\n if (!promise) {\n promise = loader()\n .then((mod) => {\n loaded.set(mod.default)\n return mod\n })\n .catch((err) => {\n const e = err instanceof Error ? err : new Error(String(err))\n error.set(e)\n promise = null\n throw e\n })\n }\n return promise\n }\n\n // Uses Pyreon's __loading protocol — Suspense checks this to show fallback.\n // __loading() triggers load() on first call so loading starts when Suspense\n // first encounters the component (not at module load time, not on first render).\n const LazyComponent = ((props: P) => {\n const err = error()\n if (err) throw err\n const comp = loaded()\n if (!comp) return null\n return comp(props)\n }) as LazyComponent<P> & { preload: () => Promise<{ default: ComponentFn<P> }> }\n\n LazyComponent.__loading = () => {\n const isLoading = loaded() === null && error() === null\n if (isLoading) load()\n return isLoading\n }\n LazyComponent.preload = load\n\n return LazyComponent\n}\n\n// ─── createContext / useContext ───────────────────────────────────────────────\n\nexport { pyreonCreateContext as createContext, pyreonUseContext as useContext }\n\n// ─── getOwner / runWithOwner ─────────────────────────────────────────────────\n\nexport function getOwner(): EffectScope | null {\n return getCurrentScope()\n}\n\nexport function runWithOwner<T>(owner: EffectScope | null, fn: () => T): T {\n const prev = getCurrentScope()\n setCurrentScope(owner)\n try {\n return fn()\n } finally {\n setCurrentScope(prev)\n }\n}\n\n// ─── Re-exports from @pyreon/core ──────────────────────────────────────────────\n\nexport { ErrorBoundary, For, Match, Show, Suspense, Switch }\n"],"mappings":";;;;AAkEA,IAAI,cAAoC;AACxC,IAAI,aAAa;AAEjB,SAAgB,gBAAsC;AACpD,QAAO;;AAGT,SAAgB,eAAuB;AACrC,QAAO;;AA+CT,MAAM,kBAAkB,OAAO,IAAI,uBAAuB;;;;AC1E1D,SAAgB,aAAgB,cAAqD;CACnF,MAAM,MAAM,eAAe;AAC3B,KAAI,KAAK;EACP,MAAM,MAAM,cAAc;AAC1B,MAAI,OAAO,IAAI,MAAM,OACnB,KAAI,MAAM,OAAOA,OAAgB,aAAa;EAEhD,MAAM,IAAI,IAAI,MAAM;EACpB,MAAM,EAAE,qBAAqB;EAE7B,MAAM,eAAgC,GAAG;EACzC,MAAM,UAA2B,MAAM;AACrC,OAAI,OAAO,MAAM,WACf,GAAE,OAAO,EAAoB;OAE7B,GAAE,IAAI,EAAE;AAEV,qBAAkB;;AAEpB,SAAO,CAAC,QAAQ,OAAO;;CAIzB,MAAM,IAAIA,OAAgB,aAAa;CACvC,MAAM,eAAgC,GAAG;CACzC,MAAM,UAA2B,MAAM;AACrC,MAAI,OAAO,MAAM,WACf,GAAE,OAAO,EAAoB;MAE7B,GAAE,IAAI,EAAE;;AAGZ,QAAO,CAAC,QAAQ,OAAO;;;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,QAAQ,OAAO,KAAK;AACnD,MAAI,UAAW,OAAM;AACrB,SAAO;;AAET,eAAc,UAAU;AAExB,QAAO;;AAST,SAAgB,WAA+B;AAC7C,QAAO,iBAAiB;;AAG1B,SAAgB,aAAgB,OAA2B,IAAgB;CACzE,MAAM,OAAO,iBAAiB;AAC9B,iBAAgB,MAAM;AACtB,KAAI;AACF,SAAO,IAAI;WACH;AACR,kBAAgB,KAAK"}
@@ -1,8 +1,32 @@
1
- import { ErrorBoundary, For, Match, Show, Suspense, Switch, createContext as pyreonCreateContext, onMount as pyreonOnMount, onUnmount as pyreonOnUnmount, useContext as pyreonUseContext } from "@pyreon/core";
2
- import { batch as pyreonBatch, computed, createSelector as pyreonCreateSelector, effect, effectScope, getCurrentScope, runUntracked, setCurrentScope, signal } from "@pyreon/reactivity";
1
+ import { ErrorBoundary, For, Match, Show, Suspense, Switch, createContext as pyreonCreateContext, onMount as onMount$1, onUnmount, useContext as pyreonUseContext } from "@pyreon/core";
2
+ import { batch as pyreonBatch, computed, createSelector as createSelector$1, effect, effectScope, getCurrentScope, runUntracked, setCurrentScope, signal } from "@pyreon/reactivity";
3
3
 
4
+ //#region src/jsx-runtime.ts
5
+
6
+ function getCurrentCtx() {
7
+ return _currentCtx;
8
+ }
9
+ function getHookIndex() {
10
+ return _hookIndex++;
11
+ }
12
+ //#endregion
4
13
  //#region src/index.ts
5
14
  function createSignal(initialValue) {
15
+ const ctx = getCurrentCtx();
16
+ if (ctx) {
17
+ const idx = getHookIndex();
18
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = signal(initialValue);
19
+ const s = ctx.hooks[idx];
20
+ const {
21
+ scheduleRerender
22
+ } = ctx;
23
+ const getter = () => s();
24
+ const setter = v => {
25
+ if (typeof v === "function") s.update(v);else s.set(v);
26
+ scheduleRerender();
27
+ };
28
+ return [getter, setter];
29
+ }
6
30
  const s = signal(initialValue);
7
31
  const getter = () => s();
8
32
  const setter = v => {
@@ -10,13 +34,57 @@ function createSignal(initialValue) {
10
34
  };
11
35
  return [getter, setter];
12
36
  }
37
+ /**
38
+ * Solid-compatible `createEffect` — creates a reactive side effect.
39
+ *
40
+ * In component context: hook-indexed, only created on first render. The effect
41
+ * uses Pyreon's native tracking so signal reads are automatically tracked.
42
+ * A re-entrance guard prevents infinite loops from signal writes inside
43
+ * the effect.
44
+ */
13
45
  function createEffect(fn) {
46
+ const ctx = getCurrentCtx();
47
+ if (ctx) {
48
+ const idx = getHookIndex();
49
+ if (idx < ctx.hooks.length) return;
50
+ let running = false;
51
+ const e = effect(() => {
52
+ if (running) return;
53
+ running = true;
54
+ try {
55
+ fn();
56
+ } finally {
57
+ running = false;
58
+ }
59
+ });
60
+ const stop = () => e.dispose();
61
+ ctx.hooks[idx] = stop;
62
+ ctx.unmountCallbacks.push(stop);
63
+ return;
64
+ }
14
65
  effect(fn);
15
66
  }
67
+ /**
68
+ * Solid-compatible `createRenderEffect` — same as createEffect.
69
+ * In Solid, this runs during the render phase; here it runs as a Pyreon effect.
70
+ */
16
71
  function createRenderEffect(fn) {
17
- effect(fn);
72
+ createEffect(fn);
18
73
  }
74
+ /**
75
+ * Solid-compatible `createMemo` — derives a value from reactive sources.
76
+ *
77
+ * In component context: hook-indexed, only created on first render.
78
+ * Uses Pyreon's native computed for auto-tracking.
79
+ */
19
80
  function createMemo(fn) {
81
+ const ctx = getCurrentCtx();
82
+ if (ctx) {
83
+ const idx = getHookIndex();
84
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = computed(fn);
85
+ const c = ctx.hooks[idx];
86
+ return () => c();
87
+ }
20
88
  const c = computed(fn);
21
89
  return () => c();
22
90
  }
@@ -48,6 +116,48 @@ function on(deps, fn) {
48
116
  return result;
49
117
  };
50
118
  }
119
+ function onMount(fn) {
120
+ const ctx = getCurrentCtx();
121
+ if (ctx) {
122
+ const idx = getHookIndex();
123
+ if (idx >= ctx.hooks.length) {
124
+ ctx.hooks[idx] = true;
125
+ ctx.pendingEffects.push({
126
+ fn: () => {
127
+ fn();
128
+ },
129
+ deps: void 0,
130
+ cleanup: void 0
131
+ });
132
+ }
133
+ return;
134
+ }
135
+ onMount$1(fn);
136
+ }
137
+ /**
138
+ * Solid-compatible `onCleanup` — registers a callback to run when the component unmounts.
139
+ */
140
+ function onCleanup(fn) {
141
+ const ctx = getCurrentCtx();
142
+ if (ctx) {
143
+ const idx = getHookIndex();
144
+ if (idx >= ctx.hooks.length) {
145
+ ctx.hooks[idx] = true;
146
+ ctx.unmountCallbacks.push(fn);
147
+ }
148
+ return;
149
+ }
150
+ onUnmount(fn);
151
+ }
152
+ function createSelector(source) {
153
+ const ctx = getCurrentCtx();
154
+ if (ctx) {
155
+ const idx = getHookIndex();
156
+ if (idx >= ctx.hooks.length) ctx.hooks[idx] = createSelector$1(source);
157
+ return ctx.hooks[idx];
158
+ }
159
+ return createSelector$1(source);
160
+ }
51
161
  function mergeProps(...sources) {
52
162
  const target = {};
53
163
  for (const source of sources) {
@@ -99,24 +209,32 @@ function children(fn) {
99
209
  });
100
210
  }
101
211
  function lazy(loader) {
102
- let resolved = null;
103
- let error = null;
212
+ const loaded = signal(null);
213
+ const error = signal(null);
104
214
  let promise = null;
105
215
  const load = () => {
106
216
  if (!promise) promise = loader().then(mod => {
107
- resolved = mod.default;
217
+ loaded.set(mod.default);
108
218
  return mod;
109
219
  }).catch(err => {
110
- error = err instanceof Error ? err : new Error(String(err));
220
+ const e = err instanceof Error ? err : new Error(String(err));
221
+ error.set(e);
111
222
  promise = null;
112
- throw error;
223
+ throw e;
113
224
  });
114
225
  return promise;
115
226
  };
116
227
  const LazyComponent = props => {
117
- if (error) throw error;
118
- if (!resolved) throw load();
119
- return resolved(props);
228
+ const err = error();
229
+ if (err) throw err;
230
+ const comp = loaded();
231
+ if (!comp) return null;
232
+ return comp(props);
233
+ };
234
+ LazyComponent.__loading = () => {
235
+ const isLoading = loaded() === null && error() === null;
236
+ if (isLoading) load();
237
+ return isLoading;
120
238
  };
121
239
  LazyComponent.preload = load;
122
240
  return LazyComponent;
@@ -135,5 +253,5 @@ function runWithOwner(owner, fn) {
135
253
  }
136
254
 
137
255
  //#endregion
138
- export { ErrorBoundary, For, Match, Show, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, pyreonCreateSelector as createSelector, createSignal, getOwner, lazy, mergeProps, on, pyreonOnUnmount as onCleanup, pyreonOnMount as onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
256
+ export { ErrorBoundary, For, Match, Show, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, createSelector, createSignal, getOwner, lazy, mergeProps, on, onCleanup, onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
139
257
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["pyreonSignal","pyreonComputed"],"sources":["../../src/index.ts"],"mappings":";;;;AAiCA,SAAgB,YAAA,CAAgB,YAAA,EAAqD;EACnF,MAAM,CAAA,GAAIA,MAAAA,CAAgB,YAAA,CAAa;EAEvC,MAAM,MAAA,GAAA,CAAA,KAAgC,CAAA,CAAA,CAAG;EAEzC,MAAM,MAAA,GAA2B,CAAA,IAAM;IACrC,IAAI,OAAO,CAAA,KAAM,UAAA,EACf,CAAA,CAAE,MAAA,CAAO,CAAA,CAAoB,CAAA,KAE7B,CAAA,CAAE,GAAA,CAAI,CAAA,CAAE;;EAIZ,OAAO,CAAC,MAAA,EAAQ,MAAA,CAAO;;AAKzB,SAAgB,YAAA,CAAa,EAAA,EAAsB;EACjD,MAAA,CAAa,EAAA,CAAG;;AAKlB,SAAgB,kBAAA,CAAmB,EAAA,EAAsB;EACvD,MAAA,CAAa,EAAA,CAAG;;AASlB,SAAgB,UAAA,CAAc,EAAA,EAAsB;EAClD,MAAM,CAAA,GAAIC,QAAAA,CAAe,EAAA,CAAG;EAC5B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,eAAA,CAAgB,KAAA,CAAM;EACtB,IAAI;IACF,OAAO,EAAA,CAAA,CAAI;YACH;IACR,eAAA,CAAgB,IAAA,CAAK"}
1
+ {"version":3,"file":"index.d.ts","names":["pyreonSignal","pyreonEffect","pyreonComputed","pyreonCreateSelector"],"sources":["../../src/jsx-runtime.ts","../../src/index.ts"],"mappings":";;;;;AAqEA,SAAgB,aAAA,CAAA,EAAsC;EACpD,OAAO,WAAA;;AAGT,SAAgB,YAAA,CAAA,EAAuB;EACrC,OAAO,UAAA,EAAA;;;;AC3BT,SAAgB,YAAA,CAAgB,YAAA,EAAqD;EACnF,MAAM,GAAA,GAAM,aAAA,CAAA,CAAe;EAC3B,IAAI,GAAA,EAAK;IACP,MAAM,GAAA,GAAM,YAAA,CAAA,CAAc;IAC1B,IAAI,GAAA,IAAO,GAAA,CAAI,KAAA,CAAM,MAAA,EACnB,GAAA,CAAI,KAAA,CAAM,GAAA,CAAA,GAAOA,MAAAA,CAAgB,YAAA,CAAa;IAEhD,MAAM,CAAA,GAAI,GAAA,CAAI,KAAA,CAAM,GAAA,CAAA;IACpB,MAAM;MAAE;IAAA,CAAA,GAAqB,GAAA;IAE7B,MAAM,MAAA,GAAA,CAAA,KAAgC,CAAA,CAAA,CAAG;IACzC,MAAM,MAAA,GAA2B,CAAA,IAAM;MACrC,IAAI,OAAO,CAAA,KAAM,UAAA,EACf,CAAA,CAAE,MAAA,CAAO,CAAA,CAAoB,CAAA,KAE7B,CAAA,CAAE,GAAA,CAAI,CAAA,CAAE;MAEV,gBAAA,CAAA,CAAkB;;IAEpB,OAAO,CAAC,MAAA,EAAQ,MAAA,CAAO;;EAIzB,MAAM,CAAA,GAAIA,MAAAA,CAAgB,YAAA,CAAa;EACvC,MAAM,MAAA,GAAA,CAAA,KAAgC,CAAA,CAAA,CAAG;EACzC,MAAM,MAAA,GAA2B,CAAA,IAAM;IACrC,IAAI,OAAO,CAAA,KAAM,UAAA,EACf,CAAA,CAAE,MAAA,CAAO,CAA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B,MAAM,SAAA,GAAY,MAAA,CAAA,CAAQ,KAAK,IAAA,IAAQ,KAAA,CAAA,CAAO,KAAK,IAAA;IACnD,IAAI,SAAA,EAAW,IAAA,CAAA,CAAM;IACrB,OAAO,SAAA;;EAET,aAAA,CAAc,OAAA,GAAU,IAAA;EAExB,OAAO,aAAA;;AAST,SAAgB,QAAA,CAAA,EAA+B;EAC7C,OAAO,eAAA,CAAA,CAAiB;;AAG1B,SAAgB,YAAA,CAAgB,KAAA,EAA2B,EAAA,EAAgB;EACzE,MAAM,IAAA,GAAO,eAAA,CAAA,CAAiB;EAC9B,eAAA,CAAgB,KAAA,CAAM;EACtB,IAAI;IACF,OAAO,EAAA,CAAA,CAAI;YACH;IACR,eAAA,CAAgB,IAAA,CAAK"}
@@ -1,17 +1,45 @@
1
- import { ComponentFn, ErrorBoundary, For, Match, Props, Show, Suspense, Switch, VNodeChild, createContext as pyreonCreateContext, onMount as pyreonOnMount, onUnmount as pyreonOnUnmount, useContext as pyreonUseContext } from "@pyreon/core";
2
- import { EffectScope, batch as pyreonBatch, createSelector as pyreonCreateSelector, runUntracked } from "@pyreon/reactivity";
1
+ import { ComponentFn, ErrorBoundary, For, LazyComponent, Match, Props, Show, Suspense, Switch, VNodeChild, createContext as pyreonCreateContext, useContext as pyreonUseContext } from "@pyreon/core";
2
+ import { EffectScope, batch as pyreonBatch, runUntracked } from "@pyreon/reactivity";
3
3
 
4
4
  //#region src/index.d.ts
5
5
  type SignalGetter<T> = () => T;
6
6
  type SignalSetter<T> = (v: T | ((prev: T) => T)) => void;
7
7
  declare function createSignal<T>(initialValue: T): [SignalGetter<T>, SignalSetter<T>];
8
+ /**
9
+ * Solid-compatible `createEffect` — creates a reactive side effect.
10
+ *
11
+ * In component context: hook-indexed, only created on first render. The effect
12
+ * uses Pyreon's native tracking so signal reads are automatically tracked.
13
+ * A re-entrance guard prevents infinite loops from signal writes inside
14
+ * the effect.
15
+ */
8
16
  declare function createEffect(fn: () => void): void;
17
+ /**
18
+ * Solid-compatible `createRenderEffect` — same as createEffect.
19
+ * In Solid, this runs during the render phase; here it runs as a Pyreon effect.
20
+ */
9
21
  declare function createRenderEffect(fn: () => void): void;
22
+ /**
23
+ * Solid-compatible `createMemo` — derives a value from reactive sources.
24
+ *
25
+ * In component context: hook-indexed, only created on first render.
26
+ * Uses Pyreon's native computed for auto-tracking.
27
+ */
10
28
  declare function createMemo<T>(fn: () => T): () => T;
11
29
  declare function createRoot<T>(fn: (dispose: () => void) => T): T;
12
30
  type AccessorArray = readonly (() => unknown)[];
13
31
  type OnEffectFunction<D, V> = (input: D, prevInput: D | undefined, prev: V | undefined) => V;
14
32
  declare function on<S extends (() => unknown) | AccessorArray, V>(deps: S, fn: OnEffectFunction<S extends (() => infer R) ? R : S extends readonly (() => infer R)[] ? R[] : never, V>): () => V | undefined;
33
+ /**
34
+ * Solid-compatible `onMount` — runs once after the component's first render.
35
+ */
36
+ type CleanupFn = () => void;
37
+ declare function onMount(fn: () => CleanupFn | undefined): void;
38
+ /**
39
+ * Solid-compatible `onCleanup` — registers a callback to run when the component unmounts.
40
+ */
41
+ declare function onCleanup(fn: () => void): void;
42
+ declare function createSelector<T>(source: () => T): (key: T) => boolean;
15
43
  type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
16
44
  type MergeProps<T extends object[]> = UnionToIntersection<T[number]>;
17
45
  declare function mergeProps<T extends object[]>(...sources: [...T]): MergeProps<T>;
@@ -19,7 +47,7 @@ declare function splitProps<T extends Record<string, unknown>, K extends (keyof
19
47
  declare function children(fn: () => VNodeChild): () => VNodeChild;
20
48
  declare function lazy<P extends Props>(loader: () => Promise<{
21
49
  default: ComponentFn<P>;
22
- }>): ComponentFn<P> & {
50
+ }>): LazyComponent<P> & {
23
51
  preload: () => Promise<{
24
52
  default: ComponentFn<P>;
25
53
  }>;
@@ -27,5 +55,5 @@ declare function lazy<P extends Props>(loader: () => Promise<{
27
55
  declare function getOwner(): EffectScope | null;
28
56
  declare function runWithOwner<T>(owner: EffectScope | null, fn: () => T): T;
29
57
  //#endregion
30
- export { ErrorBoundary, For, Match, Show, SignalGetter, SignalSetter, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, pyreonCreateSelector as createSelector, createSignal, getOwner, lazy, mergeProps, on, pyreonOnUnmount as onCleanup, pyreonOnMount as onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
58
+ export { ErrorBoundary, For, Match, Show, SignalGetter, SignalSetter, Suspense, Switch, pyreonBatch as batch, children, createEffect as createComputed, createEffect, pyreonCreateContext as createContext, createMemo, createRenderEffect, createRoot, createSelector, createSignal, getOwner, lazy, mergeProps, on, onCleanup, onMount, runWithOwner, splitProps, runUntracked as untrack, pyreonUseContext as useContext };
31
59
  //# sourceMappingURL=index2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index2.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;KA8BY,YAAA,YAAwB,CAAA;AAAA,KACxB,YAAA,OAAmB,CAAA,EAAG,CAAA,KAAM,IAAA,EAAM,CAAA,KAAM,CAAA;AAAA,iBAEpC,YAAA,GAAA,CAAgB,YAAA,EAAc,CAAA,IAAK,YAAA,CAAa,CAAA,GAAI,YAAA,CAAa,CAAA;AAAA,iBAkBjE,YAAA,CAAa,EAAA;AAAA,iBAMb,kBAAA,CAAmB,EAAA;AAAA,iBAUnB,UAAA,GAAA,CAAc,EAAA,QAAU,CAAA,SAAU,CAAA;AAAA,iBAOlC,UAAA,GAAA,CAAc,EAAA,GAAK,OAAA,iBAAwB,CAAA,GAAI,CAAA;AAAA,KAa1D,aAAA;AAAA,KACA,gBAAA,UAA0B,KAAA,EAAO,CAAA,EAAG,SAAA,EAAW,CAAA,cAAe,IAAA,EAAM,CAAA,iBAAkB,CAAA;AAAA,iBAE3E,EAAA,6BAA+B,aAAA,IAAA,CAC7C,IAAA,EAAM,C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A,EAAS,WAAA,CAAY,CAAA;EAAA;AAAA;AAAA,iBAiDtD,QAAA,CAAA,GAAY,WAAA;AAAA,iBAIZ,YAAA,GAAA,CAAgB,KAAA,EAAO,WAAA,SAAoB,EAAA,QAAU,CAAA,GAAI,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/solid-compat",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "SolidJS-compatible API shim for Pyreon — write Solid-style code that runs on Pyreon's reactive engine",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,16 @@
28
28
  "bun": "./src/index.ts",
29
29
  "import": "./lib/index.js",
30
30
  "types": "./lib/types/index.d.ts"
31
+ },
32
+ "./jsx-runtime": {
33
+ "bun": "./src/jsx-runtime.ts",
34
+ "import": "./lib/jsx-runtime.js",
35
+ "types": "./lib/types/jsx-runtime.d.ts"
36
+ },
37
+ "./jsx-dev-runtime": {
38
+ "bun": "./src/jsx-runtime.ts",
39
+ "import": "./lib/jsx-runtime.js",
40
+ "types": "./lib/types/jsx-runtime.d.ts"
31
41
  }
32
42
  },
33
43
  "scripts": {
@@ -39,9 +49,9 @@
39
49
  "prepublishOnly": "bun run build"
40
50
  },
41
51
  "dependencies": {
42
- "@pyreon/core": "^0.2.1",
43
- "@pyreon/reactivity": "^0.2.1",
44
- "@pyreon/runtime-dom": "^0.2.1"
52
+ "@pyreon/core": "^0.3.0",
53
+ "@pyreon/reactivity": "^0.3.0",
54
+ "@pyreon/runtime-dom": "^0.3.0"
45
55
  },
46
56
  "devDependencies": {
47
57
  "@happy-dom/global-registrator": "^20.8.3",