octane 0.6.2 → 0.7.0

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 (200) hide show
  1. package/dist/cjs/constants.cjs +3 -0
  2. package/dist/cjs/dom-binding-handoff.cjs +2 -1
  3. package/dist/cjs/dom-binding-protocol.cjs +4 -3
  4. package/dist/cjs/dom-binding-styles.cjs +3 -2
  5. package/dist/cjs/dom-bindings.cjs +24 -23
  6. package/dist/cjs/error-codes.client.generated.cjs +7 -1
  7. package/dist/cjs/error-codes.server.generated.cjs +27 -1
  8. package/dist/cjs/hydration/event-capture.cjs +2 -1
  9. package/dist/cjs/independent-hydration-protocol.cjs +3 -2
  10. package/dist/cjs/index.cjs +2 -0
  11. package/dist/cjs/runtime.cjs +866 -370
  12. package/dist/cjs/runtime.server.cjs +250 -62
  13. package/dist/cjs/server/index.cjs +2 -0
  14. package/dist/cjs/server/rpc-stream.cjs +19 -12
  15. package/dist/cjs/server/streamed-signals.cjs +18 -1
  16. package/dist/cjs/shared-value-helpers.cjs +24 -2
  17. package/dist/cjs/signals/control-binding.cjs +7 -6
  18. package/dist/cjs/signals/derived-facade.cjs +2 -1
  19. package/dist/cjs/signals/document-owner.cjs +4 -3
  20. package/dist/cjs/signals/facade.cjs +10 -9
  21. package/dist/cjs/signals/graph.cjs +5 -4
  22. package/dist/cjs/signals/native-read-client.cjs +4 -3
  23. package/dist/cjs/signals/owner-context.cjs +4 -3
  24. package/dist/cjs/signals/query-attempt-observer.cjs +2 -1
  25. package/dist/cjs/signals/query-facade.cjs +2 -1
  26. package/dist/cjs/signals/scalar-computations.cjs +2 -1
  27. package/dist/cjs/signals/transition-action.cjs +10 -9
  28. package/dist/cjs/signals/transition-candidate.cjs +2 -1
  29. package/dist/cjs/version.cjs +1 -1
  30. package/dist/compiler/arm-exits.js +151 -0
  31. package/dist/compiler/compile-universal.js +262 -65
  32. package/dist/compiler/compile.js +1929 -306
  33. package/dist/compiler/deferred-snapshots.js +791 -0
  34. package/dist/compiler/strong-mode.js +59 -10
  35. package/dist/constants.d.ts +5 -1
  36. package/dist/constants.js +2 -0
  37. package/dist/error-codes.client.generated.d.ts +1 -0
  38. package/dist/error-codes.client.generated.js +5 -0
  39. package/dist/error-codes.server.generated.d.ts +5 -0
  40. package/dist/error-codes.server.generated.js +25 -0
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +2 -0
  43. package/dist/node/aria-diagnostics.js +92 -0
  44. package/dist/node/behavior-form-submissions.js +228 -0
  45. package/dist/node/behavior-root-types.js +0 -0
  46. package/dist/node/behavior-root.js +746 -0
  47. package/dist/node/class-names.js +25 -0
  48. package/dist/node/compatibility.js +10 -0
  49. package/dist/node/component-flags.js +23 -0
  50. package/dist/node/constants.js +115 -0
  51. package/dist/node/context-epoch.js +13 -0
  52. package/dist/node/context-identity.js +46 -0
  53. package/dist/node/css.js +80 -0
  54. package/dist/node/data-encoding.js +134 -0
  55. package/dist/node/devtools-hook.js +229 -0
  56. package/dist/node/dom-binding-claims.js +4 -0
  57. package/dist/node/dom-binding-classes.js +152 -0
  58. package/dist/node/dom-binding-controls.js +6 -0
  59. package/dist/node/dom-binding-handoff.js +77 -0
  60. package/dist/node/dom-binding-program.js +1617 -0
  61. package/dist/node/dom-binding-projections.js +204 -0
  62. package/dist/node/dom-binding-protocol.js +130 -0
  63. package/dist/node/dom-binding-signals.js +135 -0
  64. package/dist/node/dom-binding-styles.js +280 -0
  65. package/dist/node/dom-bindings.js +1087 -0
  66. package/dist/node/dom-focused-move.js +46 -0
  67. package/dist/node/dom-stage.js +878 -0
  68. package/dist/node/dom-tables.js +382 -0
  69. package/dist/node/error-codes.client.generated.js +1071 -0
  70. package/dist/node/error-codes.server.generated.js +761 -0
  71. package/dist/node/error-message.js +27 -0
  72. package/dist/node/event-names.js +15 -0
  73. package/dist/node/form-diagnostics.js +96 -0
  74. package/dist/node/form-submission.js +43 -0
  75. package/dist/node/has-own.js +4 -0
  76. package/dist/node/head-ownership.js +31 -0
  77. package/dist/node/hook-slot-cache.js +91 -0
  78. package/dist/node/host-property-diagnostics.js +189 -0
  79. package/dist/node/html-tree-validation.js +193 -0
  80. package/dist/node/hydration/condition.js +15 -0
  81. package/dist/node/hydration/control-capture.js +237 -0
  82. package/dist/node/hydration/document-lifecycle.js +89 -0
  83. package/dist/node/hydration/event-capture.js +362 -0
  84. package/dist/node/hydration/idle.js +23 -0
  85. package/dist/node/hydration/independent-island.js +317 -0
  86. package/dist/node/hydration/index.js +74 -0
  87. package/dist/node/hydration/interaction-config.js +61 -0
  88. package/dist/node/hydration/interaction.js +35 -0
  89. package/dist/node/hydration/load.js +15 -0
  90. package/dist/node/hydration/media.js +33 -0
  91. package/dist/node/hydration/native-intent.js +68 -0
  92. package/dist/node/hydration/never.js +12 -0
  93. package/dist/node/hydration/stream-delivery.js +345 -0
  94. package/dist/node/hydration/stream-receiver.js +190 -0
  95. package/dist/node/hydration/stream-result-receiver.js +276 -0
  96. package/dist/node/hydration/streamed-signals.js +186 -0
  97. package/dist/node/hydration/types.js +0 -0
  98. package/dist/node/hydration/visible.js +69 -0
  99. package/dist/node/hydration-markers.js +44 -0
  100. package/dist/node/independent-hydration-protocol.js +91 -0
  101. package/dist/node/index.js +463 -0
  102. package/dist/node/internal/client.js +7 -0
  103. package/dist/node/internal/context.js +5 -0
  104. package/dist/node/internal/server.js +5 -0
  105. package/dist/node/internal/signal-read.js +4 -0
  106. package/dist/node/method-dep.js +25 -0
  107. package/dist/node/profiling.js +432 -0
  108. package/dist/node/public-types.js +0 -0
  109. package/dist/node/react/fiber-adapter.js +57 -0
  110. package/dist/node/react/index.js +397 -0
  111. package/dist/node/react/react-compat-envelope.js +78 -0
  112. package/dist/node/react/react-compat-server.js +129 -0
  113. package/dist/node/react/react-compat-shared.js +104 -0
  114. package/dist/node/react/react-compat.js +223 -0
  115. package/dist/node/react/server.js +81 -0
  116. package/dist/node/react/shared.js +75 -0
  117. package/dist/node/renderer-bridge.js +35 -0
  118. package/dist/node/resize-observer.js +105 -0
  119. package/dist/node/resource-hint-diagnostics.js +67 -0
  120. package/dist/node/runtime-tags.js +22 -0
  121. package/dist/node/runtime.js +29364 -0
  122. package/dist/node/runtime.server.js +8200 -0
  123. package/dist/node/sanitize-url.js +34 -0
  124. package/dist/node/server/early-signals.js +54 -0
  125. package/dist/node/server/index.js +338 -0
  126. package/dist/node/server/rpc-batch.js +129 -0
  127. package/dist/node/server/rpc-stream.js +132 -0
  128. package/dist/node/server/rpc.js +48 -0
  129. package/dist/node/server/signal-query-observation.js +134 -0
  130. package/dist/node/server/streamed-region.js +31 -0
  131. package/dist/node/server/streamed-signals.js +574 -0
  132. package/dist/node/server-call.js +75 -0
  133. package/dist/node/server-rpc-batch-client.js +119 -0
  134. package/dist/node/server-rpc-client.js +108 -0
  135. package/dist/node/server-rpc-protocol.js +109 -0
  136. package/dist/node/server-rpc-stream-client.js +98 -0
  137. package/dist/node/shared-value-helpers.js +60 -0
  138. package/dist/node/signals/actions.js +463 -0
  139. package/dist/node/signals/client.js +22 -0
  140. package/dist/node/signals/computations.js +452 -0
  141. package/dist/node/signals/control-binding.js +388 -0
  142. package/dist/node/signals/control-handoff.js +12 -0
  143. package/dist/node/signals/derived-facade.js +25 -0
  144. package/dist/node/signals/document-owner.js +48 -0
  145. package/dist/node/signals/early-values.js +124 -0
  146. package/dist/node/signals/encoding.js +6 -0
  147. package/dist/node/signals/engine.js +668 -0
  148. package/dist/node/signals/errors.js +54 -0
  149. package/dist/node/signals/facade.js +441 -0
  150. package/dist/node/signals/graph.js +817 -0
  151. package/dist/node/signals/handle-protocol.js +11 -0
  152. package/dist/node/signals/index.js +87 -0
  153. package/dist/node/signals/native-read-client.js +319 -0
  154. package/dist/node/signals/native-read-collector.js +132 -0
  155. package/dist/node/signals/native-read-events.js +45 -0
  156. package/dist/node/signals/native-read-inspection.js +20 -0
  157. package/dist/node/signals/native-read-retry.js +30 -0
  158. package/dist/node/signals/native-read-seeds.js +243 -0
  159. package/dist/node/signals/native-read-server.js +99 -0
  160. package/dist/node/signals/owner-context.js +88 -0
  161. package/dist/node/signals/query-attempt-observer.js +42 -0
  162. package/dist/node/signals/query-facade.js +41 -0
  163. package/dist/node/signals/read-protocol.js +125 -0
  164. package/dist/node/signals/requests.js +716 -0
  165. package/dist/node/signals/scalar-computations.js +57 -0
  166. package/dist/node/signals/scope-streams.js +147 -0
  167. package/dist/node/signals/server.js +22 -0
  168. package/dist/node/signals/transition-action.js +555 -0
  169. package/dist/node/signals/transition-candidate.js +101 -0
  170. package/dist/node/signals/transition-coordinator.js +255 -0
  171. package/dist/node/signals/transition-state.js +82 -0
  172. package/dist/node/signals/types.js +20 -0
  173. package/dist/node/static/index.js +10 -0
  174. package/dist/node/stream-protocol.js +114 -0
  175. package/dist/node/streamed-signals-protocol.js +130 -0
  176. package/dist/node/style-values.js +96 -0
  177. package/dist/node/sub-slot.js +35 -0
  178. package/dist/node/testing.js +14 -0
  179. package/dist/node/trusted-html.js +6 -0
  180. package/dist/node/tsrx-iterable.js +5 -0
  181. package/dist/node/tsrx-spread.js +10 -0
  182. package/dist/node/universal-core.js +10138 -0
  183. package/dist/node/universal-dom-boundary.js +237 -0
  184. package/dist/node/universal-native.js +28 -0
  185. package/dist/node/universal.js +17 -0
  186. package/dist/node/version.js +4 -0
  187. package/dist/runtime.d.ts +219 -8
  188. package/dist/runtime.js +714 -220
  189. package/dist/runtime.server.d.ts +33 -2
  190. package/dist/runtime.server.js +217 -29
  191. package/dist/server/index.d.ts +1 -1
  192. package/dist/server/index.js +2 -0
  193. package/dist/server/rpc-stream.js +19 -12
  194. package/dist/server/streamed-signals.js +18 -1
  195. package/dist/shared-value-helpers.d.ts +11 -0
  196. package/dist/shared-value-helpers.js +21 -1
  197. package/dist/universal-core.d.ts +3 -1
  198. package/dist/universal-core.js +178 -50
  199. package/dist/version.js +1 -1
  200. package/package.json +62 -1
