octane 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/runtime.cjs +773 -385
- package/dist/cjs/runtime.server.cjs +319 -76
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/bundler.js +6 -6
- package/dist/compiler/compile-universal.js +1 -1
- package/dist/compiler/compile.js +407 -126
- package/dist/compiler/context-use.js +154 -0
- package/dist/compiler/hook-deps.js +17 -1
- package/dist/compiler/index.d.ts +1 -3
- package/dist/compiler/native-read-diagnostics.js +21 -34
- package/dist/compiler/slot-hooks.d.ts +0 -1
- package/dist/compiler/slot-hooks.js +9 -3
- package/dist/compiler/strong-mode.js +716 -39
- package/dist/compiler/text-type-facts.js +38 -24
- package/dist/compiler/typescript.d.ts +8 -1
- package/dist/compiler/typescript.js +48 -20
- package/dist/compiler/vite.d.ts +6 -2
- package/dist/compiler/vite.js +85 -5
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.d.ts +1 -1
- package/dist/compiler/volar.js +3498 -3484
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/runtime.d.ts +19 -5
- package/dist/runtime.js +770 -385
- package/dist/runtime.server.d.ts +7 -6
- package/dist/runtime.server.js +319 -76
- package/dist/signals/index.d.ts +1 -1
- package/dist/signals/types.d.ts +1 -1
- package/dist/universal-core.d.ts +15 -0
- package/dist/universal-core.js +575 -83
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { initializeHydrationEventCapture } from './hydration/event-capture.js';
|
|
|
5
5
|
export { attachBehaviorRoot } from './behavior-root.js';
|
|
6
6
|
export type * from './behavior-root.js';
|
|
7
7
|
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from './sub-slot.js';
|
|
8
|
-
export { createRoot, hydrateRoot, flushSync, act, isInActScope, type Root, type RootContainer, type RootOptions, useState, useLinkedState, type LinkedStatePrevious, type LinkedStateOptions, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useMemo, useCallback, useRef, useId, useImperativeHandle, useEffectEvent, useSyncExternalStore, useDeferredValue, useTransition, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, type FormStatus, startTransition, requestFormReset, memo, lazy, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, createContext, use, useContext, type Context, type ForeignHostContext, Suspense, ErrorBoundary, Hydrate, Activity, Activity as unstable_Activity, ViewTransition, addTransitionType, ViewTransition as unstable_ViewTransition, addTransitionType as unstable_addTransitionType, ViewTransitionPseudoElement, type ViewTransitionProps, type ViewTransitionInstance, Fragment, createPortal, type PortalDescriptor, createElement, cloneElement, isValidElement, isChildrenBlock, descriptorChildren, Children, type ElementDescriptor, type ComponentBody, type OctaneNode, TsrxErrorBoundary, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, __createVoidRoot, bindRendererRegionOwner, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, createHostContextRequest, __vtSeen, template, clone, drainFrag, bag0, bag1, bag2, bag3, bag4, bag5, bag6, bag7, bag8, bag9, bag10, bag11, bag12, bag13, bag14, bag15, bag16, bagOf, evt0, evt0u, evt1, evt1u, evt2, evt2u, evtN, evtNu, setEventHandler, devEventListener, devHtmlNesting, htext, htextSwap, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, setStyle, setStyleProperty, setSpread, snapshotSpread, setHostPropSources, queueNativeChangeDiagnostic, queueFormAuthoringDiagnostic, markNativeChangeDiagnosticStatic, setFormAction, setValue, setFormControlSources, setChecked, setCheckedCheckable, setSelectValue, setDefaultValue, setDefaultValueUncontrolled, setDefaultChecked, setAutoFocus, attachRef, queueRefAttach, queueRefDetach, replaceRef, queueOwnRefDetach, injectStyle, headBlock, stylesheetResource, styleResource, scriptResource, namespaceHead, namespaceHeadElement, delegateEvents, delegateCaptureEvents, fastForBlock, fastKeyedForBlock, fastMapSlot, forBlock, keyedForBlock, mapSlot, ifBlock, errorBlock, tryBlock, switchBlock, activityBlock, componentSlot, componentSlotVoid, componentSlotLite, compilerCacheArray, compilerCacheImmutableArrayFilter, compilerCacheMappedArray, compilerCacheContext, compilerOwnsContextProvider, markSingleRoot, markWarm, markSingleRoot as __s, markChildrenBlock, createScopedValue, createScopedElement, childSlot, positionalChildren, textSlot, textHole, childTextHole, hostComponent, renderBlock, portal, hookSlots, withSlot, manualHook, invokeManualHook, useBatch, seedOrCreate, warmMemo, warmChild, puMiss, puTake0, puTake1, puTake2, puTake3, puTake4, puPub, provideContext, mountFragmentRef, FragmentInstance, hmr, HMR, hasPendingWork, type Scope, type Block, drainPassiveEffects, setIsOctaneActEnvironment, resetFloatResourceState, setTransitionFallbackTimeout, getTransitionFallbackTimeout, } from './runtime.js';
|
|
8
|
+
export { createRoot, hydrateRoot, flushSync, act, isInActScope, type Root, type RootContainer, type RootOptions, useState, useLinkedState, type LinkedStatePrevious, type LinkedStateOptions, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useMemo, useCallback, useRef, useId, useImperativeHandle, useEffectEvent, useSyncExternalStore, useDeferredValue, useTransition, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, type FormStatus, startTransition, requestFormReset, memo, lazy, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, createContext, use, useContext, type Context, type ForeignHostContext, Suspense, ErrorBoundary, Hydrate, Activity, Activity as unstable_Activity, ViewTransition, addTransitionType, ViewTransition as unstable_ViewTransition, addTransitionType as unstable_addTransitionType, ViewTransitionPseudoElement, type ViewTransitionProps, type ViewTransitionInstance, Fragment, createPortal, type PortalDescriptor, createElement, cloneElement, isValidElement, isChildrenBlock, descriptorChildren, Children, type ElementDescriptor, type ComponentBody, type OctaneNode, TsrxErrorBoundary, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, __createVoidRoot, bindRendererRegionOwner, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, createHostContextRequest, __vtSeen, template, clone, drainFrag, bag0, bag1, bag2, bag3, bag4, bag5, bag6, bag7, bag8, bag9, bag10, bag11, bag12, bag13, bag14, bag15, bag16, bagOf, evt0, evt0u, evt1, evt1u, evt2, evt2u, evtN, evtNu, setEventHandler, devEventListener, devHtmlNesting, htext, htextSwap, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, setStyle, setStyleProperty, setSpread, snapshotSpread, setHostPropSources, queueNativeChangeDiagnostic, queueFormAuthoringDiagnostic, markNativeChangeDiagnosticStatic, setFormAction, setValue, setFormControlSources, setChecked, setCheckedCheckable, setSelectValue, setDefaultValue, setDefaultValueUncontrolled, setDefaultChecked, setAutoFocus, attachRef, queueRefAttach, queueRefDetach, replaceRef, queueOwnRefDetach, injectStyle, headBlock, stylesheetResource, styleResource, scriptResource, namespaceHead, namespaceHeadElement, delegateEvents, delegateCaptureEvents, fastForBlock, fastKeyedForBlock, fastMapSlot, forBlock, keyedForBlock, mapSlot, ifBlock, errorBlock, tryBlock, switchBlock, activityBlock, componentSlot, componentSlotVoid, componentSlotLite, compilerCacheArray, compilerCacheImmutableArrayFilter, compilerCacheMappedArray, compilerCacheContext, compilerOwnsContextProvider, markSingleRoot, markWarm, markSingleRoot as __s, markChildrenBlock, createScopedValue, createScopedElement, childSlot, positionalChildren, textSlot, textHole, childTextHole, hostComponent, renderBlock, portal, hookSlots, withSlot, manualHook, invokeManualHook, useBatch, registerWarmPlan, seedOrCreate, warmMemo, warmChild, puMiss, puTake0, puTake1, puTake2, puTake3, puTake4, puPub, provideContext, mountFragmentRef, FragmentInstance, hmr, HMR, hasPendingWork, type Scope, type Block, drainPassiveEffects, setIsOctaneActEnvironment, resetFloatResourceState, setTransitionFallbackTimeout, getTransitionFallbackTimeout, } from './runtime.js';
|
|
9
9
|
export type { HydrateOptions, HydrateProps, HydrateWhen, HydrationInteractionEvent, HydrationInteractionEvents, HydrationPrefetchContext, HydrationPrefetchFunction, HydrationPrefetchStrategy, HydrationPrefetchWaitReason, HydrationStrategy, HydrationWhen, } from './hydration/types.js';
|
|
10
10
|
export { __serverRpc } from './server-rpc-client.js';
|
|
11
11
|
export { __methodDep } from './method-dep.js';
|
package/dist/index.js
CHANGED
|
@@ -192,6 +192,7 @@ import {
|
|
|
192
192
|
manualHook,
|
|
193
193
|
invokeManualHook,
|
|
194
194
|
useBatch,
|
|
195
|
+
registerWarmPlan,
|
|
195
196
|
seedOrCreate,
|
|
196
197
|
warmMemo,
|
|
197
198
|
warmChild,
|
|
@@ -356,6 +357,7 @@ export {
|
|
|
356
357
|
queueOwnRefDetach,
|
|
357
358
|
queueRefAttach,
|
|
358
359
|
queueRefDetach,
|
|
360
|
+
registerWarmPlan,
|
|
359
361
|
renderBlock,
|
|
360
362
|
replaceRef,
|
|
361
363
|
requestFormReset,
|
package/dist/runtime.d.ts
CHANGED
|
@@ -131,10 +131,12 @@ export interface Scope {
|
|
|
131
131
|
* never drops a context it stamped, and a closer provider can't appear above a
|
|
132
132
|
* surviving consumer — so only the provider's VALUE varies, read live from the
|
|
133
133
|
* cached scope. Collapses useContextInternal's O(depth) walk to an O(1) read.
|
|
134
|
-
*
|
|
135
|
-
*
|
|
134
|
+
* The first context and its resolved owner live inline; only a second distinct
|
|
135
|
+
* context allocates a Map. The owner is never the value itself, so Provider
|
|
136
|
+
* updates remain visible on subsequent reads.
|
|
136
137
|
*/
|
|
137
|
-
$$ctxCache: Map<Context<any>,
|
|
138
|
+
$$ctxCache: Context<any> | Map<Context<any>, Scope | typeof DEFAULT_CTX> | null;
|
|
139
|
+
$$ctxCacheOwner: Scope | typeof DEFAULT_CTX | null;
|
|
138
140
|
slots: any[];
|
|
139
141
|
/**
|
|
140
142
|
* DEV ONLY (set by `dev`-compiled bodies; `undefined` in production): a structured
|
|
@@ -228,6 +230,8 @@ export interface Block extends Scope {
|
|
|
228
230
|
forSlot: ForSlot | null;
|
|
229
231
|
/** Item position within the enclosing for-block. 0 for non-item blocks. */
|
|
230
232
|
itemIndex: number;
|
|
233
|
+
/** Root-render transaction that created this block (0 outside a transaction). */
|
|
234
|
+
createdStamp: number;
|
|
231
235
|
/**
|
|
232
236
|
* Doubly-linked-list pointers for for-block item blocks. Maintained by
|
|
233
237
|
* reconcileKeyed so move/remove are O(1) pointer ops instead of array
|
|
@@ -474,7 +478,9 @@ interface RootRenderTransaction {
|
|
|
474
478
|
log: any[];
|
|
475
479
|
bags: Map<object, number>;
|
|
476
480
|
capture: OffscreenCapture;
|
|
477
|
-
created:
|
|
481
|
+
created: Block[] | null;
|
|
482
|
+
createdStamp: number;
|
|
483
|
+
bagWindow: number;
|
|
478
484
|
retainedCreated: Set<Block> | null;
|
|
479
485
|
retired: Set<Block> | null;
|
|
480
486
|
structures: Map<object, number> | null;
|
|
@@ -497,6 +503,7 @@ export declare function getRootRenderRetryKey(scope: Scope, retryOnly?: boolean)
|
|
|
497
503
|
*/
|
|
498
504
|
interface ParkedItem {
|
|
499
505
|
block: Block;
|
|
506
|
+
/** Preserve the exact row range across later journal windows that can detach it. */
|
|
500
507
|
nodes: Node[];
|
|
501
508
|
}
|
|
502
509
|
/** Animation class value: a class string, 'auto', 'none', or a per-type map. */
|
|
@@ -1007,6 +1014,7 @@ export declare function useRendererThenable<T>(thenable: PromiseLike<T>): T;
|
|
|
1007
1014
|
* React-19 idiom and remains the primary form.
|
|
1008
1015
|
*/
|
|
1009
1016
|
export declare function useContext<T>(context: Context<T> | ForeignHostContext<T>): T;
|
|
1017
|
+
declare const DEFAULT_CTX: unique symbol;
|
|
1010
1018
|
/**
|
|
1011
1019
|
* Compiler ABI for a DOM component materialized from a reverse renderer region.
|
|
1012
1020
|
* The bridge is deliberately attached only to the owning DOM root; normal DOM
|
|
@@ -1053,6 +1061,8 @@ export declare function seedOrCreate<T>(site: string, factory: () => T): T;
|
|
|
1053
1061
|
* descendants via warmChild/warmMemo. A resolved batch costs no warm work.
|
|
1054
1062
|
*/
|
|
1055
1063
|
export declare function useBatch(items: any[], warm?: () => void): void;
|
|
1064
|
+
/** @internal Compiler-owned registration for a component warm plan. */
|
|
1065
|
+
export declare function registerWarmPlan(fn: (props: any) => void, props: any): void;
|
|
1056
1066
|
interface WarmEntry {
|
|
1057
1067
|
deps: any[];
|
|
1058
1068
|
value: any;
|
|
@@ -1208,6 +1218,8 @@ export declare function setBooleanAttributeIfChanged(value: unknown, previous: u
|
|
|
1208
1218
|
export declare function setAriaAttributeIfChanged(value: unknown, previous: unknown, el: Element, name: string): unknown;
|
|
1209
1219
|
export declare function setClassNameIfChanged(value: unknown, previous: unknown, el: Element): unknown;
|
|
1210
1220
|
export declare function setClassAttrIfChanged(value: unknown, previous: unknown, el: Element): unknown;
|
|
1221
|
+
export declare function updateFreshClassName(value: unknown, previous: unknown, el: Element): string;
|
|
1222
|
+
export declare function updateFreshClassAttr(value: unknown, previous: unknown, el: Element): string;
|
|
1211
1223
|
/**
|
|
1212
1224
|
* Set authored inline-script source without asking the HTML parser to interpret it.
|
|
1213
1225
|
* This is the client half of the compiler's `<script dangerouslySetInnerHTML>`
|
|
@@ -1472,7 +1484,9 @@ declare const HANDLER_BUNDLE_KIND = 1;
|
|
|
1472
1484
|
interface HandlerBundle {
|
|
1473
1485
|
[EVENT_SLOT_KIND]: typeof HANDLER_BUNDLE_KIND;
|
|
1474
1486
|
fn: (...args: any[]) => any;
|
|
1475
|
-
args: any[];
|
|
1487
|
+
args: any[] | 1 | 2;
|
|
1488
|
+
a0?: any;
|
|
1489
|
+
a1?: any;
|
|
1476
1490
|
}
|
|
1477
1491
|
/**
|
|
1478
1492
|
* Development compiler/runtime boundary for a dynamic `onXxx` prop. React
|