octane 0.2.2 → 0.2.3

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.
Files changed (50) hide show
  1. package/dist/cjs/compatibility.cjs +35 -0
  2. package/dist/cjs/component-flags.cjs +8 -1
  3. package/dist/cjs/dom-tables.cjs +2 -0
  4. package/dist/cjs/error-codes.client.generated.cjs +15 -2
  5. package/dist/cjs/error-codes.server.generated.cjs +5 -0
  6. package/dist/cjs/event-names.cjs +39 -0
  7. package/dist/cjs/index.cjs +13 -0
  8. package/dist/cjs/runtime.cjs +1223 -332
  9. package/dist/cjs/runtime.server.cjs +362 -120
  10. package/dist/cjs/server/index.cjs +22 -0
  11. package/dist/cjs/version.cjs +1 -1
  12. package/dist/compatibility.d.ts +7 -0
  13. package/dist/compatibility.js +10 -0
  14. package/dist/compiler/bundler.js +13 -30
  15. package/dist/compiler/compile-renderer-boundaries.js +1 -0
  16. package/dist/compiler/compile-universal.js +3 -0
  17. package/dist/compiler/compile.js +619 -99
  18. package/dist/compiler/hook-deps.js +100 -3
  19. package/dist/compiler/hook-names.js +1 -0
  20. package/dist/compiler/manual-hooks.js +171 -0
  21. package/dist/compiler/plain-hook-memo.js +54 -5
  22. package/dist/compiler/slot-hooks.d.ts +43 -0
  23. package/dist/compiler/slot-hooks.js +154 -35
  24. package/dist/component-flags.d.ts +1 -1
  25. package/dist/component-flags.js +8 -1
  26. package/dist/dom-tables.js +2 -0
  27. package/dist/error-codes.client.generated.d.ts +3 -1
  28. package/dist/error-codes.client.generated.js +15 -2
  29. package/dist/error-codes.server.generated.d.ts +1 -0
  30. package/dist/error-codes.server.generated.js +5 -0
  31. package/dist/event-names.d.ts +1 -0
  32. package/dist/event-names.js +15 -0
  33. package/dist/html-tree-validation.d.ts +17 -34
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.js +12 -1
  36. package/dist/jsx-runtime.d.ts +6 -1
  37. package/dist/public-types.d.ts +188 -0
  38. package/dist/public-types.js +0 -0
  39. package/dist/runtime.d.ts +109 -66
  40. package/dist/runtime.js +1220 -332
  41. package/dist/runtime.server.d.ts +39 -14
  42. package/dist/runtime.server.js +356 -120
  43. package/dist/server/index.d.ts +4 -2
  44. package/dist/server/index.js +19 -0
  45. package/dist/static/index.d.ts +2 -1
  46. package/dist/static/index.js +3 -1
  47. package/dist/universal-core.d.ts +8 -1
  48. package/dist/universal-core.js +95 -9
  49. package/dist/version.js +1 -1
  50. package/package.json +2 -1
@@ -53,6 +53,10 @@ import type { ElementDescriptor, FragmentInstance } from './index.js';
53
53
  */
54
54
  export interface OctaneElement<P = any> extends ElementDescriptor<P> {}
55
55
 
56
+ export interface CSSProperties extends React.CSSProperties {
57
+ cssFloat?: React.CSSProperties['float'];
58
+ }
59
+
56
60
  export type ClassValue =
57
61
  | string
58
62
  | number
@@ -135,7 +139,7 @@ type Transformed<P, T> = Omit<P, ReactSyntheticProps | 'className' | 'style' | '
135
139
  className?: ClassValue;
136
140
  for?: string;
137
141
  xmlns?: string;
138
- style?: string | React.CSSProperties;
142
+ style?: string | CSSProperties;
139
143
  children?: unknown;
140
144
  };
141
145
 