@@ -69,6 +69,7 @@ __export(runtime_server_exports, {
69
69
  injectStyle: () => injectStyle,
70
70
  invokeManualHook: () => invokeManualHook,
71
71
  isChildrenBlock: () => isChildrenBlock,
72
+ isRenderCall: () => isRenderCall,
72
73
  isValidElement: () => isValidElement,
73
74
  lazy: () => lazy,
74
75
  manualHook: () => manualHook,
@@ -157,6 +158,7 @@ __export(runtime_server_exports, {
157
158
  ssrText: () => ssrText,
158
159
  ssrTextPre: () => ssrTextPre,
159
160
  ssrTextSlot: () => ssrTextSlot,
161
+ ssrTextareaText: () => ssrTextareaText,
160
162
  ssrTextareaValue: () => ssrTextareaValue,
161
163
  ssrTextareaValueSources: () => ssrTextareaValueSources,
162
164
  ssrTry: () => ssrTry,
@@ -223,6 +225,7 @@ var import_native_read_seeds = require("./signals/native-read-seeds.cjs");
223
225
  var import_owner_context = require("./signals/owner-context.cjs");
224
226
  var import_query_attempt_observer = require("./signals/query-attempt-observer.cjs");
225
227
  var import_types = require("./signals/types.cjs");
228
+ const __octaneDev = process.env.NODE_ENV !== "production";
226
229
  function isSignalHandle(value) {
227
230
  return (typeof value === "object" || typeof value === "function") && value !== null && value[import_types.SIGNAL_HANDLE] === true;
228
231
  }
@@ -455,7 +458,7 @@ function nextScopedCount(frame, slot, key) {
455
458
  }
456
459
  function scopeSuffix(frame) {
457
460
  const scope = ASYNC_SCOPE;
458
- if (process.env.NODE_ENV !== "production" && !scope.startsWith(frame.asyncScope)) {
461
+ if (__octaneDev && !scope.startsWith(frame.asyncScope)) {
459
462
  throw new Error((0, import_error_codes_server_generated.formatServerError)(65));
460
463
  }
461
464
  return scope.slice(frame.asyncScope.length);
@@ -505,7 +508,7 @@ function withSsrElementContext(tag, location, render, forcedNamespace, htmlInteg
505
508
  childrenNamespace,
506
509
  location
507
510
  };
508
- if (process.env.NODE_ENV !== "production" && SSR_NESTING_WARNINGS !== null && namespace === "html" && parent?.namespace === "html") {
511
+ if (__octaneDev && SSR_NESTING_WARNINGS !== null && namespace === "html" && parent?.namespace === "html") {
509
512
  const parentMessage = (0, import_html_tree_validation.invalidHtmlNestingWithParent)(
510
513
  semanticTag,
511
514
  parent.tag,
@@ -535,12 +538,12 @@ function withSsrElementContext(tag, location, render, forcedNamespace, htmlInteg
535
538
  }
536
539
  }
537
540
  function ssrElement(tag, location, render, htmlIntegrationPoint) {
538
- if (process.env.NODE_ENV === "production" || SSR_NESTING_WARNINGS === null) return render();
541
+ if (!__octaneDev || SSR_NESTING_WARNINGS === null) return render();
539
542
  return withSsrElementContext(tag, location, render, void 0, htmlIntegrationPoint);
540
543
  }
541
544
  function ssrNestingText(value) {
542
545
  const text = ssrText(value);
543
- if (process.env.NODE_ENV !== "production" && text !== "") {
546
+ if (__octaneDev && text !== "") {
544
547
  const parent = CURRENT_SSR_ELEMENT;
545
548
  if (parent !== null && parent.namespace === "html" && SSR_NESTING_WARNINGS !== null) {
546
549
  const message = (0, import_html_tree_validation.invalidHtmlTextNesting)(text, parent.tag, parent.location);
@@ -694,7 +697,7 @@ function copyElementConfig(config) {
694
697
  return props;
695
698
  }
696
699
  function finalizeElementDescriptor(descriptor) {
697
- if (process.env.NODE_ENV !== "production") {
700
+ if (__octaneDev) {
698
701
  Object.freeze(descriptor.props);
699
702
  Object.freeze(descriptor);
700
703
  }
@@ -749,6 +752,9 @@ function createScopedValue(readElement) {
749
752
  };
750
753
  return scopedValueDescriptor(resolve);
751
754
  }
755
+ function isRenderCall(scope) {
756
+ return scope === CURRENT_SCOPE && scope !== null;
757
+ }
752
758
  function nativeCreateScopedValue(readElement) {
753
759
  return scopedValueDescriptor(createNativeServerScopedResolver(readElement));
754
760
  }
@@ -765,7 +771,7 @@ function scopedValueDescriptor(resolve) {
765
771
  "__octaneInvocationSite",
766
772
  SCOPED_VALUE_PROPERTIES.__octaneInvocationSite
767
773
  );
768
- if (process.env.NODE_ENV !== "production") Object.freeze(descriptor);
774
+ if (__octaneDev) Object.freeze(descriptor);
769
775
  return descriptor;
770
776
  }
771
777
  function createScopedElement(type, props, readChildren, invocationSite) {
@@ -830,7 +836,7 @@ function createElementFromConfig(invocationSite, type, props, children) {
830
836
  let kids = hasPositional ? children.length === 1 ? children[0] : children : src?.children;
831
837
  if (children !== void 0 && children.length > 1) {
832
838
  POSITIONAL_CHILDREN.add(children);
833
- if (process.env.NODE_ENV !== "production") Object.freeze(children);
839
+ if (__octaneDev) Object.freeze(children);
834
840
  }
835
841
  const p = copyElementConfig(src);
836
842
  if (hasPositional) p.children = kids;
@@ -886,7 +892,7 @@ function ssrDeoptKey(item, index) {
886
892
  }
887
893
  function scopedSsrDeoptKey(path, item, index, key) {
888
894
  const explicit = isElementDescriptor(item) && item.key != null;
889
- if (path.length === 0 && !explicit) return index;
895
+ if (path.length === 0) return explicit ? "k" + String(key) : index;
890
896
  return JSON.stringify([path, explicit ? "key" : "index", explicit ? String(key) : index]);
891
897
  }
892
898
  const SSR_DEOPT_KEY_STRINGIFY = JSON.stringify;
@@ -1418,7 +1424,7 @@ function ssrChildValue(v, scope, includeKeyedSingle, selfMarkItem = false) {
1418
1424
  for (let i = 0; i < preparedList.items.length; i++) {
1419
1425
  const item = preparedList.items[i];
1420
1426
  const key = preparedList.keys[i];
1421
- out += withAsyncIdentity("item", key, () => ssrChildValue(item, scope, false, true));
1427
+ out += withSsrDeoptItem(key, i, () => ssrChildValue(item, scope, false, true));
1422
1428
  }
1423
1429
  return ssrBlock(out);
1424
1430
  });
@@ -1456,6 +1462,22 @@ function ssrChildTextPre(v, scope) {
1456
1462
  const content = ssrChildText(v, scope);
1457
1463
  return content.charCodeAt(0) === 10 ? "\n" + content : content;
1458
1464
  }
1465
+ function rejectTextareaChild(child) {
1466
+ throw new Error((0, import_error_codes_server_generated.formatServerError)(336, (0, import_shared_value_helpers.describeTextareaChild)(child, isElementDescriptor)));
1467
+ }
1468
+ function ssrTextareaText(parts, textHoles) {
1469
+ let probing = false;
1470
+ for (const part of parts) if (probingDangerHtmlChild(part)) probing = true;
1471
+ if (probing) return "";
1472
+ let text = "";
1473
+ for (let i = 0; i < parts.length; i++) {
1474
+ let part = parts[i];
1475
+ if (isSignalHandle(part)) part = readSignalBinding(part);
1476
+ text += textHoles !== void 0 && textHoles.charCodeAt(i) === 116 ? part == null || part === false ? "" : String(part) : (0, import_shared_value_helpers.textareaChildText)(part, rejectTextareaChild);
1477
+ }
1478
+ const escaped = escapeHtml(text);
1479
+ return escaped.charCodeAt(0) === 10 ? "\n" + escaped : escaped;
1480
+ }
1459
1481
  function ssrChildPre(v, scope) {
1460
1482
  const content = ssrChild(v, scope);
1461
1483
  return content.charCodeAt(0) === 10 ? "\n" + content : content;
@@ -1483,7 +1505,7 @@ function ssrHostElement(tag, props, children, scope, rawInner) {
1483
1505
  let hasInnerHTMLProp = false;
1484
1506
  const isCtlTag = semanticTag === "input" || semanticTag === "textarea" || semanticTag === "select";
1485
1507
  if (props != null) {
1486
- if (process.env.NODE_ENV !== "production") {
1508
+ if (__octaneDev) {
1487
1509
  devValidateSsrAriaProps(props, semanticTag, namespace);
1488
1510
  devValidateSsrHostProps(props, semanticTag, namespace);
1489
1511
  devValidateSsrFormProps(semanticTag, props, children);
@@ -1534,6 +1556,8 @@ function ssrHostElement(tag, props, children, scope, rawInner) {
1534
1556
  inner = semanticTag === "script" ? escapeEntireInlineScriptContent(raw) : semanticTag === "style" ? escapeEntireInlineStyleContent(raw) : raw;
1535
1557
  } else if (rawInner !== void 0) {
1536
1558
  inner = rawInner;
1559
+ } else if (hasChildren && semanticTag === "textarea" && namespace === "html") {
1560
+ inner = escapeHtml((0, import_shared_value_helpers.textareaChildText)(children, rejectTextareaChild));
1537
1561
  } else if (hasChildren) {
1538
1562
  const rawText = semanticTag === "script" || semanticTag === "style" ? scriptDescriptorText(children) : null;
1539
1563
  if (rawText !== null) {
@@ -1571,7 +1595,7 @@ function ssrDeoptBlockChildren(children, scope) {
1571
1595
  for (let i = 0; i < preparedList.items.length; i++) {
1572
1596
  const item = preparedList.items[i];
1573
1597
  const key = preparedList.keys[i];
1574
- out += withAsyncIdentity("item", key, () => {
1598
+ out += withSsrDeoptItem(key, i, () => {
1575
1599
  return serverDescNeedsBlocks(item) ? ssrChildValue(item, scope, false) : ssrDeoptItemContent(item, scope);
1576
1600
  });
1577
1601
  }
@@ -1627,23 +1651,62 @@ function ssrDeoptItemContent(value, scope) {
1627
1651
  return ssrBlock(ssrDescriptorContent(value, scope));
1628
1652
  }
1629
1653
  function ssrDescriptorContent(v, scope) {
1654
+ SSR_DESCRIPTOR_TEXT_TAIL = false;
1655
+ return ssrDescriptorPart(v, scope);
1656
+ }
1657
+ let SSR_DESCRIPTOR_TEXT_TAIL = false;
1658
+ function ssrDescriptorPart(v, scope) {
1630
1659
  if (v == null || v === false || v === true || v === "") return "";
1631
- if (typeof v === "object" && SERVER_HTML in v) return v[SERVER_HTML];
1660
+ if (typeof v === "object" && SERVER_HTML in v) {
1661
+ SSR_DESCRIPTOR_TEXT_TAIL = false;
1662
+ return v[SERVER_HTML];
1663
+ }
1632
1664
  if (Array.isArray(v)) {
1633
1665
  let out = "";
1634
- for (let i = 0; i < v.length; i++) out += ssrDescriptorContent(v[i], scope);
1666
+ for (let i = 0; i < v.length; i++) out += ssrDescriptorPart(v[i], scope);
1635
1667
  return out;
1636
1668
  }
1637
1669
  if (typeof v === "object" && v.$$kind === import_runtime_tags.ELEMENT_TAG) {
1638
1670
  const d = v;
1639
- if (typeof d.type === "string") return ssrHostElement(d.type, d.props, d.children, scope);
1640
- return ssrComponentDescriptor(d, scope);
1671
+ const html = typeof d.type === "string" ? ssrHostElement(d.type, d.props, d.children, scope) : ssrComponentDescriptor(d, scope);
1672
+ SSR_DESCRIPTOR_TEXT_TAIL = false;
1673
+ return html;
1641
1674
  }
1642
1675
  if (typeof v === "function") {
1643
- return ssrComponent(scope, v, {}, void 0, void 0, isChildrenBlock(v));
1676
+ const html = ssrComponent(
1677
+ scope,
1678
+ v,
1679
+ {},
1680
+ void 0,
1681
+ void 0,
1682
+ isChildrenBlock(v)
1683
+ );
1684
+ SSR_DESCRIPTOR_TEXT_TAIL = false;
1685
+ return html;
1644
1686
  }
1645
1687
  if (typeof v === "object") throw invalidChildError(v);
1646
- return escapeHtml(v);
1688
+ const text = escapeHtml(v);
1689
+ if (!SSR_DESCRIPTOR_TEXT_TAIL) {
1690
+ SSR_DESCRIPTOR_TEXT_TAIL = true;
1691
+ return text;
1692
+ }
1693
+ return ssrContentParsesComments() ? import_constants.TEXT_SEPARATOR + text : text;
1694
+ }
1695
+ const RAW_TEXT_CONTENT = /* @__PURE__ */ new Set([
1696
+ "textarea",
1697
+ "title",
1698
+ "script",
1699
+ "style",
1700
+ "xmp",
1701
+ "iframe",
1702
+ "noembed",
1703
+ "noframes",
1704
+ "noscript",
1705
+ "plaintext"
1706
+ ]);
1707
+ function ssrContentParsesComments() {
1708
+ const host = CURRENT_SSR_ELEMENT;
1709
+ return host === null || host.namespace !== "html" || !RAW_TEXT_CONTENT.has(host.tag);
1647
1710
  }
1648
1711
  function ssrBlock(content) {
1649
1712
  return MARKERS ? import_constants.BLOCK_OPEN + content + import_constants.BLOCK_CLOSE : String(content);
@@ -1741,6 +1804,27 @@ function withAsyncListScope(kind, fn) {
1741
1804
  const occurrence = frame === null ? 0 : nextFrameOccurrence(frame, "@list:" + kind);
1742
1805
  return withAsyncIdentity("list:" + kind, occurrence, fn);
1743
1806
  }
1807
+ function withSsrDeoptItem(key, index, fn) {
1808
+ const previousScope = ASYNC_SCOPE;
1809
+ const previousSignalKeys = SIGNAL_LIST_KEYS;
1810
+ ASYNC_SCOPE = previousScope + "|@item:" + asyncIdentityKey(key, false);
1811
+ if (SERVER_SIGNAL_BINDINGS_POTENTIAL) {
1812
+ SIGNAL_LIST_KEYS = {
1813
+ parent: previousSignalKeys,
1814
+ key,
1815
+ mapped: false,
1816
+ signalSite: void 0,
1817
+ position: index,
1818
+ values: null
1819
+ };
1820
+ }
1821
+ try {
1822
+ return fn();
1823
+ } finally {
1824
+ ASYNC_SCOPE = previousScope;
1825
+ SIGNAL_LIST_KEYS = previousSignalKeys;
1826
+ }
1827
+ }
1744
1828
  function ssrControl(siteKey, fn) {
1745
1829
  const frame = FRAME;
1746
1830
  const occurrence = frame === null ? 0 : nextFrameOccurrence(frame, "@control:" + siteKey);
@@ -1896,7 +1980,7 @@ function devValidateSsrHostProps(props, tag, namespace) {
1896
1980
  if (invalid !== void 0) console.error((0, import_host_property_diagnostics.invalidHostPropertiesWarning)(invalid, tag));
1897
1981
  }
1898
1982
  function ssrAttr(name, v, tag, namespace = "html") {
1899
- const dev = process.env.NODE_ENV !== "production";
1983
+ const dev = __octaneDev;
1900
1984
  namespace = resolveAttributeNamespace(namespace);
1901
1985
  const isCustomTag = namespace === "html" && tag !== void 0 && tag.indexOf("-") !== -1;
1902
1986
  if (dev && !isCustomTag && tag !== void 0 && DEV_SSR_CUSTOM_HOST_DEPTH === 0) {
@@ -2020,7 +2104,7 @@ function ssrAttr(name, v, tag, namespace = "html") {
2020
2104
  return " " + name + '="' + escapeAttr((0, import_sanitize_url.sanitizeURLAttribute)(tag, name, s)) + '"';
2021
2105
  }
2022
2106
  function styleObjectToCss(obj) {
2023
- const dev = process.env.NODE_ENV !== "production";
2107
+ const dev = __octaneDev;
2024
2108
  let out = "";
2025
2109
  for (const k in obj) {
2026
2110
  const val = obj[k];
@@ -2075,7 +2159,7 @@ function isAggregatedFormAttribute(tag, name) {
2075
2159
  return tag === "select" && name === "multiple";
2076
2160
  }
2077
2161
  function ssrAttrs(sources, tag, namespace = "html", skipFormControls = false, readStyle) {
2078
- const dev = process.env.NODE_ENV !== "production";
2162
+ const dev = __octaneDev;
2079
2163
  namespace = resolveAttributeNamespace(namespace);
2080
2164
  const props = /* @__PURE__ */ new Map();
2081
2165
  let classMerges = null;
@@ -2261,7 +2345,7 @@ function ssrSnapshotSpread(obj, controlSite, deferStyle = false) {
2261
2345
  function ssrSpread(obj, tag, skipClass = false, namespace = "html", skipFormControls = false) {
2262
2346
  namespace = resolveAttributeNamespace(namespace);
2263
2347
  if (obj == null) return "";
2264
- if (process.env.NODE_ENV !== "production") {
2348
+ if (__octaneDev) {
2265
2349
  devValidateSsrAriaProps(Object(obj), tag, namespace);
2266
2350
  devValidateSsrHostProps(Object(obj), tag, namespace);
2267
2351
  }
@@ -2335,9 +2419,10 @@ function finalPresentSource(sources) {
2335
2419
  }
2336
2420
  return [false, void 0];
2337
2421
  }
2338
- function ssrChildrenSources(sources, renderFallback, scope) {
2422
+ function ssrChildrenSources(sources, renderFallback, scope, textarea = false) {
2339
2423
  const child = finalPresentSource(sources);
2340
- return child[0] ? ssrChildText(child[1], scope) : renderFallback();
2424
+ if (!child[0]) return renderFallback();
2425
+ return textarea ? ssrTextareaText([child[1]]) : ssrChildText(child[1], scope);
2341
2426
  }
2342
2427
  function ssrSpreadContent(snapshot, scope) {
2343
2428
  if (snapshot === null) return "";
@@ -2363,7 +2448,7 @@ function ssrVoidContent(tag, dangerSources, childrenSources) {
2363
2448
  return "";
2364
2449
  }
2365
2450
  function devValidateSsrFormProps(tag, props, children) {
2366
- if (process.env.NODE_ENV === "production" || SSR_NESTING_WARNINGS === null || CURRENT_SSR_ELEMENT === null || tag !== "input" && tag !== "textarea" && tag !== "select" && tag !== "option" && tag !== "form" && tag !== "button") {
2451
+ if (!__octaneDev || SSR_NESTING_WARNINGS === null || CURRENT_SSR_ELEMENT === null || tag !== "input" && tag !== "textarea" && tag !== "select" && tag !== "option" && tag !== "form" && tag !== "button") {
2367
2452
  return;
2368
2453
  }
2369
2454
  for (const warning of (0, import_form_diagnostics.formAuthoringDiagnostics)(tag, props, children)) {
@@ -2371,7 +2456,7 @@ function devValidateSsrFormProps(tag, props, children) {
2371
2456
  }
2372
2457
  }
2373
2458
  function ssrFormAuthoringDiagnostics(tag, sources) {
2374
- if (process.env.NODE_ENV !== "production" && SSR_NESTING_WARNINGS !== null) {
2459
+ if (__octaneDev && SSR_NESTING_WARNINGS !== null) {
2375
2460
  const props = /* @__PURE__ */ Object.create(null);
2376
2461
  for (const [name, value] of sources) props[name] = value;
2377
2462
  devValidateSsrFormProps(tag, props);
@@ -2389,7 +2474,7 @@ function ssrCheckedAttr(v) {
2389
2474
  }
2390
2475
  function ssrInputAttrs(sources) {
2391
2476
  const props = resolveFormControlSources(sources);
2392
- if (process.env.NODE_ENV !== "production") {
2477
+ if (__octaneDev) {
2393
2478
  devValidateSsrFormProps("input", {
2394
2479
  value: unwrapSsrSignalControlValue(props.value),
2395
2480
  defaultValue: unwrapSsrSignalControlValue(props.defaultValue),
@@ -2478,7 +2563,7 @@ function ssrTextareaValue(v) {
2478
2563
  }
2479
2564
  function ssrTextareaValueSources(sources) {
2480
2565
  const props = resolveFormControlSources(sources);
2481
- if (process.env.NODE_ENV !== "production") {
2566
+ if (__octaneDev) {
2482
2567
  devValidateSsrFormProps("textarea", {
2483
2568
  value: unwrapSsrSignalControlValue(props.value),
2484
2569
  defaultValue: unwrapSsrSignalControlValue(props.defaultValue)
@@ -2495,7 +2580,7 @@ const SELECT_STACK = [];
2495
2580
  function ssrSelectScope(value, defaultValue, multiple, children) {
2496
2581
  value = unwrapSsrSignalControlValue(value);
2497
2582
  defaultValue = unwrapSsrSignalControlValue(defaultValue);
2498
- if (process.env.NODE_ENV !== "production") {
2583
+ if (__octaneDev) {
2499
2584
  devValidateSsrFormProps("select", { value, defaultValue, multiple });
2500
2585
  }
2501
2586
  const v = value != null ? value : defaultValue;
@@ -2540,7 +2625,7 @@ function ssrOptionValueSources(sources) {
2540
2625
  return value;
2541
2626
  }
2542
2627
  function ssrOption(value, attrs, content, complexAuthoredChildren = false) {
2543
- if (process.env.NODE_ENV !== "production" && SSR_NESTING_WARNINGS !== null) {
2628
+ if (__octaneDev && SSR_NESTING_WARNINGS !== null) {
2544
2629
  if (/(?:^|\s)selected(?:\s|=|$)/i.test(attrs)) {
2545
2630
  devValidateSsrFormProps("option", { value, selected: true });
2546
2631
  }
@@ -2558,8 +2643,9 @@ function ssrOptionSelected(value, content) {
2558
2643
  if (value != null) {
2559
2644
  key = String(value);
2560
2645
  } else {
2561
- if (content.indexOf("<") !== -1) return "";
2562
- key = unescapeOptionText(content);
2646
+ const text = content.indexOf(import_constants.TEXT_SEPARATOR) === -1 ? content : content.replaceAll(import_constants.TEXT_SEPARATOR, "");
2647
+ if (text.indexOf("<") !== -1) return "";
2648
+ key = unescapeOptionText(text);
2563
2649
  }
2564
2650
  if (scope.multi !== null) return scope.multi.has(key) ? " selected" : "";
2565
2651
  return scope.single === key ? " selected" : "";
@@ -3826,7 +3912,7 @@ function createContext(defaultValue) {
3826
3912
  ctx.$$kind = import_runtime_tags.CONTEXT_TAG;
3827
3913
  ctx.defaultValue = defaultValue;
3828
3914
  (0, import_context_identity.registerContext)(ctx);
3829
- if (process.env.NODE_ENV !== "production") {
3915
+ if (__octaneDev) {
3830
3916
  (0, import_context_identity.defineRemovedContextMembers)(ctx);
3831
3917
  }
3832
3918
  return ctx;
@@ -4033,7 +4119,7 @@ function hasExternalHydrationOwner(thenable) {
4033
4119
  }
4034
4120
  }
4035
4121
  function use(usable, siteKey, directSite) {
4036
- if (process.env.NODE_ENV !== "production" && devMemoComputeDepth !== 0) {
4122
+ if (__octaneDev && devMemoComputeDepth !== 0) {
4037
4123
  console.error(
4038
4124
  "Do not call use() inside a useMemo() factory. Cached factories can skip context or promise reads; call use() before useMemo() and memoize the returned value instead."
4039
4125
  );
@@ -4621,7 +4707,7 @@ function memoHookValue(input, compute, depsOrSlot, maybeSlot) {
4621
4707
  return rec.value;
4622
4708
  }
4623
4709
  function useMemo(compute, depsOrSlot, maybeSlot) {
4624
- if (process.env.NODE_ENV !== "production") {
4710
+ if (__octaneDev) {
4625
4711
  devMemoComputeDepth++;
4626
4712
  try {
4627
4713
  return memoHookValue(compute, true, depsOrSlot, maybeSlot);
@@ -4677,8 +4763,8 @@ function useActionState(_action, initialState) {
4677
4763
  function useFormStatus() {
4678
4764
  return { pending: false, data: null, method: null, action: null };
4679
4765
  }
4680
- function useOptimistic(state) {
4681
- return [state, NOOP];
4766
+ function useOptimistic(passthrough) {
4767
+ return [passthrough, NOOP];
4682
4768
  }
4683
4769
  const MEMO_OWNER = /* @__PURE__ */ Symbol("memoOwner");
4684
4770
  const MEMO_MARKER_DESCRIPTOR = {
@@ -5428,6 +5514,33 @@ async function raceSettleGuards(work, timeoutMs, signal) {
5428
5514
  removeAbort?.();
5429
5515
  }
5430
5516
  }
5517
+ function isThrownKey(key) {
5518
+ return key.charCodeAt(0) === 124 && key.startsWith("|throw#");
5519
+ }
5520
+ function isThrownWave(suspended) {
5521
+ for (const { key } of suspended) if (!isThrownKey(key)) return false;
5522
+ return true;
5523
+ }
5524
+ function isStalledWave(suspended, resolved) {
5525
+ const seen = resolved.settledThrows;
5526
+ if (seen === void 0) return false;
5527
+ for (const { promise, key } of suspended) {
5528
+ if (!isThrownKey(key) || !seen.has(promise)) return false;
5529
+ }
5530
+ return true;
5531
+ }
5532
+ const STALLED_RETRY_MAX_DELAY_MS = 100;
5533
+ function nextStalledRetryDelay(stall, timeoutMs, width) {
5534
+ if (stall.waves === 0 || width < stall.width) {
5535
+ stall.waves = 0;
5536
+ stall.since = Date.now();
5537
+ stall.width = width;
5538
+ }
5539
+ const waves = ++stall.waves;
5540
+ const remainingMs = timeoutMs > 0 ? stall.since + timeoutMs - Date.now() : Number.POSITIVE_INFINITY;
5541
+ if (remainingMs <= 0) return -1;
5542
+ return Math.min(2 ** (waves - 1), STALLED_RETRY_MAX_DELAY_MS, remainingMs);
5543
+ }
5431
5544
  async function settleSuspended(suspended, resolved, timeoutMs, signal) {
5432
5545
  const pu = resolved.pu;
5433
5546
  pu.recreate ??= { strikes: 0, prevCreated: pu.created.size };
@@ -5444,11 +5557,17 @@ async function settleSuspended(suspended, resolved, timeoutMs, signal) {
5444
5557
  resolved.set(key, outcome);
5445
5558
  if (isPu) pu.resolvedT.set(promise, outcome);
5446
5559
  }
5560
+ if (isThrownKey(key)) (resolved.settledThrows ??= /* @__PURE__ */ new Set()).add(promise);
5447
5561
  })
5448
5562
  );
5449
5563
  await raceSettleGuards(settleAll, timeoutMs, signal);
5450
5564
  }
5451
5565
  const yieldMacrotask = typeof setImmediate === "function" ? () => new Promise((resolve) => setImmediate(resolve)) : () => new Promise((resolve) => setTimeout(resolve, 0));
5566
+ function waveLanded(suspended, settlements) {
5567
+ if (settlements.landed.size === 0) return false;
5568
+ for (const { promise } of suspended) if (settlements.landed.has(promise)) return true;
5569
+ return false;
5570
+ }
5452
5571
  async function recordStreamSettlement(settlements, recorder) {
5453
5572
  let outcome;
5454
5573
  try {
@@ -5468,35 +5587,53 @@ async function recordStreamSettlement(settlements, recorder) {
5468
5587
  if (recorder.batch && !resolved.pu.resolvedT.has(recorder.promise)) {
5469
5588
  resolved.pu.resolvedT.set(recorder.promise, outcome);
5470
5589
  }
5590
+ if (recorder.thrown) (resolved.settledThrows ??= /* @__PURE__ */ new Set()).add(recorder.promise);
5591
+ if (!recorder.thrown || !recorder.settledBefore) settlements.landed.add(recorder.promise);
5471
5592
  settlements.pending.delete(recorder.promise);
5472
5593
  if (recorder.wave === settlements.wave) settlements.wake?.();
5473
5594
  }
5474
- async function settleFirstOfWave(suspended, resolved, timeoutMs, signal) {
5595
+ async function settleFirstOfWave(suspended, resolved, timeoutMs, signal, stall) {
5475
5596
  const pu = resolved.pu;
5476
5597
  pu.recreate ??= { strikes: 0, prevCreated: pu.created.size };
5477
5598
  const settlements = resolved.streamSettlements ??= {
5478
5599
  resolved,
5479
5600
  pending: /* @__PURE__ */ new Map(),
5480
5601
  wave: 0,
5481
- wake: null
5602
+ wake: null,
5603
+ landed: /* @__PURE__ */ new Set()
5482
5604
  };
5483
5605
  const wave = ++settlements.wave;
5484
5606
  let waiting = false;
5607
+ let stale = 0;
5485
5608
  for (const { promise, key } of suspended) {
5486
5609
  if (resolved.has(key)) continue;
5487
5610
  let recorder = settlements.pending.get(promise);
5488
5611
  if (recorder === void 0) {
5489
- recorder = { promise, key, keys: null, batch: key.startsWith("|pu#"), wave };
5612
+ const thrown = isThrownKey(key);
5613
+ recorder = {
5614
+ promise,
5615
+ key,
5616
+ keys: null,
5617
+ batch: key.startsWith("|pu#"),
5618
+ wave,
5619
+ thrown,
5620
+ settledBefore: thrown && resolved.settledThrows?.has(promise) === true && !settlements.landed.has(promise)
5621
+ };
5490
5622
  settlements.pending.set(promise, recorder);
5491
5623
  void recordStreamSettlement(settlements, recorder);
5492
5624
  } else {
5493
5625
  if (key !== recorder.key) (recorder.keys ??= /* @__PURE__ */ new Set()).add(key);
5494
5626
  if (key.startsWith("|pu#")) recorder.batch = true;
5627
+ if (recorder.thrown && !isThrownKey(key)) recorder.thrown = false;
5495
5628
  recorder.wave = wave;
5496
5629
  }
5630
+ if (recorder.thrown && recorder.settledBefore) stale++;
5497
5631
  waiting = true;
5498
5632
  }
5499
- if (!waiting) return;
5633
+ if (!waiting) {
5634
+ stall.waves = 0;
5635
+ return false;
5636
+ }
5500
5637
  const first = new Promise((resolve) => {
5501
5638
  settlements.wake = resolve;
5502
5639
  });
@@ -5514,6 +5651,30 @@ async function settleFirstOfWave(suspended, resolved, timeoutMs, signal) {
5514
5651
  size = resolved.size;
5515
5652
  }
5516
5653
  signal?.throwIfAborted();
5654
+ if (waveLanded(suspended, settlements)) {
5655
+ stall.waves = 0;
5656
+ return false;
5657
+ }
5658
+ const delayMs = nextStalledRetryDelay(stall, timeoutMs, stale);
5659
+ if (delayMs < 0) throw new Error((0, import_error_codes_server_generated.formatServerError)(332, timeoutMs));
5660
+ let timer;
5661
+ const progress = new Promise((resolve) => {
5662
+ timer = setTimeout(resolve, delayMs);
5663
+ settlements.wake = () => {
5664
+ if (waveLanded(suspended, settlements)) resolve();
5665
+ };
5666
+ });
5667
+ try {
5668
+ await raceSettleGuards(progress, 0, signal);
5669
+ } finally {
5670
+ clearTimeout(timer);
5671
+ settlements.wake = null;
5672
+ }
5673
+ if (waveLanded(suspended, settlements)) {
5674
+ stall.waves = 0;
5675
+ return false;
5676
+ }
5677
+ return true;
5517
5678
  }
5518
5679
  function observeSuspenseWave(resolved, settled, next, boundaryProgress) {
5519
5680
  const pu = resolved.pu;
@@ -5560,7 +5721,7 @@ function observeSuspenseWave(resolved, settled, next, boundaryProgress) {
5560
5721
  }
5561
5722
  pu.batchDisabled = true;
5562
5723
  for (const { promise } of next) Promise.resolve(promise).then(NOOP, NOOP);
5563
- if (process.env.NODE_ENV !== "production") {
5724
+ if (__octaneDev) {
5564
5725
  console.error(
5565
5726
  "octane SSR: use() thenables appear to be re-created on every render pass \u2014 promises created during an ancestor render and passed down (e.g. via props) get a fresh identity each pass, so their boundaries can never resolve by identity. Create the promise at its use() site, or hoist the creation out of render (the compiler caches analyzable inline creations automatically). Falling back to per-site replay for the rest of this render."
5566
5727
  );
@@ -5573,6 +5734,7 @@ async function runBuffered(component, props, options, nonceAttr, resolved) {
5573
5734
  const identifierPrefix = options?.identifierPrefix ?? "";
5574
5735
  let attempt = 0;
5575
5736
  let lastSettled = null;
5737
+ const stall = { waves: 0, since: 0, width: 0 };
5576
5738
  for (; ; ) {
5577
5739
  signal?.throwIfAborted();
5578
5740
  let pass;
@@ -5592,12 +5754,26 @@ async function runBuffered(component, props, options, nonceAttr, resolved) {
5592
5754
  let jobs = pass.deferred;
5593
5755
  let pending = pass.suspended;
5594
5756
  for (; ; ) {
5595
- if (++attempt > MAX_SUSPENSE_PASSES) {
5596
- const err = new Error((0, import_error_codes_server_generated.formatServerError)(47, MAX_SUSPENSE_PASSES));
5757
+ const stalled = isStalledWave(pending, resolved);
5758
+ if (!stalled && ++attempt > MAX_SUSPENSE_PASSES) {
5759
+ const err = new Error(
5760
+ isThrownWave(pending) ? (0, import_error_codes_server_generated.formatServerError)(333, MAX_SUSPENSE_PASSES) : (0, import_error_codes_server_generated.formatServerError)(47, MAX_SUSPENSE_PASSES)
5761
+ );
5597
5762
  options?.onError?.(err);
5598
5763
  throw err;
5599
5764
  }
5600
5765
  await settleSuspended(pending, resolved, timeoutMs, signal);
5766
+ if (stalled) {
5767
+ const delayMs = nextStalledRetryDelay(stall, timeoutMs, pending.length);
5768
+ if (delayMs < 0) {
5769
+ const err = new Error((0, import_error_codes_server_generated.formatServerError)(332, timeoutMs));
5770
+ options?.onError?.(err);
5771
+ throw err;
5772
+ }
5773
+ await raceSettleGuards(new Promise((resolve) => setTimeout(resolve, delayMs)), 0, signal);
5774
+ } else {
5775
+ stall.waves = 0;
5776
+ }
5601
5777
  lastSettled = pending;
5602
5778
  if (jobs.length === 0 || !jobs.every((j) => j.frame.parent !== null)) break;
5603
5779
  const round = withStream(null, () => runDiscoveryRound(jobs, resolved, identifierPrefix));
@@ -5742,7 +5918,7 @@ async function prerenderToNodeStream(entryComponent, props, options) {
5742
5918
  }
5743
5919
  let resolved = options;
5744
5920
  if (options?.headChannel === "separate") {
5745
- if (process.env.NODE_ENV !== "production") {
5921
+ if (__octaneDev) {
5746
5922
  console.error(
5747
5923
  "prerenderToNodeStream() streams one document and has no separate head channel; headChannel: 'separate' was ignored. Use prerender() for a split head."
5748
5924
  );
@@ -6725,6 +6901,7 @@ async function runStream(component, props, options, sink, resolved, cancelInject
6725
6901
  };
6726
6902
  const renderFullPass = () => {
6727
6903
  const boundaryKeys = /* @__PURE__ */ new Set();
6904
+ resolved.streamSettlements?.landed.clear();
6728
6905
  const previousBoundaryKeys = stream.activePassBoundaryKeys;
6729
6906
  const previousReplay = stream.replay;
6730
6907
  stream.activePassBoundaryKeys = boundaryKeys;
@@ -6909,6 +7086,7 @@ async function runStream(component, props, options, sink, resolved, cancelInject
6909
7086
  let shellBoundaryKeys;
6910
7087
  let preShellSuspended = [];
6911
7088
  let retryWithoutSettling = false;
7089
+ const stall = { waves: 0, since: 0, width: 0 };
6912
7090
  try {
6913
7091
  signal?.throwIfAborted();
6914
7092
  ({ pass, boundaryKeys: shellBoundaryKeys } = renderFullPass());
@@ -6920,17 +7098,20 @@ async function runStream(component, props, options, sink, resolved, cancelInject
6920
7098
  throw new Error((0, import_error_codes_server_generated.formatServerError)(34));
6921
7099
  }
6922
7100
  if (++rootAttempts > MAX_SUSPENSE_PASSES) {
6923
- throw new Error((0, import_error_codes_server_generated.formatServerError)(35, MAX_SUSPENSE_PASSES));
7101
+ throw new Error(
7102
+ isThrownWave(pass.suspended) ? (0, import_error_codes_server_generated.formatServerError)(335, MAX_SUSPENSE_PASSES) : (0, import_error_codes_server_generated.formatServerError)(35, MAX_SUSPENSE_PASSES)
7103
+ );
6924
7104
  }
6925
7105
  const settledWave = pass.suspended;
6926
- if (!retryWithoutSettling) {
6927
- await settleFirstOfWave(settledWave, resolved, timeoutMs, signal);
7106
+ if (!retryWithoutSettling && await settleFirstOfWave(settledWave, resolved, timeoutMs, signal, stall)) {
7107
+ rootAttempts--;
6928
7108
  }
6929
7109
  ({ pass, boundaryKeys: shellBoundaryKeys } = renderFullPass());
6930
7110
  preShellSuspended = pass.suspended;
6931
7111
  retryWithoutSettling = observeSuspenseWave(resolved, settledWave, pass.suspended, false);
6932
7112
  signal?.throwIfAborted();
6933
7113
  }
7114
+ stall.waves = 0;
6934
7115
  pruneStreamBoundariesAbsentFromShell(stream, shellBoundaryKeys);
6935
7116
  } catch (err) {
6936
7117
  try {
@@ -7051,11 +7232,13 @@ async function runStream(component, props, options, sink, resolved, cancelInject
7051
7232
  throw new Error((0, import_error_codes_server_generated.formatServerError)(36));
7052
7233
  }
7053
7234
  if (++attempt > MAX_SUSPENSE_PASSES) {
7054
- throw new Error((0, import_error_codes_server_generated.formatServerError)(48, MAX_SUSPENSE_PASSES));
7235
+ throw new Error(
7236
+ isThrownWave(suspended) ? (0, import_error_codes_server_generated.formatServerError)(334, MAX_SUSPENSE_PASSES) : (0, import_error_codes_server_generated.formatServerError)(48, MAX_SUSPENSE_PASSES)
7237
+ );
7055
7238
  }
7056
7239
  const settledWave = suspended;
7057
- if (!retryWithoutSettling) {
7058
- await settleFirstOfWave(settledWave, resolved, timeoutMs, signal);
7240
+ if (!retryWithoutSettling && await settleFirstOfWave(settledWave, resolved, timeoutMs, signal, stall)) {
7241
+ attempt--;
7059
7242
  }
7060
7243
  pass = renderFullPass().pass;
7061
7244
  suspended = pass.suspended;
@@ -7088,7 +7271,10 @@ async function runStream(component, props, options, sink, resolved, cancelInject
7088
7271
  madeProgress = true;
7089
7272
  }
7090
7273
  }
7091
- if (madeProgress) attempt = 0;
7274
+ if (madeProgress) {
7275
+ attempt = 0;
7276
+ stall.waves = 0;
7277
+ }
7092
7278
  retryWithoutSettling = observeSuspenseWave(resolved, settledWave, suspended, madeProgress);
7093
7279
  const done = reachableDoneSegments();
7094
7280
  if (!sentViewTransitions && pass.vtCandidates && done.length > 0) {
@@ -7692,7 +7878,7 @@ function coerceHintHref(href) {
7692
7878
  return typeof href === "string" && href !== "" ? href : null;
7693
7879
  }
7694
7880
  function preload(href, options) {
7695
- if (process.env.NODE_ENV !== "production") {
7881
+ if (__octaneDev) {
7696
7882
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("preload", href, options);
7697
7883
  if (warning !== null) console.error(warning);
7698
7884
  }
@@ -7706,7 +7892,7 @@ function preload(href, options) {
7706
7892
  if (as === "style" && HEAD.hints.has("sheet:" + value)) {
7707
7893
  const existing = HEAD.sheets?.get(value);
7708
7894
  if (existing === void 0 || !existing.html.startsWith("<style")) return;
7709
- if (process.env.NODE_ENV !== "production" && HEAD.hints.has("dev-inline-style:" + value)) {
7895
+ if (__octaneDev && HEAD.hints.has("dev-inline-style:" + value)) {
7710
7896
  console.error(
7711
7897
  'A <style> resource with href "' + value + '" follows a stylesheet preload for the same href. Inline styles cannot consume a stylesheet preload; remove the preload or use a stylesheet link.'
7712
7898
  );
@@ -7736,7 +7922,7 @@ function preload(href, options) {
7736
7922
  );
7737
7923
  }
7738
7924
  function preinit(href, options) {
7739
- if (process.env.NODE_ENV !== "production") {
7925
+ if (__octaneDev) {
7740
7926
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("preinit", href, options);
7741
7927
  if (warning !== null) console.error(warning);
7742
7928
  }
@@ -7769,7 +7955,7 @@ function preinit(href, options) {
7769
7955
  }
7770
7956
  }
7771
7957
  function preconnect(href, options) {
7772
- if (process.env.NODE_ENV !== "production") {
7958
+ if (__octaneDev) {
7773
7959
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("preconnect", href, options);
7774
7960
  if (warning !== null) console.error(warning);
7775
7961
  }
@@ -7788,7 +7974,7 @@ function preconnect(href, options) {
7788
7974
  );
7789
7975
  }
7790
7976
  function prefetchDNS(href) {
7791
- if (process.env.NODE_ENV !== "production") {
7977
+ if (__octaneDev) {
7792
7978
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("prefetchDNS", href, arguments[1], arguments.length > 1);
7793
7979
  if (warning !== null) console.error(warning);
7794
7980
  }
@@ -7814,7 +8000,7 @@ function resourceAttrs(attrs, tag) {
7814
8000
  return out;
7815
8001
  }
7816
8002
  function ssrStylesheetResource(attrs, invalidReason) {
7817
- if (process.env.NODE_ENV !== "production" && invalidReason !== void 0) {
8003
+ if (__octaneDev && invalidReason !== void 0) {
7818
8004
  let conflict;
7819
8005
  if (invalidReason === "missing-href") {
7820
8006
  conflict = "requires a non-empty string `href`";
@@ -7847,13 +8033,13 @@ function ssrStyleResource(attrs, css, development) {
7847
8033
  if (HEAD === null || attrs == null) return "";
7848
8034
  const href = attrs.href;
7849
8035
  if (typeof href !== "string" || href === "") return "";
7850
- if (process.env.NODE_ENV !== "production" && development === true && /\s/.test(href)) {
8036
+ if (__octaneDev && development === true && /\s/.test(href)) {
7851
8037
  console.error(
7852
8038
  'A <style> resource href must not contain whitespace because it identifies the style during hydration; received "' + href + '".'
7853
8039
  );
7854
8040
  }
7855
8041
  if (/<\/style/i.test(css)) {
7856
- if (process.env.NODE_ENV !== "production") {
8042
+ if (__octaneDev) {
7857
8043
  console.error(
7858
8044
  'octane SSR: a <style href precedence> resource contains "</style" and cannot be serialized safely; the resource was skipped. Load it as a stylesheet link instead.'
7859
8045
  );
@@ -7862,7 +8048,7 @@ function ssrStyleResource(attrs, css, development) {
7862
8048
  }
7863
8049
  const key = "sheet:" + href;
7864
8050
  if (HEAD.hints.has(key)) return "";
7865
- if (process.env.NODE_ENV !== "production" && development === true) {
8051
+ if (__octaneDev && development === true) {
7866
8052
  if (HEAD.hints.has("preload:style:" + href)) {
7867
8053
  console.error(
7868
8054
  'A <style> resource with href "' + href + '" follows a stylesheet preload for the same href. Inline styles cannot consume a stylesheet preload; remove the preload or use a stylesheet link.'
@@ -7891,7 +8077,7 @@ function ssrScriptResource(attrs) {
7891
8077
  return "";
7892
8078
  }
7893
8079
  function preloadModule(href, options) {
7894
- if (process.env.NODE_ENV !== "production") {
8080
+ if (__octaneDev) {
7895
8081
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("preloadModule", href, options);
7896
8082
  if (warning !== null) console.error(warning);
7897
8083
  }
@@ -7911,7 +8097,7 @@ function preloadModule(href, options) {
7911
8097
  );
7912
8098
  }
7913
8099
  function preinitModule(href, options) {
7914
- if (process.env.NODE_ENV !== "production") {
8100
+ if (__octaneDev) {
7915
8101
  const warning = (0, import_resource_hint_diagnostics.resourceHintWarning)("preinitModule", href, options);
7916
8102
  if (warning !== null) console.error(warning);
7917
8103
  }
@@ -7970,6 +8156,7 @@ function preinitModule(href, options) {
7970
8156
  injectStyle,
7971
8157
  invokeManualHook,
7972
8158
  isChildrenBlock,
8159
+ isRenderCall,
7973
8160
  isValidElement,
7974
8161
  lazy,
7975
8162
  manualHook,
@@ -8058,6 +8245,7 @@ function preinitModule(href, options) {
8058
8245
  ssrText,
8059
8246
  ssrTextPre,
8060
8247
  ssrTextSlot,
8248
+ ssrTextareaText,
8061
8249
  ssrTextareaValue,
8062
8250
  ssrTextareaValueSources,
8063
8251
  ssrTry,