octane 0.2.11 → 0.2.13
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/behavior-root.d.ts +13 -3
- package/dist/behavior-root.js +28 -5
- package/dist/cjs/behavior-root.cjs +32 -6
- package/dist/cjs/class-names.cjs +49 -0
- package/dist/cjs/constants.cjs +9 -0
- package/dist/cjs/context-epoch.cjs +38 -0
- package/dist/cjs/css.cjs +6 -27
- package/dist/cjs/data-encoding.cjs +160 -0
- package/dist/cjs/dom-binding-handoff.cjs +93 -0
- package/dist/cjs/dom-binding-protocol.cjs +115 -0
- package/dist/cjs/dom-binding-styles.cjs +292 -0
- package/dist/cjs/dom-bindings.cjs +700 -0
- package/dist/cjs/dom-focused-move.cjs +66 -0
- package/dist/cjs/dom-stage.cjs +896 -0
- package/dist/cjs/dom-tables.cjs +4 -94
- package/dist/cjs/error-codes.client.generated.cjs +33 -0
- package/dist/cjs/error-codes.server.generated.cjs +24 -0
- package/dist/cjs/hydration/control-capture.cjs +244 -0
- package/dist/cjs/hydration/event-capture.cjs +125 -43
- package/dist/cjs/hydration/interaction-config.cjs +50 -2
- package/dist/cjs/hydration-markers.cjs +37 -0
- package/dist/cjs/independent-hydration-protocol.cjs +106 -0
- package/dist/cjs/index.cjs +9 -0
- package/dist/cjs/runtime.cjs +6397 -1683
- package/dist/cjs/runtime.server.cjs +1465 -213
- package/dist/cjs/server/early-signals.cjs +45 -0
- package/dist/cjs/server/index.cjs +47 -0
- package/dist/cjs/server/rpc-batch.cjs +149 -0
- package/dist/cjs/server/rpc-stream.cjs +146 -0
- package/dist/cjs/server/rpc.cjs +34 -15
- package/dist/cjs/server/signal-query-observation.cjs +158 -0
- package/dist/cjs/server/streamed-region.cjs +52 -0
- package/dist/cjs/server/streamed-signals.cjs +512 -0
- package/dist/cjs/server-call.cjs +103 -0
- package/dist/cjs/server-rpc-batch-client.cjs +141 -0
- package/dist/cjs/server-rpc-client.cjs +94 -27
- package/dist/cjs/server-rpc-protocol.cjs +141 -0
- package/dist/cjs/server-rpc-stream-client.cjs +118 -0
- package/dist/cjs/signals/actions.cjs +474 -0
- package/dist/cjs/signals/client.cjs +4 -1
- package/dist/cjs/signals/computations.cjs +460 -0
- package/dist/cjs/signals/control-binding.cjs +368 -0
- package/dist/cjs/signals/derived-facade.cjs +50 -0
- package/dist/cjs/signals/document-owner.cjs +71 -0
- package/dist/cjs/signals/early-values.cjs +155 -0
- package/dist/cjs/signals/encoding.cjs +6 -95
- package/dist/cjs/signals/engine.cjs +276 -12
- package/dist/cjs/signals/errors.cjs +18 -0
- package/dist/cjs/signals/facade.cjs +477 -0
- package/dist/cjs/signals/graph.cjs +166 -20
- package/dist/cjs/signals/handle-protocol.cjs +36 -0
- package/dist/cjs/signals/index.cjs +81 -2
- package/dist/cjs/signals/native-read-client.cjs +10 -0
- package/dist/cjs/signals/owner-context.cjs +112 -0
- package/dist/cjs/signals/query-attempt-observer.cjs +68 -0
- package/dist/cjs/signals/query-facade.cjs +72 -0
- package/dist/cjs/signals/read-protocol.cjs +54 -0
- package/dist/cjs/signals/requests.cjs +287 -14
- package/dist/cjs/signals/scalar-computations.cjs +76 -0
- package/dist/cjs/signals/server.cjs +4 -1
- package/dist/cjs/signals/transition-candidate.cjs +567 -0
- package/dist/cjs/signals/transition-state.cjs +106 -0
- package/dist/cjs/signals/types.cjs +50 -0
- package/dist/cjs/stream-protocol.cjs +3 -0
- package/dist/cjs/streamed-signals-protocol.cjs +159 -0
- package/dist/cjs/style-values.cjs +122 -0
- package/dist/cjs/trusted-html.cjs +30 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/class-names.d.ts +5 -0
- package/dist/class-names.js +25 -0
- package/dist/compiler/bundler.js +51 -22
- package/dist/compiler/compile.js +2534 -581
- package/dist/compiler/dom-binding-program.js +935 -0
- package/dist/compiler/dom-binding-request.js +57 -0
- package/dist/compiler/dom-bindings.js +2245 -0
- package/dist/compiler/hook-deps.js +759 -10
- package/dist/compiler/hydrate-boundaries.js +358 -15
- package/dist/compiler/index.d.ts +39 -2
- package/dist/compiler/index.js +1 -0
- package/dist/compiler/native-attribute-reads.js +127 -0
- package/dist/compiler/native-change-diagnostics.js +32 -38
- package/dist/compiler/native-read-diagnostics.js +69 -8
- package/dist/compiler/native-read-types.js +80 -34
- package/dist/compiler/parser.node.js +1 -1
- package/dist/compiler/renderer-boundaries.js +40 -0
- package/dist/compiler/server-context.js +118 -0
- package/dist/compiler/signal-attempt-reads.js +479 -0
- package/dist/compiler/signal-declarations.js +557 -0
- package/dist/compiler/signal-start-reads.js +413 -0
- package/dist/compiler/slot-hooks.d.ts +3 -1
- package/dist/compiler/slot-hooks.js +168 -34
- package/dist/compiler/strong-auto-memo.js +90 -0
- package/dist/compiler/strong-html.js +143 -0
- package/dist/compiler/strong-mode.js +764 -66
- package/dist/compiler/strong-template-policy.js +307 -0
- package/dist/compiler/template-ir.js +200 -0
- package/dist/compiler/typescript.d.ts +2 -0
- package/dist/compiler/typescript.js +2 -0
- package/dist/compiler/vite.d.ts +3 -1
- package/dist/compiler/vite.js +122 -4
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.d.ts +6 -1
- package/dist/compiler/volar.js +750 -1433
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +10 -0
- package/dist/context-epoch.d.ts +2 -0
- package/dist/context-epoch.js +13 -0
- package/dist/css.d.ts +2 -5
- package/dist/css.js +2 -23
- package/dist/data-encoding.d.ts +9 -0
- package/dist/data-encoding.js +134 -0
- package/dist/dom-binding-classes.d.ts +15 -0
- package/dist/dom-binding-classes.js +129 -0
- package/dist/dom-binding-controls.d.ts +2 -0
- package/dist/dom-binding-controls.js +6 -0
- package/dist/dom-binding-handoff.d.ts +55 -0
- package/dist/dom-binding-handoff.js +62 -0
- package/dist/dom-binding-program.d.ts +300 -0
- package/dist/dom-binding-program.js +1625 -0
- package/dist/dom-binding-projections.d.ts +15 -0
- package/dist/dom-binding-projections.js +187 -0
- package/dist/dom-binding-protocol.d.ts +13 -0
- package/dist/dom-binding-protocol.js +88 -0
- package/dist/dom-binding-signals.d.ts +21 -0
- package/dist/dom-binding-signals.js +109 -0
- package/dist/dom-binding-styles.d.ts +17 -0
- package/dist/dom-binding-styles.js +272 -0
- package/dist/dom-bindings.d.ts +89 -0
- package/dist/dom-bindings.js +670 -0
- package/dist/dom-focused-move.d.ts +6 -0
- package/dist/dom-focused-move.js +42 -0
- package/dist/dom-stage.d.ts +52 -0
- package/dist/dom-stage.js +872 -0
- package/dist/dom-tables.d.ts +1 -3
- package/dist/dom-tables.js +1 -91
- package/dist/error-codes.client.generated.d.ts +9 -0
- package/dist/error-codes.client.generated.js +33 -0
- package/dist/error-codes.server.generated.d.ts +6 -0
- package/dist/error-codes.server.generated.js +24 -0
- package/dist/hydration/control-capture.d.ts +62 -0
- package/dist/hydration/control-capture.js +223 -0
- package/dist/hydration/document-lifecycle.d.ts +23 -0
- package/dist/hydration/document-lifecycle.js +80 -0
- package/dist/hydration/event-capture.d.ts +20 -1
- package/dist/hydration/event-capture.js +128 -42
- package/dist/hydration/independent-island.d.ts +45 -0
- package/dist/hydration/independent-island.js +233 -0
- package/dist/hydration/index.d.ts +8 -1
- package/dist/hydration/index.js +55 -1
- package/dist/hydration/interaction-config.d.ts +5 -0
- package/dist/hydration/interaction-config.js +44 -1
- package/dist/hydration/stream-delivery.d.ts +32 -0
- package/dist/hydration/stream-delivery.js +333 -0
- package/dist/hydration/stream-receiver.d.ts +26 -0
- package/dist/hydration/stream-receiver.js +204 -0
- package/dist/hydration/stream-result-receiver.d.ts +70 -0
- package/dist/hydration/stream-result-receiver.js +246 -0
- package/dist/hydration/streamed-signals.d.ts +44 -0
- package/dist/hydration/streamed-signals.js +186 -0
- package/dist/hydration/types.d.ts +6 -0
- package/dist/hydration-markers.d.ts +7 -0
- package/dist/hydration-markers.js +10 -0
- package/dist/independent-hydration-protocol.d.ts +31 -0
- package/dist/independent-hydration-protocol.js +80 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/internal/signal-read.d.ts +1 -0
- package/dist/internal/signal-read.js +4 -0
- package/dist/jsx-runtime-strong.d.ts +33 -0
- package/dist/jsx-runtime.d.ts +58 -2
- package/dist/public-types.d.ts +15 -1
- package/dist/runtime.d.ts +297 -23
- package/dist/runtime.js +6405 -1679
- package/dist/runtime.server.d.ts +110 -27
- package/dist/runtime.server.js +1458 -213
- package/dist/server/early-signals.d.ts +14 -0
- package/dist/server/early-signals.js +34 -0
- package/dist/server/index.d.ts +11 -2
- package/dist/server/index.js +50 -1
- package/dist/server/rpc-batch.d.ts +17 -0
- package/dist/server/rpc-batch.js +129 -0
- package/dist/server/rpc-stream.d.ts +9 -0
- package/dist/server/rpc-stream.js +125 -0
- package/dist/server/rpc.d.ts +5 -1
- package/dist/server/rpc.js +37 -13
- package/dist/server/signal-query-observation.d.ts +3 -0
- package/dist/server/signal-query-observation.js +134 -0
- package/dist/server/streamed-region.d.ts +15 -0
- package/dist/server/streamed-region.js +30 -0
- package/dist/server/streamed-signals.d.ts +45 -0
- package/dist/server/streamed-signals.js +488 -0
- package/dist/server-call.d.ts +41 -0
- package/dist/server-call.js +75 -0
- package/dist/server-rpc-batch-client.d.ts +7 -0
- package/dist/server-rpc-batch-client.js +119 -0
- package/dist/server-rpc-client.d.ts +3 -1
- package/dist/server-rpc-client.js +99 -27
- package/dist/server-rpc-protocol.d.ts +47 -0
- package/dist/server-rpc-protocol.js +109 -0
- package/dist/server-rpc-stream-client.d.ts +5 -0
- package/dist/server-rpc-stream-client.js +98 -0
- package/dist/signals/actions.d.ts +12 -0
- package/dist/signals/actions.js +466 -0
- package/dist/signals/client.d.ts +2 -0
- package/dist/signals/client.js +1 -0
- package/dist/signals/computations.d.ts +37 -0
- package/dist/signals/computations.js +455 -0
- package/dist/signals/control-binding.d.ts +31 -0
- package/dist/signals/control-binding.js +353 -0
- package/dist/signals/derived-facade.d.ts +3 -0
- package/dist/signals/derived-facade.js +25 -0
- package/dist/signals/document-owner.d.ts +10 -0
- package/dist/signals/document-owner.js +43 -0
- package/dist/signals/early-values.d.ts +24 -0
- package/dist/signals/early-values.js +124 -0
- package/dist/signals/encoding.d.ts +1 -3
- package/dist/signals/encoding.js +3 -93
- package/dist/signals/engine.d.ts +53 -4
- package/dist/signals/engine.js +275 -16
- package/dist/signals/errors.d.ts +7 -0
- package/dist/signals/errors.js +16 -0
- package/dist/signals/facade.d.ts +74 -0
- package/dist/signals/facade.js +452 -0
- package/dist/signals/graph.d.ts +52 -6
- package/dist/signals/graph.js +174 -19
- package/dist/signals/handle-protocol.d.ts +4 -0
- package/dist/signals/handle-protocol.js +11 -0
- package/dist/signals/index.d.ts +12 -3
- package/dist/signals/index.js +71 -2
- package/dist/signals/native-read-client.d.ts +3 -0
- package/dist/signals/native-read-client.js +10 -0
- package/dist/signals/owner-context.d.ts +22 -0
- package/dist/signals/owner-context.js +77 -0
- package/dist/signals/query-attempt-observer.d.ts +49 -0
- package/dist/signals/query-attempt-observer.js +41 -0
- package/dist/signals/query-facade.d.ts +3 -0
- package/dist/signals/query-facade.js +49 -0
- package/dist/signals/read-protocol.d.ts +37 -2
- package/dist/signals/read-protocol.js +44 -0
- package/dist/signals/requests.d.ts +38 -5
- package/dist/signals/requests.js +298 -15
- package/dist/signals/scalar-computations.d.ts +2 -0
- package/dist/signals/scalar-computations.js +60 -0
- package/dist/signals/server.d.ts +2 -0
- package/dist/signals/server.js +1 -0
- package/dist/signals/transition-candidate.d.ts +71 -0
- package/dist/signals/transition-candidate.js +557 -0
- package/dist/signals/transition-state.d.ts +51 -0
- package/dist/signals/transition-state.js +70 -0
- package/dist/signals/types.d.ts +95 -5
- package/dist/signals/types.js +20 -0
- package/dist/stream-protocol.d.ts +0 -5
- package/dist/stream-protocol.js +3 -0
- package/dist/streamed-signals-protocol.d.ts +60 -0
- package/dist/streamed-signals-protocol.js +130 -0
- package/dist/style-values.d.ts +3 -0
- package/dist/style-values.js +96 -0
- package/dist/trusted-html.d.ts +17 -0
- package/dist/trusted-html.js +6 -0
- package/dist/universal-core.d.ts +6 -0
- package/dist/universal-core.js +214 -202
- package/dist/version.js +1 -1
- package/package.json +48 -5
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { decodeSignalValue, encodeSignalValue } from "./data-encoding.js";
|
|
2
|
+
function plainRecord(value) {
|
|
3
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
4
|
+
const prototype = Object.getPrototypeOf(value);
|
|
5
|
+
if (prototype !== Object.prototype && prototype !== null) return false;
|
|
6
|
+
return Reflect.ownKeys(value).every((key2) => {
|
|
7
|
+
if (typeof key2 !== "string") return false;
|
|
8
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key2);
|
|
9
|
+
return descriptor.enumerable && "value" in descriptor;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function key(value) {
|
|
13
|
+
return typeof value === "string" && value.length > 0 && value.length <= 1024;
|
|
14
|
+
}
|
|
15
|
+
function uniqueKeys(value) {
|
|
16
|
+
return Array.isArray(value) && value.every(key) && new Set(value).size === value.length;
|
|
17
|
+
}
|
|
18
|
+
function captures(value, count) {
|
|
19
|
+
if (!Array.isArray(value) || value.length !== count) return false;
|
|
20
|
+
try {
|
|
21
|
+
for (const capture of value) decodeSignalValue(capture);
|
|
22
|
+
return true;
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function isIndependentHydrateManifest(value) {
|
|
28
|
+
if (!plainRecord(value)) return false;
|
|
29
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
30
|
+
"version",
|
|
31
|
+
"buildId",
|
|
32
|
+
"boundaryId",
|
|
33
|
+
"moduleId",
|
|
34
|
+
"exportName",
|
|
35
|
+
"captureSchema",
|
|
36
|
+
"captures",
|
|
37
|
+
"hookSeed",
|
|
38
|
+
"idSeed",
|
|
39
|
+
"signalSites",
|
|
40
|
+
"styles",
|
|
41
|
+
"parentDependencies"
|
|
42
|
+
]);
|
|
43
|
+
if (!Object.keys(value).every((name) => allowed.has(name))) return false;
|
|
44
|
+
if (value.version !== 1 || !key(value.buildId) || !key(value.boundaryId) || !key(value.moduleId) || !key(value.exportName) || !Number.isSafeInteger(value.hookSeed) || value.hookSeed < 0 || !Number.isSafeInteger(value.idSeed) || value.idSeed < 0 || value.parentDependencies !== false || !uniqueKeys(value.signalSites) || !uniqueKeys(value.styles) || !Array.isArray(value.captureSchema)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const names = /* @__PURE__ */ new Set();
|
|
48
|
+
for (const capture of value.captureSchema) {
|
|
49
|
+
if (!plainRecord(capture) || Object.keys(capture).length !== 2 || !key(capture.name) || capture.type !== "json" || names.has(capture.name)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
names.add(capture.name);
|
|
53
|
+
}
|
|
54
|
+
return captures(value.captures, value.captureSchema.length);
|
|
55
|
+
}
|
|
56
|
+
function createIndependentHydrateManifest(template, values, instanceBoundaryId, buildId, build) {
|
|
57
|
+
const manifest = {
|
|
58
|
+
...template,
|
|
59
|
+
buildId,
|
|
60
|
+
boundaryId: instanceBoundaryId,
|
|
61
|
+
moduleId: build.moduleId,
|
|
62
|
+
captures: values.map((value) => encodeSignalValue(value)),
|
|
63
|
+
styles: build.styles
|
|
64
|
+
};
|
|
65
|
+
if (!isIndependentHydrateManifest(manifest)) {
|
|
66
|
+
throw new TypeError("Invalid independent Hydrate manifest inputs.");
|
|
67
|
+
}
|
|
68
|
+
return Object.freeze(manifest);
|
|
69
|
+
}
|
|
70
|
+
function serializeIndependentHydrateManifest(manifest) {
|
|
71
|
+
if (!isIndependentHydrateManifest(manifest)) {
|
|
72
|
+
throw new TypeError("Invalid independent Hydrate manifest.");
|
|
73
|
+
}
|
|
74
|
+
return JSON.stringify(manifest).replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
createIndependentHydrateManifest,
|
|
78
|
+
isIndependentHydrateManifest,
|
|
79
|
+
serializeIndependentHydrateManifest
|
|
80
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { trustHTML, type TrustedHTML } from './trusted-html.js';
|
|
1
2
|
export { version } from './version.js';
|
|
2
3
|
export type * from './public-types.js';
|
|
3
4
|
export { StrictMode, unstable_batchedUpdates } from './compatibility.js';
|
|
@@ -8,4 +9,6 @@ export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlo
|
|
|
8
9
|
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, evt1e, evt2e, evtN, evtNu, setEventHandler, devEventListener, devHtmlNesting, htext, htextSwap, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, isHydratingStyle, setStyle, setStyleProperty, setStyleProperties, 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
10
|
export type { HydrateOptions, HydrateProps, HydrateWhen, HydrationInteractionEvent, HydrationInteractionEvents, HydrationPrefetchContext, HydrationPrefetchFunction, HydrationPrefetchStrategy, HydrationPrefetchWaitReason, HydrationStrategy, HydrationWhen, } from './hydration/types.js';
|
|
10
11
|
export { __serverRpc } from './server-rpc-client.js';
|
|
12
|
+
export { ServerCallUncertainError } from './server-rpc-protocol.js';
|
|
13
|
+
export { batchServerCalls, type ServerCallBatchOptions } from './server-rpc-batch-client.js';
|
|
11
14
|
export { __methodDep } from './method-dep.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { trustHTML } from "./trusted-html.js";
|
|
1
2
|
import { version } from "./version.js";
|
|
2
3
|
import { StrictMode, unstable_batchedUpdates } from "./compatibility.js";
|
|
3
4
|
import { initializeHydrationEventCapture } from "./hydration/event-capture.js";
|
|
@@ -220,6 +221,8 @@ import {
|
|
|
220
221
|
getTransitionFallbackTimeout
|
|
221
222
|
} from "./runtime.js";
|
|
222
223
|
import { __serverRpc } from "./server-rpc-client.js";
|
|
224
|
+
import { ServerCallUncertainError } from "./server-rpc-protocol.js";
|
|
225
|
+
import { batchServerCalls } from "./server-rpc-batch-client.js";
|
|
223
226
|
import { __methodDep } from "./method-dep.js";
|
|
224
227
|
export {
|
|
225
228
|
Activity,
|
|
@@ -231,6 +234,7 @@ export {
|
|
|
231
234
|
HMR,
|
|
232
235
|
HYDRATION_RANGE_BOUNDARY,
|
|
233
236
|
Hydrate,
|
|
237
|
+
ServerCallUncertainError,
|
|
234
238
|
StrictMode,
|
|
235
239
|
Suspense,
|
|
236
240
|
TsrxErrorBoundary,
|
|
@@ -267,6 +271,7 @@ export {
|
|
|
267
271
|
bag8,
|
|
268
272
|
bag9,
|
|
269
273
|
bagOf,
|
|
274
|
+
batchServerCalls,
|
|
270
275
|
bindRendererRegionOwner,
|
|
271
276
|
child,
|
|
272
277
|
childSlot,
|
|
@@ -410,6 +415,7 @@ export {
|
|
|
410
415
|
template,
|
|
411
416
|
textHole,
|
|
412
417
|
textSlot,
|
|
418
|
+
trustHTML,
|
|
413
419
|
tryBlock,
|
|
414
420
|
Activity2 as unstable_Activity,
|
|
415
421
|
ViewTransition2 as unstable_ViewTransition,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { readNativeDomValue } from '../signals/read-protocol.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Strong mode's DOM JSX contract; component props keep their authored types. */
|
|
2
|
+
import type { JSX as CompatibilityJSX } from './jsx-runtime.js';
|
|
3
|
+
import type { TrustedHTML } from './trusted-html.js';
|
|
4
|
+
|
|
5
|
+
export { Fragment, jsx, jsxs, jsxDEV } from './jsx-runtime.js';
|
|
6
|
+
export type {
|
|
7
|
+
ClassValue,
|
|
8
|
+
CSSProperties,
|
|
9
|
+
SignalCSSProperties,
|
|
10
|
+
OctaneElement,
|
|
11
|
+
} from './jsx-runtime.js';
|
|
12
|
+
|
|
13
|
+
type StrongIntrinsicProps<P> = Omit<
|
|
14
|
+
P,
|
|
15
|
+
'dangerouslySetInnerHTML' | 'suppressHydrationWarning' | 'suppressNativeChangeWarning'
|
|
16
|
+
> & {
|
|
17
|
+
dangerouslySetInnerHTML?: TrustedHTML | null | undefined;
|
|
18
|
+
suppressHydrationWarning?: never;
|
|
19
|
+
suppressNativeChangeWarning?: never;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export namespace JSX {
|
|
23
|
+
export type Element = CompatibilityJSX.Element;
|
|
24
|
+
export type ElementType = CompatibilityJSX.ElementType;
|
|
25
|
+
export type ElementChildrenAttribute = CompatibilityJSX.ElementChildrenAttribute;
|
|
26
|
+
export type IntrinsicAttributes = CompatibilityJSX.IntrinsicAttributes;
|
|
27
|
+
export type IntrinsicClassAttributes<T> = CompatibilityJSX.IntrinsicClassAttributes<T>;
|
|
28
|
+
export type IntrinsicElements = {
|
|
29
|
+
[K in keyof CompatibilityJSX.IntrinsicElements]: StrongIntrinsicProps<
|
|
30
|
+
CompatibilityJSX.IntrinsicElements[K]
|
|
31
|
+
>;
|
|
32
|
+
};
|
|
33
|
+
}
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
* `.tsx` sources) can type-check JSX against octane's real contract.
|
|
42
42
|
*/
|
|
43
43
|
import type * as React from 'react';
|
|
44
|
+
import type * as CSS from 'csstype';
|
|
44
45
|
import type { ElementDescriptor, FragmentInstance } from './index.js';
|
|
46
|
+
import type { SignalHandle } from './signals/types.js';
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
49
|
* Octane's element type — the analog of React's `ReactElement`, and what a
|
|
@@ -53,10 +55,21 @@ import type { ElementDescriptor, FragmentInstance } from './index.js';
|
|
|
53
55
|
*/
|
|
54
56
|
export interface OctaneElement<P = any> extends ElementDescriptor<P> {}
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
/** Inline styles use Octane's numeric length coercion for both property spellings. */
|
|
59
|
+
export interface CSSProperties extends React.CSSProperties, CSS.PropertiesHyphen<string | number> {
|
|
57
60
|
cssFloat?: React.CSSProperties['float'];
|
|
61
|
+
/** Element-scoped View Transition isolation, including authored `!important` values. */
|
|
62
|
+
viewTransitionScope?: 'none' | 'all' | (string & {});
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
/** Native DOM style values; plain CSSProperties remains usable by CSS-consuming libraries. */
|
|
66
|
+
export type SignalCSSProperties = {
|
|
67
|
+
[K in keyof CSSProperties]: CSSProperties[K] | SignalHandle<CSSProperties[K] | null>;
|
|
68
|
+
} & {
|
|
69
|
+
[customProperty: `--${string}`]:
|
|
70
|
+
string | number | SignalHandle<string | number | null | undefined> | undefined;
|
|
71
|
+
};
|
|
72
|
+
|
|
60
73
|
export type ClassValue =
|
|
61
74
|
| string
|
|
62
75
|
| number
|
|
@@ -132,6 +145,19 @@ type ExistingButtonAttribute<
|
|
|
132
145
|
Fallback,
|
|
133
146
|
> = K extends keyof React.ButtonHTMLAttributes<T> ? React.ButtonHTMLAttributes<T>[K] : Fallback;
|
|
134
147
|
|
|
148
|
+
/** Uncontrolled initialization and framework instructions are not live bindings. */
|
|
149
|
+
type UnboundProps =
|
|
150
|
+
| 'defaultValue'
|
|
151
|
+
| 'defaultChecked'
|
|
152
|
+
| 'dangerouslySetInnerHTML'
|
|
153
|
+
| 'suppressContentEditableWarning'
|
|
154
|
+
| 'suppressHydrationWarning'
|
|
155
|
+
| 'suppressNativeChangeWarning'
|
|
156
|
+
| '__octaneNativeChangeDiagnostic'
|
|
157
|
+
| 'ref'
|
|
158
|
+
| 'key'
|
|
159
|
+
| 'children';
|
|
160
|
+
|
|
135
161
|
/** Octane's attribute transform over one React attribute interface. */
|
|
136
162
|
type Transformed<P, T> = Omit<P, ReactSyntheticProps | 'className' | 'style' | 'children'> &
|
|
137
163
|
NativeEventHandlers<P, T & EventTarget> & {
|
|
@@ -143,6 +169,28 @@ type Transformed<P, T> = Omit<P, ReactSyntheticProps | 'className' | 'style' | '
|
|
|
143
169
|
children?: unknown;
|
|
144
170
|
};
|
|
145
171
|
|
|
172
|
+
type BoundStyle<S> = S | SignalCSSProperties | null | SignalHandle<S | SignalCSSProperties | null>;
|
|
173
|
+
|
|
174
|
+
/** Provider-owned compiler attributes. Augment without widening component props or signal types. */
|
|
175
|
+
export interface NativeAttributeExtensions {}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Only a host JSX site installs direct bindings. Keep reusable attribute and
|
|
179
|
+
* component-prop types scalar: their consumers may read values imperatively.
|
|
180
|
+
* A component can explicitly opt in with SignalHandle or this JSX namespace.
|
|
181
|
+
*/
|
|
182
|
+
type BoundIntrinsicProps<P> = {
|
|
183
|
+
[K in keyof P]: K extends UnboundProps | ReactSyntheticProps
|
|
184
|
+
? P[K]
|
|
185
|
+
: K extends 'style'
|
|
186
|
+
? BoundStyle<P[K]>
|
|
187
|
+
: P[K] | SignalHandle<P[K]>;
|
|
188
|
+
} & NativeAttributeExtensions;
|
|
189
|
+
|
|
190
|
+
type BoundIntrinsicElements = {
|
|
191
|
+
[K in keyof Octane.JSX.IntrinsicElements]: BoundIntrinsicProps<Octane.JSX.IntrinsicElements[K]>;
|
|
192
|
+
};
|
|
193
|
+
|
|
146
194
|
declare namespace Octane {
|
|
147
195
|
type Key = string | number | bigint;
|
|
148
196
|
|
|
@@ -599,7 +647,15 @@ declare namespace Octane {
|
|
|
599
647
|
}
|
|
600
648
|
}
|
|
601
649
|
|
|
602
|
-
|
|
650
|
+
/** Automatic JSX runtime types include the host's direct signal bindings. */
|
|
651
|
+
export namespace JSX {
|
|
652
|
+
type ElementType = Octane.JSX.ElementType;
|
|
653
|
+
interface Element extends Octane.JSX.Element {}
|
|
654
|
+
interface ElementChildrenAttribute extends Octane.JSX.ElementChildrenAttribute {}
|
|
655
|
+
interface IntrinsicAttributes extends Octane.JSX.IntrinsicAttributes {}
|
|
656
|
+
interface IntrinsicClassAttributes<T> extends Octane.JSX.IntrinsicClassAttributes<T> {}
|
|
657
|
+
interface IntrinsicElements extends BoundIntrinsicElements {}
|
|
658
|
+
}
|
|
603
659
|
export { Octane };
|
|
604
660
|
|
|
605
661
|
// The automatic-runtime entry points, for type resolution only — octane's
|
package/dist/public-types.d.ts
CHANGED
|
@@ -2,7 +2,21 @@
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import type { Octane } from './jsx-runtime.js';
|
|
4
4
|
import type { Activity, Context, ElementDescriptor, OctaneNode, PortalDescriptor, Suspense } from './runtime.js';
|
|
5
|
-
export type {
|
|
5
|
+
export type { Octane, OctaneElement, ClassValue, CSSProperties, SignalCSSProperties, } from './jsx-runtime.js';
|
|
6
|
+
/** Reusable component props remain scalar; the automatic JSX runtime adds bindings. */
|
|
7
|
+
export declare namespace JSX {
|
|
8
|
+
type ElementType = Octane.JSX.ElementType;
|
|
9
|
+
interface Element extends Octane.JSX.Element {
|
|
10
|
+
}
|
|
11
|
+
interface ElementChildrenAttribute extends Octane.JSX.ElementChildrenAttribute {
|
|
12
|
+
}
|
|
13
|
+
interface IntrinsicAttributes extends Octane.JSX.IntrinsicAttributes {
|
|
14
|
+
}
|
|
15
|
+
interface IntrinsicClassAttributes<T> extends Octane.JSX.IntrinsicClassAttributes<T> {
|
|
16
|
+
}
|
|
17
|
+
interface IntrinsicElements extends Octane.JSX.IntrinsicElements {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
6
20
|
/** Migration alias. New Octane code should use OctaneNode. */
|
|
7
21
|
export type ReactNode = OctaneNode;
|
|
8
22
|
export type ReactElement<P = any, T extends ElementDescriptor<P>['type'] = ElementDescriptor<P>['type']> = ElementDescriptor<P> & {
|