@@ -177,6 +181,7 @@ declare namespace Octane {
177
181
  interface FieldsetHTMLAttributes<T> extends Transformed<React.FieldsetHTMLAttributes<T>, T> {}
178
182
  interface FormHTMLAttributes<T> extends Transformed<React.FormHTMLAttributes<T>, T> {}
179
183
  interface HTMLAttributes<T> extends Transformed<React.HTMLAttributes<T>, T> {}
184
+ interface AllHTMLAttributes<T> extends Transformed<React.AllHTMLAttributes<T>, T> {}
180
185
  interface HtmlHTMLAttributes<T> extends Transformed<React.HtmlHTMLAttributes<T>, T> {}
181
186
  interface IframeHTMLAttributes<T> extends Transformed<React.IframeHTMLAttributes<T>, T> {}
182
187
  interface ImgHTMLAttributes<T> extends Transformed<React.ImgHTMLAttributes<T>, T> {}
@@ -0,0 +1,188 @@
1
+ /** React-shaped type names describing Octane values and native DOM events. */
2
+ import type * as React from 'react';
3
+ import type { Octane } from './jsx-runtime.js';
4
+ import type { Activity, Context, ElementDescriptor, OctaneNode, PortalDescriptor, Suspense } from './runtime.js';
5
+ export type { JSX, Octane, OctaneElement, ClassValue, CSSProperties } from './jsx-runtime.js';
6
+ /** Migration alias. New Octane code should use OctaneNode. */
7
+ export type ReactNode = OctaneNode;
8
+ export type ReactElement<P = any, T extends ElementDescriptor<P>['type'] = ElementDescriptor<P>['type']> = ElementDescriptor<P> & {
9
+ type: T;
10
+ };
11
+ export type ReactPortal = PortalDescriptor;
12
+ export type FunctionComponentElement<P> = ReactElement<P, FunctionComponent<P>>;
13
+ export type DOMElement<P, T extends Element> = ReactElement<P, string> & {
14
+ ref?: Ref<T>;
15
+ };
16
+ export type DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> = DOMElement<P, T>;
17
+ export type ReactHTMLElement<T extends HTMLElement> = DetailedReactHTMLElement<AllHTMLAttributes<T>, T>;
18
+ export type ReactSVGElement = DOMElement<SVGAttributes<SVGElement>, SVGElement>;
19
+ export type Key = Octane.Key;
20
+ export type Ref<T> = Octane.Ref<T>;
21
+ export type RefCallback<T> = React.RefCallback<T>;
22
+ export interface RefObject<T> {
23
+ current: T;
24
+ }
25
+ export interface MutableRefObject<T> {
26
+ current: T;
27
+ }
28
+ export type Attributes = Octane.Attributes;
29
+ export type RefAttributes<T> = Octane.RefAttributes<T>;
30
+ export type PropsWithChildren<P = unknown> = P & {
31
+ children?: OctaneNode;
32
+ };
33
+ export type PropsWithoutRef<P> = P extends unknown ? 'ref' extends keyof P ? Omit<P, 'ref'> : P : P;
34
+ export type PropsWithRef<P> = P;
35
+ export type SetStateAction<S> = S | ((previous: S) => S);
36
+ export type Dispatch<A> = (value: A) => void;
37
+ export type DispatchWithoutAction = () => void;
38
+ export type DependencyList = readonly unknown[];
39
+ export type EffectCallback = () => void | (() => void);
40
+ export type Destructor = () => void;
41
+ export type Reducer<S, A> = (state: S, action: A) => S;
42
+ export type ReducerWithoutAction<S> = (state: S) => S;
43
+ export type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
44
+ export type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;
45
+ export type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> = R extends ReducerWithoutAction<infer S> ? S : never;
46
+ export interface FunctionComponent<P = {}> {
47
+ (props: P): OctaneNode;
48
+ displayName?: string;
49
+ }
50
+ export type FC<P = {}> = FunctionComponent<P>;
51
+ export type ComponentType<P = {}> = FunctionComponent<P>;
52
+ /** Octane boundary and memo wrappers are callable components, without React branding. */
53
+ export type ExoticComponent<P = {}> = FunctionComponent<P>;
54
+ export type NamedExoticComponent<P = {}> = FunctionComponent<P>;
55
+ export type MemoExoticComponent<T extends ComponentType<any>> = FunctionComponent<ComponentProps<T>> & {
56
+ readonly type: T;
57
+ };
58
+ export type LazyExoticComponent<T extends ComponentType<any>> = FunctionComponent<ComponentProps<T>>;
59
+ export type JSXElementConstructor<P> = (props: P, ...args: any[]) => OctaneNode;
60
+ export type ElementType<P = any, Tag extends keyof Octane.JSX.IntrinsicElements = keyof Octane.JSX.IntrinsicElements> = {
61
+ [K in Tag]: P extends Octane.JSX.IntrinsicElements[K] ? K : never;
62
+ }[Tag] | ComponentType<P>;
63
+ export type ComponentProps<T extends keyof Octane.JSX.IntrinsicElements | JSXElementConstructor<any>> = T extends JSXElementConstructor<infer P> ? P : T extends keyof Octane.JSX.IntrinsicElements ? Octane.JSX.IntrinsicElements[T] : never;
64
+ export type ComponentPropsWithRef<T extends ElementType> = ComponentProps<T>;
65
+ export type ComponentPropsWithoutRef<T extends ElementType> = PropsWithoutRef<ComponentProps<T>>;
66
+ export type CustomComponentPropsWithRef<T extends ComponentType<any>> = ComponentProps<T>;
67
+ export type ComponentRef<T extends ElementType> = ComponentProps<T> extends {
68
+ ref?: Ref<infer Instance>;
69
+ } ? Instance : never;
70
+ export type ElementRef<T extends ElementType> = ComponentRef<T>;
71
+ export type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
72
+ export type Provider<T> = Context<T>['Provider'];
73
+ export interface ProviderProps<T> {
74
+ value: T;
75
+ children?: OctaneNode;
76
+ }
77
+ export type SuspenseProps = Parameters<typeof Suspense>[0];
78
+ export type ActivityProps = Parameters<typeof Activity>[0];
79
+ export interface StrictModeProps {
80
+ children?: OctaneNode;
81
+ }
82
+ export type AriaAttributes = React.AriaAttributes;
83
+ export type AriaRole = React.AriaRole;
84
+ export type HTMLInputTypeAttribute = React.HTMLInputTypeAttribute;
85
+ export type HTMLAttributeReferrerPolicy = React.HTMLAttributeReferrerPolicy;
86
+ export type HTMLAttributeAnchorTarget = React.HTMLAttributeAnchorTarget;
87
+ export type Booleanish = boolean | 'true' | 'false';
88
+ export type CrossOrigin = '' | 'anonymous' | 'use-credentials' | undefined;
89
+ export type DetailedHTMLProps<E, T> = Octane.DetailedHTMLProps<E, T>;
90
+ export type HTMLProps<T> = Octane.DetailedHTMLProps<Octane.AllHTMLAttributes<T>, T>;
91
+ export type SVGProps<T> = Octane.SVGProps<T>;
92
+ export type SVGLineElementAttributes<T> = Octane.SVGLineElementAttributes<T>;
93
+ export type SVGTextElementAttributes<T> = Octane.SVGTextElementAttributes<T>;
94
+ /** The currentTarget is the host whose listener is currently being invoked. */
95
+ export type NativeEvent<T = Element, E extends Event = Event> = E & {
96
+ currentTarget: T & EventTarget;
97
+ };
98
+ export type EventHandler<E extends Event> = {
99
+ bivarianceHack(event: E): void;
100
+ }['bivarianceHack'];
101
+ export type AnchorHTMLAttributes<T> = Octane.AnchorHTMLAttributes<T>;
102
+ export type AreaHTMLAttributes<T> = Octane.AreaHTMLAttributes<T>;
103
+ export type AudioHTMLAttributes<T> = Octane.AudioHTMLAttributes<T>;
104
+ export type BaseHTMLAttributes<T> = Octane.BaseHTMLAttributes<T>;
105
+ export type BlockquoteHTMLAttributes<T> = Octane.BlockquoteHTMLAttributes<T>;
106
+ export type ButtonHTMLAttributes<T> = Octane.ButtonHTMLAttributes<T>;
107
+ export type CanvasHTMLAttributes<T> = Octane.CanvasHTMLAttributes<T>;
108
+ export type ColHTMLAttributes<T> = Octane.ColHTMLAttributes<T>;
109
+ export type ColgroupHTMLAttributes<T> = Octane.ColgroupHTMLAttributes<T>;
110
+ export type DataHTMLAttributes<T> = Octane.DataHTMLAttributes<T>;
111
+ export type DelHTMLAttributes<T> = Octane.DelHTMLAttributes<T>;
112
+ export type DetailsHTMLAttributes<T> = Octane.DetailsHTMLAttributes<T>;
113
+ export type DialogHTMLAttributes<T> = Octane.DialogHTMLAttributes<T>;
114
+ export type EmbedHTMLAttributes<T> = Octane.EmbedHTMLAttributes<T>;
115
+ export type FieldsetHTMLAttributes<T> = Octane.FieldsetHTMLAttributes<T>;
116
+ export type FormHTMLAttributes<T> = Octane.FormHTMLAttributes<T>;
117
+ export type HTMLAttributes<T> = Octane.HTMLAttributes<T>;
118
+ export type AllHTMLAttributes<T> = Octane.AllHTMLAttributes<T>;
119
+ export type HtmlHTMLAttributes<T> = Octane.HtmlHTMLAttributes<T>;
120
+ export type IframeHTMLAttributes<T> = Octane.IframeHTMLAttributes<T>;
121
+ export type ImgHTMLAttributes<T> = Octane.ImgHTMLAttributes<T>;
122
+ export type InputHTMLAttributes<T> = Octane.InputHTMLAttributes<T>;
123
+ export type InsHTMLAttributes<T> = Octane.InsHTMLAttributes<T>;
124
+ export type KeygenHTMLAttributes<T> = Octane.KeygenHTMLAttributes<T>;
125
+ export type LabelHTMLAttributes<T> = Octane.LabelHTMLAttributes<T>;
126
+ export type LiHTMLAttributes<T> = Octane.LiHTMLAttributes<T>;
127
+ export type LinkHTMLAttributes<T> = Octane.LinkHTMLAttributes<T>;
128
+ export type MapHTMLAttributes<T> = Octane.MapHTMLAttributes<T>;
129
+ export type MenuHTMLAttributes<T> = Octane.MenuHTMLAttributes<T>;
130
+ export type MetaHTMLAttributes<T> = Octane.MetaHTMLAttributes<T>;
131
+ export type MeterHTMLAttributes<T> = Octane.MeterHTMLAttributes<T>;
132
+ export type ObjectHTMLAttributes<T> = Octane.ObjectHTMLAttributes<T>;
133
+ export type OlHTMLAttributes<T> = Octane.OlHTMLAttributes<T>;
134
+ export type OptgroupHTMLAttributes<T> = Octane.OptgroupHTMLAttributes<T>;
135
+ export type OptionHTMLAttributes<T> = Octane.OptionHTMLAttributes<T>;
136
+ export type OutputHTMLAttributes<T> = Octane.OutputHTMLAttributes<T>;
137
+ export type ParamHTMLAttributes<T> = Octane.ParamHTMLAttributes<T>;
138
+ export type ProgressHTMLAttributes<T> = Octane.ProgressHTMLAttributes<T>;
139
+ export type QuoteHTMLAttributes<T> = Octane.QuoteHTMLAttributes<T>;
140
+ export type SVGAttributes<T> = Octane.SVGAttributes<T>;
141
+ export type ScriptHTMLAttributes<T> = Octane.ScriptHTMLAttributes<T>;
142
+ export type SelectHTMLAttributes<T> = Octane.SelectHTMLAttributes<T>;
143
+ export type SlotHTMLAttributes<T> = Octane.SlotHTMLAttributes<T>;
144
+ export type SourceHTMLAttributes<T> = Octane.SourceHTMLAttributes<T>;
145
+ export type StyleHTMLAttributes<T> = Octane.StyleHTMLAttributes<T>;
146
+ export type TableHTMLAttributes<T> = Octane.TableHTMLAttributes<T>;
147
+ export type TdHTMLAttributes<T> = Octane.TdHTMLAttributes<T>;
148
+ export type TextareaHTMLAttributes<T> = Octane.TextareaHTMLAttributes<T>;
149
+ export type ThHTMLAttributes<T> = Octane.ThHTMLAttributes<T>;
150
+ export type TimeHTMLAttributes<T> = Octane.TimeHTMLAttributes<T>;
151
+ export type TrackHTMLAttributes<T> = Octane.TrackHTMLAttributes<T>;
152
+ export type VideoHTMLAttributes<T> = Octane.VideoHTMLAttributes<T>;
153
+ export type WebViewHTMLAttributes<T> = Octane.WebViewHTMLAttributes<T>;
154
+ export type ClipboardEvent<T = Element> = NativeEvent<T, globalThis.ClipboardEvent>;
155
+ export type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
156
+ export type CompositionEvent<T = Element> = NativeEvent<T, globalThis.CompositionEvent>;
157
+ export type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
158
+ export type DragEvent<T = Element> = NativeEvent<T, globalThis.DragEvent>;
159
+ export type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
160
+ export type FocusEvent<T = Element> = NativeEvent<T, globalThis.FocusEvent>;
161
+ export type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
162
+ export type FormEvent<T = Element> = NativeEvent<T, globalThis.Event>;
163
+ export type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
164
+ export type ChangeEvent<T = Element> = NativeEvent<T, globalThis.Event>;
165
+ export type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
166
+ export type InputEvent<T = Element> = NativeEvent<T, globalThis.InputEvent>;
167
+ export type InputEventHandler<T = Element> = EventHandler<InputEvent<T>>;
168
+ export type InvalidEvent<T = Element> = NativeEvent<T, globalThis.Event>;
169
+ export type InvalidEventHandler<T = Element> = EventHandler<InvalidEvent<T>>;
170
+ export type KeyboardEvent<T = Element> = NativeEvent<T, globalThis.KeyboardEvent>;
171
+ export type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
172
+ export type MouseEvent<T = Element> = NativeEvent<T, globalThis.MouseEvent>;
173
+ export type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
174
+ export type TouchEvent<T = Element> = NativeEvent<T, globalThis.TouchEvent>;
175
+ export type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
176
+ export type PointerEvent<T = Element> = NativeEvent<T, globalThis.PointerEvent>;
177
+ export type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
178
+ export type UIEvent<T = Element> = NativeEvent<T, globalThis.UIEvent>;
179
+ export type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
180
+ export type WheelEvent<T = Element> = NativeEvent<T, globalThis.WheelEvent>;
181
+ export type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
182
+ export type AnimationEvent<T = Element> = NativeEvent<T, globalThis.AnimationEvent>;
183
+ export type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
184
+ export type TransitionEvent<T = Element> = NativeEvent<T, globalThis.TransitionEvent>;
185
+ export type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
186
+ export type ToggleEvent<T = Element> = NativeEvent<T, globalThis.Event>;
187
+ export type ToggleEventHandler<T = Element> = EventHandler<ToggleEvent<T>>;
188
+ export type DOMAttributes<T> = Pick<Octane.HTMLAttributes<T>, Extract<keyof Octane.HTMLAttributes<T>, `on${string}`> | 'children' | 'dangerouslySetInnerHTML'>;
File without changes
package/dist/runtime.d.ts CHANGED
@@ -387,10 +387,25 @@ interface PendingEffect {
387
387
  }
388
388
  interface TransitionActionSlot<T> {
389
389
  value: T;
390
+ renderTransition?: {
391
+ value: T;
392
+ };
390
393
  pendingActionBatch?: TransitionActionBatch;
391
394
  pendingActionValue?: T;
392
395
  }
393
396
  interface TransitionActionUpdate<T = unknown> {
397
+ /** An urgent replacement can cancel a held value even when its base is equal. */
398
+ superseded?: boolean;
399
+ state?: StateSlot<T>;
400
+ /** Already queued work precedes this batch; later urgent work stays on the cell. */
401
+ previous?: TransitionActionUpdate<T>;
402
+ next?: TransitionActionUpdate<T>;
403
+ stateUpdates?: Array<T | ((previous: T) => T)>;
404
+ reducerActions?: any[];
405
+ replayBaseValue?: T;
406
+ urgentOperations?: number[];
407
+ batch?: TransitionActionBatch;
408
+ reducer?: ReducerSlot<T, any>;
394
409
  slot: TransitionActionSlot<T>;
395
410
  block: Block;
396
411
  operations: Array<(value: T) => T>;
@@ -405,6 +420,17 @@ interface TransitionActionBatch {
405
420
  pendingActions: number;
406
421
  closed: boolean;
407
422
  flushed: boolean;
423
+ /**
424
+ * Only hook-started actions own pending indicators. Nearly every batch has
425
+ * exactly one starting hook, so the first is a plain field and only a second
426
+ * distinct hook (a nested start from another component) allocates the list.
427
+ */
428
+ hook: TransitionHookSlot | null;
429
+ hooks: TransitionHookSlot[] | null;
430
+ /** True while this batch is counted in its hooks' pending batch counts. */
431
+ hooksPending: boolean;
432
+ pendingHolds?: number;
433
+ workComplete?: boolean;
408
434
  }
409
435
  type TransitionMemoSwap = [kind: 0, hooks: Map<HookSlot, unknown>, slot: HookSlot, previous: unknown, next: unknown] | [kind: 1, cells: any[], base: number, previous: any[], next: any[]];
410
436
  interface WarmHarvestEntry {
@@ -416,6 +442,8 @@ interface WarmHarvestEntry {
416
442
  }
417
443
  /** The same single-origin staged cells as P1, owned by a root rather than a TrySlot. */
418
444
  interface RootTransitionHold {
445
+ /** Coalesce retries when an urgent action changes the retained forward value. */
446
+ replayScheduled?: boolean;
419
447
  origin: Block;
420
448
  entries: Array<TransitionActionUpdate<any>>;
421
449
  memoSwaps: TransitionMemoSwap[] | null;
@@ -599,8 +627,8 @@ export declare function scheduleRenderCleanup(schedule: (callback: () => void) =
599
627
  */
600
628
  export declare function setIsOctaneActEnvironment(value: boolean): void;
601
629
  /**
602
- * React-DOM parity. Runs `fn` and synchronously drains any renders/effects it scheduled
603
- * before returning. Bypasses the microtask-batched flush — used by the benchmark
630
+ * Runs `fn` and synchronously drains scheduled renders and insertion/layout work.
631
+ * Newly queued passive effects retain Octane's post-paint scheduling. Bypasses the microtask-batched flush — used by the benchmark
604
632
  * timing rig to measure operation wall-clock without microtask coalescing. Also the
605
633
  * controlled-restore commit path: maybeFlushDiscrete flushes through here at the
606
634
  * outermost boundary of a discrete event that armed a controlled `value`/`checked`
@@ -676,9 +704,27 @@ export declare function act<T>(fn: () => T | Promise<T>): Promise<T>;
676
704
  export declare function renderBlock(block: Block): void;
677
705
  export declare function componentSlotLite<P>(parentScope: Scope, slotKey: number, host: Node, comp: ComponentBody<P>, props: P, anchor?: Node): void;
678
706
  declare const SLOT_FLAG_TEARDOWN: number;
707
+ /** @internal Invoke a provider that owns the trailing hook-slot ABI. */
708
+ export declare function invokeManualHook<T>(fn: (...args: any[]) => T, receiver: unknown, args: IArguments): T;
709
+ /** @internal Adapt an expression provider that owns the trailing hook-slot ABI. */
710
+ export declare function manualHook<F extends (...args: any[]) => any>(fn: F, name?: string): F;
679
711
  export declare function withSlot<T>(sym: symbol, fn: (...a: any[]) => T, ...args: any[]): T;
680
712
  /** @internal Optional native hooks use the existing compiler slot and Scope lifetime. */
681
713
  export declare function nativeLocalHook<T>(name: string, initialize: () => T, dispose: (value: T) => void, slot?: HookSlot): T;
714
+ interface StateSlot<T> {
715
+ value: T;
716
+ setter: (next: T | ((prev: T) => T)) => void;
717
+ /** Queued functional work is evaluated in the owner's next render. */
718
+ updates?: Array<T | ((previous: T) => T)>;
719
+ /** Promoted transition work folds with the inputs of the rendering owner. */
720
+ renderTransition?: TransitionActionUpdate<T>;
721
+ /** An urgent ancestor reads queued urgent operations without consuming the transition. */
722
+ urgentTransition?: boolean;
723
+ /** Allocated only for compiler-selected third-tuple consumers. */
724
+ getter?: () => T;
725
+ pendingActionBatch?: TransitionActionBatch;
726
+ pendingActionValue?: T;
727
+ }
682
728
  type StateSetter<T> = (next: T | ((prev: T) => T)) => void;
683
729
  type StateTuple<T> = [T, StateSetter<T>, () => T];
684
730
  export declare function useState<T = undefined>(): StateTuple<T | undefined>;
@@ -705,6 +751,20 @@ type LinkedStateTuple<Value> = [Value, StateSetter<Value>, () => Value];
705
751
  export declare function useLinkedState<Source, Value>(source: Source, reconcile: (source: Source, previous: LinkedStatePrevious<Source, Value> | undefined) => Value, options?: LinkedStateOptions<Source, Value>, slot?: symbol): LinkedStateTuple<Value>;
706
752
  /** Compiler-selected linked-state variant when the current-value getter is observed. */
707
753
  export declare function __useLinkedStateWithGetter<Source, Value>(source: Source, reconcile: (source: Source, previous: LinkedStatePrevious<Source, Value> | undefined) => Value, options?: LinkedStateOptions<Source, Value>, slot?: symbol): LinkedStateTuple<Value>;
754
+ interface ReducerSlot<S, A> {
755
+ value: S;
756
+ dispatch: (action: A) => void;
757
+ reducer: (state: S, action: A) => S;
758
+ /** Render-phase actions are reduced by the reducer from the replaying render. */
759
+ renderPhaseActions?: A[];
760
+ /** A promoted Action is reduced with this render's reducer before publication. */
761
+ renderTransition?: TransitionActionUpdate<S>;
762
+ urgentTransition?: boolean;
763
+ /** Allocated only for compiler-selected third-tuple consumers. */
764
+ getter?: () => S;
765
+ pendingActionBatch?: TransitionActionBatch;
766
+ pendingActionValue?: S;
767
+ }
708
768
  type ReducerTuple<S, A> = [S, (action: A) => void, () => S];
709
769
  export declare function useReducer<S, A, I = S>(reducer: (s: S, a: A) => S, initialArg: I, initOrSlot?: ((arg: I) => S) | symbol, slot?: symbol): ReducerTuple<S, A>;
710
770
  /** Compiler-emitted useReducer variant for a tuple whose third member is observable. */
@@ -739,6 +799,9 @@ export declare function hookMemoPublish4<T>(cells: any[], base: number, value: T
739
799
  export declare function hookMemoPublish<T>(cells: any[], base: number, value: T, ...deps: any[]): T;
740
800
  /** One-cell form for compiler-owned lifetime-invariant callback values. */
741
801
  export declare function hookMemoPublishInvariant<T>(cells: any[], base: number, value: T): T;
802
+ export declare function useRef<T = undefined>(): {
803
+ current: T | undefined;
804
+ };
742
805
  export declare function useRef<T>(initial: T, slot?: symbol): {
743
806
  current: T;
744
807
  };
@@ -760,47 +823,6 @@ type ImperativeRef<T> = {
760
823
  * nested array refs share one factory result across all non-null owners.
761
824
  */
762
825
  export declare function useImperativeHandle<T>(ref: ImperativeRef<T>, factory: () => T, deps?: any[] | null, slot?: symbol): void;
763
- /**
764
- * React 18+ `useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot?)`.
765
- *
766
- * Mirrors React's contract: subscribe is called on mount with an
767
- * `onStoreChange` callback; the returned function unsubscribes on unmount
768
- * (and on subscribe identity change). `getSnapshot()` is called on every
769
- * render to return the current snapshot. When the store calls
770
- * `onStoreChange`, the component re-renders and `getSnapshot()` runs again.
771
- *
772
- * `getServerSnapshot` IS used: on the server it supplies the SSR snapshot, and
773
- * during client hydration the first read uses it (see below) so the adopted DOM
774
- * matches the server value before the commit-time store-sync reconciles any
775
- * client/server difference. Client-only builds discard the capability method
776
- * that supplies this state.
777
- *
778
- * Implementation. A single identity-stable `inst` cell (StoreInst) holds the
779
- * last-COMMITTED snapshot, the latest getSnapshot, the block's forceUpdate, and a
780
- * stable onStoreChange handler. Two derived sub-slots host it: `<slot>:uses:inst`
781
- * (the cell, in the hooks map) and `<slot>:uses:effect` (the passive subscribe
782
- * effect). The value-sync that reconciles the render-read snapshot at commit does
783
- * NOT go through a layout effect — it rides the dedicated, sort-free
784
- * `storeSyncQueue` (drainStoreSyncs, run after the layout phase). Two payoffs:
785
- *
786
- * 1. The commit-sync entry carries no cleanup and never reorders, so the generic
787
- * effect machinery (deps compare, PendingEffect alloc, post-order sort,
788
- * per-entry cleanup/finalizer bookkeeping) is skipped for it.
789
- * 2. The enqueue is GATED: a re-render whose snapshot is Object.is-unchanged (and
790
- * whose store wasn't swapped) enqueues NOTHING, even with a fresh inline
791
- * getSnapshot every render (the dominant zustand/query pattern). getSnapshot is
792
- * refreshed in RENDER instead of at commit, so onStoreChange always dedups
793
- * against the freshest read while unchanged renders stay allocation-free.
794
- *
795
- * DIVERGENCE FROM REACT (documented in docs/react-parity-migration-plan.md):
796
- * React's updateSyncExternalStore re-pushes updateStoreInstance whenever
797
- * `inst.getSnapshot !== getSnapshot`, giving a commit-time snapshot re-read even
798
- * when the value was unchanged. We drop that: a store that mutates WITHOUT
799
- * notifying in the render→commit window is no longer caught on a render where ONLY
800
- * getSnapshot identity changed. Octane's synchronous renderer closes React's
801
- * motivating concurrent-interleaving window, and any store that actually notifies
802
- * is unaffected (onStoreChange uses the render-fresh getSnapshot).
803
- */
804
826
  export declare function useSyncExternalStore<T>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T, slot?: symbol): T;
805
827
  /**
806
828
  * React 19 `useEffectEvent` — returns a fresh wrapper each render whose shared
@@ -1061,6 +1083,8 @@ export declare function nativeWarmMemo(compute: () => any, deps: any[], slot: Ho
1061
1083
  * cannot prove finite.
1062
1084
  */
1063
1085
  export declare function warmChild(comp: any, props: any): void;
1086
+ /** Compiler-owned plans must not follow static hoisting onto unrelated HOCs. */
1087
+ export declare function markWarm<T extends Function>(component: T, plan: unknown): T;
1064
1088
  export declare const puMiss: unique symbol;
1065
1089
  export declare function puTake0(slot: HookSlot): any;
1066
1090
  export declare function puTake1(slot: HookSlot, d0: any): any;
@@ -1104,7 +1128,9 @@ export declare function memoPublishAlways<T>(slot: HookSlot, value: T): T;
1104
1128
  */
1105
1129
  export declare function lazy<C extends ComponentBody<any>>(load: () => PromiseLike<{
1106
1130
  default: C;
1107
- } | C>): C;
1131
+ } | C>): C & {
1132
+ displayName?: string;
1133
+ };
1108
1134
  export declare function useId(slot?: symbol): string;
1109
1135
  export declare function template(html: string, ns?: number, frag?: number): Element;
1110
1136
  export declare function clone<T extends Node>(node: T, loc?: string, partialStyles?: string): T;
@@ -1381,9 +1407,7 @@ export declare function setStringData(el: Element, name: string, value: unknown)
1381
1407
  export declare function setBooleanAttribute(el: Element, name: string, value: unknown): void;
1382
1408
  /**
1383
1409
  * Compiler-only fast path for a valid, statically named lowercase `aria-*`
1384
- * attribute. ARIA values are enumerated: only nullish removes, while booleans,
1385
- * functions, symbols, numbers, and objects stringify exactly like the generic
1386
- * attribute path.
1410
+ * attribute. Booleans stringify; nullish, function, and symbol values remove.
1387
1411
  */
1388
1412
  export declare function setAriaAttribute(el: Element, name: string, value: unknown): void;
1389
1413
  import { normalizeClass } from './css.js';
@@ -1457,7 +1481,7 @@ export declare function delegateCaptureEvents(eventNames: string[]): void;
1457
1481
  export interface FormStatus {
1458
1482
  pending: boolean;
1459
1483
  data: FormData | null;
1460
- method: string;
1484
+ method: string | null;
1461
1485
  action: ((formData: FormData) => unknown) | string | null;
1462
1486
  }
1463
1487
  /**
@@ -1476,11 +1500,11 @@ export declare function requestFormReset(form: HTMLFormElement): void;
1476
1500
  /**
1477
1501
  * Compiler-emitted binding for `<form action={fn}>` / `<button formAction={fn}>`.
1478
1502
  * A FUNCTION value wires submit interception (stored on the element as
1479
- * `$$formAction`, with the form gaining a delegated `$$submit` handler once);
1503
+ * `$$formAction`, with submit delegation installed once);
1480
1504
  * a string/null value falls back to the native attribute so ordinary form posts
1481
- * still work. `prev` lets the update path clean up when switching function→string.
1505
+ * still work. The previous-value argument remains part of the compiler ABI.
1482
1506
  */
1483
- export declare function setFormAction(el: HTMLFormElement | HTMLButtonElement | HTMLInputElement, name: string, value: unknown, prev: unknown): void;
1507
+ export declare function setFormAction(el: HTMLFormElement | HTMLButtonElement | HTMLInputElement, name: string, value: unknown, _prev: unknown): void;
1484
1508
  /**
1485
1509
  * Compiler-emitted binding for `autoFocus` (React parity): client mounts never
1486
1510
  * write an attribute and focus supported controls once, before layout effects.
@@ -1525,12 +1549,7 @@ export declare function setSelectValue(el: Element, value: unknown): void;
1525
1549
  * option defaultSelected), never the live value: a dirty control keeps what
1526
1550
  * the user typed. Re-synced on updates (React parity; attribute-only).
1527
1551
  */
1528
- export declare function setDefaultValue(el: Element, value: unknown): void;
1529
- /**
1530
- * Compiler-only defaultValue binding for a statically-known input/textarea
1531
- * with no value writer or spread. The element is necessarily uncontrolled, so
1532
- * it needs neither a controlled-state record nor edit/composition listeners.
1533
- */
1552
+ export declare function setDefaultValue(el: Element, value: unknown, initial?: boolean): void;
1534
1553
  export declare function setDefaultValueUncontrolled(el: Element, value: unknown): void;
1535
1554
  /** Compiler-emitted binding for `defaultChecked` (uncontrolled checkables). */
1536
1555
  export declare function setDefaultChecked(el: Element, value: unknown): void;
@@ -1547,6 +1566,7 @@ interface PortalSlot {
1547
1566
  __kind: 'portalSlotSlot';
1548
1567
  block: Block | null;
1549
1568
  target: Element | null;
1569
+ key: string | null;
1550
1570
  host: Node;
1551
1571
  start: Comment | null;
1552
1572
  end: Comment | null;
@@ -1563,10 +1583,9 @@ interface PortalSlot {
1563
1583
  */
1564
1584
  export declare function portal(parentScope: Scope, slotKey: number, target: Element, body: ComponentBody, props: any, host?: Node, env?: any[], fragmentOwners?: FragmentInstance | readonly FragmentInstance[], fragmentAnchor?: Node): void;
1565
1585
  /**
1566
- * `createPortal(children, target, props?)`. The first two arguments mirror ReactDOM's
1567
- * `createPortal(children, container)`; the OPTIONAL THIRD argument is Octane-specific
1568
- * `props` for the portal wrapper — NOT ReactDOM's `key`. That third slot is an
1569
- * intentional divergence from React (Octane has no `key`-as-third-arg portal form). The
1586
+ * `createPortal(children, target, keyOrProps?)`. A string/number third argument
1587
+ * is a reconciliation key. An object remains Octane's optional props for a
1588
+ * function portal body. The
1570
1589
  * compiler recognises `{createPortal(...)}` at JSX child position and lowers it to a
1571
1590
  * direct `portal(...)` runtime call — no descriptor allocation on the hot path. This
1572
1591
  * function exists so non-JSX call sites (storing in a variable, passing through props,
@@ -1575,6 +1594,7 @@ export declare function portal(parentScope: Scope, slotKey: number, target: Elem
1575
1594
  declare const PORTAL_TAG: unique symbol;
1576
1595
  export interface PortalDescriptor {
1577
1596
  $$kind: typeof PORTAL_TAG;
1597
+ key: string | null;
1578
1598
  body: ComponentBody | ElementDescriptor | unknown;
1579
1599
  target: Element;
1580
1600
  props: any;
@@ -1725,7 +1745,14 @@ export declare function compilerCacheContext(scope: Scope, slotKey: number, prev
1725
1745
  * "equal"), `false` to re-render. When omitted, a shallow Object.is comparison
1726
1746
  * of own enumerable keys is used.
1727
1747
  */
1728
- export declare function memo<P>(component: ComponentBody<P>, arePropsEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean): ComponentBody<P>;
1748
+ export declare function memo<C extends ComponentBody<any>>(component: C, arePropsEqual?: (prevProps: Readonly<Parameters<C>[0]>, nextProps: Readonly<Parameters<C>[0]>) => boolean): C & {
1749
+ readonly type: C;
1750
+ displayName?: string;
1751
+ };
1752
+ export declare function memo<P>(component: ComponentBody<P>, arePropsEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean): ComponentBody<P> & {
1753
+ readonly type: ComponentBody<P>;
1754
+ displayName?: string;
1755
+ };
1729
1756
  export declare const HMR: unique symbol;
1730
1757
  export declare function hmr<P>(fn: ComponentBody<P>): ComponentBody<P>;
1731
1758
  export declare function setTransitionFallbackTimeout(ms: number): void;
@@ -1856,6 +1883,21 @@ declare function teardownErrorSlot(state: ErrorSlot, detachDom: boolean): void;
1856
1883
  export declare function errorBlock(parentScope: Scope, slotKey: number, domParent: Node, tryBody: ComponentBody, catchBody: ComponentBody, anchor?: Node | null, env?: any[]): () => void;
1857
1884
  export declare function tryBlock(parentScope: Scope, slotKey: number, domParent: Node, tryBody: ComponentBody, catchBody: ComponentBody | null, pendingBody: ComponentBody | null, anchor?: Node | null, env?: any[], propagateSuspense?: boolean): () => void;
1858
1885
  export declare function startTransition(fn: () => void | Promise<unknown>): void;
1886
+ interface TransitionHookSlot {
1887
+ isPending: boolean;
1888
+ block: Block;
1889
+ /**
1890
+ * Action batches this hook started or was re-held into that have not
1891
+ * finished. The batches themselves list their hooks; the hook only needs
1892
+ * the count to publish its falling edge, so no per-hook collection exists.
1893
+ */
1894
+ pendingBatches: number;
1895
+ error?: {
1896
+ value: unknown;
1897
+ };
1898
+ start: (fn: () => void | Promise<unknown>) => void;
1899
+ publish: (pending: boolean) => void;
1900
+ }
1859
1901
  export declare function useTransition(slot?: symbol): [boolean, (fn: () => void | Promise<unknown>) => void];
1860
1902
  export declare function useActionState<S>(action: (prevState: S, payload: any) => S | Promise<S>, initialState: S, permalinkOrSlot?: string | symbol, slot?: symbol): [S, (payload?: any) => void, boolean];
1861
1903
  export declare function useFormStatus(slot?: symbol): FormStatus;
@@ -1954,11 +1996,12 @@ interface InlineCaughtErrorReport {
1954
1996
  handler: (error: unknown) => void;
1955
1997
  resume: EffectEventCommitAction;
1956
1998
  }
1999
+ export type RootContainer = Element | Document | DocumentFragment;
1957
2000
  /** Compiler ABI: validate an authored candidate and publish only from a DEV render. */
1958
2001
  export declare function devHtmlNesting(childTag: string, ancestors: string[], childLocation?: string, ancestorLocation?: string): void;
1959
- export declare function createRoot(container: Element, options?: RootOptions): Root;
2002
+ export declare function createRoot(container: RootContainer, options?: RootOptions): Root;
1960
2003
  /** Compiler-only root for a statically proven void `@{}` entry component. */
1961
- export declare function __createVoidRoot(container: Element, options?: RootOptions): Root;
2004
+ export declare function __createVoidRoot(container: RootContainer, options?: RootOptions): Root;
1962
2005
  /**
1963
2006
  * Hydrate a server-rendered container and return a live {@link Root} — the
1964
2007
  * React-18 `hydrateRoot(container, element)` shape (container FIRST). Instead of
@@ -1974,8 +2017,8 @@ export declare function __createVoidRoot(container: Element, options?: RootOptio
1974
2017
  * component updates props in place on the adopted DOM, a different component
1975
2018
  * tears down and remounts.
1976
2019
  */
1977
- export declare function hydrateRoot(container: Element, element: ElementDescriptor, options?: RootOptions): Root;
1978
- export declare function hydrateRoot(container: Element, body: ComponentBody, props?: any, options?: RootOptions): Root;
2020
+ export declare function hydrateRoot(container: RootContainer, element: ElementDescriptor, options?: RootOptions): Root;
2021
+ export declare function hydrateRoot(container: RootContainer, body: ComponentBody, props?: any, options?: RootOptions): Root;
1979
2022
  /** React DOM `preload(href, {as, …})` — `<link rel="preload">`. */
1980
2023
  export declare function preload(href: string, options: {
1981
2024
  as: string;