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.
@@ -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;
@@ -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: d.children ?? d.props?.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" ' + SUSPENSE_SCRIPT_ATTR + nonceAttr + ">" + json + "</script>";
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" ' + NATIVE_SIGNAL_SEED_ATTR + nonceAttr + ">" + json + "</script>";
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
@@ -1,4 +1,4 @@
1
- const version = "0.2.4";
1
+ const version = "0.2.6";
2
2
  export {
3
3
  version
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octane",
3
- "version": "0.2.4",
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.67",
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.67",
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": "^19.2.7",
194
- "react-dom": "^19.2.7",
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",