octane 0.2.4 → 0.2.6
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/dist/cjs/constants.cjs +9 -0
- package/dist/cjs/error-codes.client.generated.cjs +2 -0
- package/dist/cjs/host-property-diagnostics.cjs +2 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/runtime.cjs +482 -51
- package/dist/cjs/runtime.server.cjs +23 -6
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/bundler.js +7 -1
- package/dist/compiler/compile.js +12 -0
- package/dist/compiler/hook-methods.js +164 -0
- package/dist/compiler/parser-output.js +37 -0
- package/dist/compiler/parser.browser.js +145 -1
- package/dist/compiler/parser.node.js +1 -35
- package/dist/compiler/plain-hook-memo.js +37 -0
- package/dist/compiler/slot-hooks.js +129 -5
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.js +186 -43
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +6 -0
- package/dist/error-codes.client.generated.d.ts +1 -0
- package/dist/error-codes.client.generated.js +2 -0
- package/dist/host-property-diagnostics.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/runtime.d.ts +16 -12
- package/dist/runtime.js +483 -51
- package/dist/runtime.server.d.ts +2 -0
- package/dist/runtime.server.js +25 -6
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/dist/runtime.server.d.ts
CHANGED
|
@@ -560,6 +560,8 @@ export declare function markWarm<T extends Function>(component: T, plan: unknown
|
|
|
560
560
|
export declare function invokeManualHook<T>(fn: (...args: any[]) => T, receiver: unknown, args: IArguments): T;
|
|
561
561
|
/** @internal Adapt an expression provider that owns the trailing hook-slot ABI. */
|
|
562
562
|
export declare function manualHook<F extends (...args: any[]) => any>(fn: F, name?: string): F;
|
|
563
|
+
/** Invoke a cached optional-chain method without consulting its call/bind properties. */
|
|
564
|
+
export declare function callWithReceiver<T>(fn: (...args: any[]) => T, receiver: unknown, ...args: any[]): T;
|
|
563
565
|
export declare function withSlot<T>(sym: symbol, fn: (...a: any[]) => T, ...args: any[]): T;
|
|
564
566
|
export declare function startTransition(fn: () => void | Promise<unknown>): void;
|
|
565
567
|
export declare function flushSync<T>(fn: () => T): T;
|
package/dist/runtime.server.js
CHANGED
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
FOR_BLOCK_OPEN_ITEMS,
|
|
6
6
|
EMPTY_COMMENT,
|
|
7
7
|
SUSPENSE_SCRIPT_ATTR,
|
|
8
|
+
SUSPENSE_RESOLVED_COMMENT,
|
|
9
|
+
SUSPENSE_RESOLVED_SEED_ATTR,
|
|
10
|
+
SUSPENSE_RESOLVED_NATIVE_ATTR,
|
|
8
11
|
SUSPENSE_SEED_WIRE_PREFIX,
|
|
9
12
|
REJECTION_SENTINEL_KEY,
|
|
10
13
|
EXTERNAL_HYDRATION_PROMISE,
|
|
@@ -870,9 +873,13 @@ function ssrComponentDescriptor(d, scope) {
|
|
|
870
873
|
if (SCOPED_ELEMENT_PROPS.has(d.props)) {
|
|
871
874
|
return ssrComponent(scope, d.type, d.props);
|
|
872
875
|
}
|
|
876
|
+
const children = d.children;
|
|
877
|
+
if (children == null || children === d.props?.children) {
|
|
878
|
+
return ssrComponent(scope, d.type, d.props);
|
|
879
|
+
}
|
|
873
880
|
return ssrComponent(scope, d.type, {
|
|
874
881
|
...d.props,
|
|
875
|
-
children
|
|
882
|
+
children
|
|
876
883
|
});
|
|
877
884
|
}
|
|
878
885
|
function ssrChild(v, scope) {
|
|
@@ -1504,7 +1511,7 @@ function ssrAttrs(sources, tag, namespace = "html", skipFormControls = false) {
|
|
|
1504
1511
|
record(name, source[name]);
|
|
1505
1512
|
}
|
|
1506
1513
|
}
|
|
1507
|
-
if (process.env.NODE_ENV === "production") {
|
|
1514
|
+
if (process.env.NODE_ENV === "production" && classMerges === null) {
|
|
1508
1515
|
let canonical = true;
|
|
1509
1516
|
for (const name of props.keys()) {
|
|
1510
1517
|
if (normalizeSsrAttributeName(name, tag, namespace) !== name || namespace === "html" && name.toLowerCase() !== name) {
|
|
@@ -3563,6 +3570,9 @@ function manualHook(fn, name) {
|
|
|
3563
3570
|
Object.defineProperty(provider, "length", { value: fn.length, configurable: true });
|
|
3564
3571
|
return provider;
|
|
3565
3572
|
}
|
|
3573
|
+
function callWithReceiver(fn, receiver, ...args) {
|
|
3574
|
+
return NATIVE_REFLECT_APPLY(fn, receiver, args);
|
|
3575
|
+
}
|
|
3566
3576
|
function withSlot(sym, fn, ...args) {
|
|
3567
3577
|
const driver = MANUAL_HOOK_DRIVER;
|
|
3568
3578
|
const pending = driver?.pending;
|
|
@@ -3747,14 +3757,14 @@ function serializeSuspenseSeedJson(values) {
|
|
|
3747
3757
|
return value;
|
|
3748
3758
|
}).replace(/</g, "\\u003c");
|
|
3749
3759
|
}
|
|
3750
|
-
function serializeSuspenseSeeds(values, nonceAttr) {
|
|
3760
|
+
function serializeSuspenseSeeds(values, nonceAttr, attr = SUSPENSE_SCRIPT_ATTR) {
|
|
3751
3761
|
const json = serializeSuspenseSeedJson(values);
|
|
3752
3762
|
if (json === "[]") return "";
|
|
3753
|
-
return '<script type="application/json" ' +
|
|
3763
|
+
return '<script type="application/json" ' + attr + nonceAttr + ">" + json + "</script>";
|
|
3754
3764
|
}
|
|
3755
|
-
function serializeNativeSignalSeeds(signals, nonceAttr) {
|
|
3765
|
+
function serializeNativeSignalSeeds(signals, nonceAttr, attr = NATIVE_SIGNAL_SEED_ATTR) {
|
|
3756
3766
|
const json = JSON.stringify(signals).replace(/</g, "\\u003c");
|
|
3757
|
-
return '<script type="application/json" ' +
|
|
3767
|
+
return '<script type="application/json" ' + attr + nonceAttr + ">" + json + "</script>";
|
|
3758
3768
|
}
|
|
3759
3769
|
function newResolvedMap(resourceOptions) {
|
|
3760
3770
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -4749,6 +4759,14 @@ function ssrTry(scope, siteKey, tryFn, pendFn, catchFn, namespace = FRAME?.names
|
|
|
4749
4759
|
return pendingForm();
|
|
4750
4760
|
}
|
|
4751
4761
|
appendNativeSeedReads(nativeReads);
|
|
4762
|
+
if (MARKERS && pendFn !== null) {
|
|
4763
|
+
const idCount = ID_COUNTER - outerIdCounter;
|
|
4764
|
+
const seeds = SERIAL === null ? [] : SERIAL.splice(serialStart);
|
|
4765
|
+
const native = NATIVE_READ_COLLECTOR?.serialize(nativeReads);
|
|
4766
|
+
return ssrBlock(
|
|
4767
|
+
`<!--${SUSPENSE_RESOLVED_COMMENT}${idCount}-->` + (seeds.length === 0 ? "" : serializeSuspenseSeeds(seeds, NONCE_ATTR, SUSPENSE_RESOLVED_SEED_ATTR)) + (native === void 0 ? "" : serializeNativeSignalSeeds(native, NONCE_ATTR, SUSPENSE_RESOLVED_NATIVE_ATTR)) + inner
|
|
4768
|
+
);
|
|
4769
|
+
}
|
|
4752
4770
|
return ssrBlock(inner);
|
|
4753
4771
|
} catch (e) {
|
|
4754
4772
|
nativeFresh = NATIVE_SERVER_FAILURES !== nativeFailureStart;
|
|
@@ -6080,6 +6098,7 @@ export {
|
|
|
6080
6098
|
addTransitionType,
|
|
6081
6099
|
beginNativeReadScope,
|
|
6082
6100
|
beginNativeReadWitness,
|
|
6101
|
+
callWithReceiver,
|
|
6083
6102
|
cloneElement,
|
|
6084
6103
|
createContext,
|
|
6085
6104
|
createElement,
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "octane",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"access": "public"
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@tsrx/core": "^0.1.
|
|
154
|
+
"@tsrx/core": "^0.1.69",
|
|
155
155
|
"@types/react": "^19.2.17",
|
|
156
156
|
"@volar/language-core": "2.4.28",
|
|
157
157
|
"@volar/typescript": "2.4.28",
|
|
@@ -183,15 +183,15 @@
|
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
|
-
"@tsrx/react": "^0.2.
|
|
186
|
+
"@tsrx/react": "^0.2.69",
|
|
187
187
|
"@types/react-dom": "^19.2.3",
|
|
188
188
|
"@wagmi/connectors": "8.0.25",
|
|
189
189
|
"@wagmi/core": "3.6.4",
|
|
190
190
|
"esbuild": "^0.28.1",
|
|
191
191
|
"happy-dom": "^20.11.0",
|
|
192
192
|
"playwright": "^1.61.1",
|
|
193
|
-
"react": "
|
|
194
|
-
"react-dom": "
|
|
193
|
+
"react": "19.2.7",
|
|
194
|
+
"react-dom": "19.2.7",
|
|
195
195
|
"typescript": "^5.9.3",
|
|
196
196
|
"viem": "2.55.10",
|
|
197
197
|
"vite": "^8.1.5",
|