@tanstack/redact 0.0.1

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 (233) hide show
  1. package/dist/core/index.d.ts +2 -0
  2. package/dist/core/index.js +4 -0
  3. package/dist/core/index.js.map +7 -0
  4. package/dist/core/internal.d.ts +76 -0
  5. package/dist/core/internal.js +59 -0
  6. package/dist/core/internal.js.map +7 -0
  7. package/dist/core/types.d.ts +21 -0
  8. package/dist/core/types.js +10 -0
  9. package/dist/core/types.js.map +7 -0
  10. package/dist/dom/_all.d.ts +17 -0
  11. package/dist/dom/_all.js +51 -0
  12. package/dist/dom/_all.js.map +7 -0
  13. package/dist/dom/client.d.ts +3 -0
  14. package/dist/dom/client.js +8 -0
  15. package/dist/dom/client.js.map +7 -0
  16. package/dist/dom/dispatcher.d.ts +20 -0
  17. package/dist/dom/dispatcher.js +267 -0
  18. package/dist/dom/dispatcher.js.map +7 -0
  19. package/dist/dom/dom.d.ts +10 -0
  20. package/dist/dom/dom.js +262 -0
  21. package/dist/dom/dom.js.map +7 -0
  22. package/dist/dom/event-replay.d.ts +13 -0
  23. package/dist/dom/event-replay.js +46 -0
  24. package/dist/dom/event-replay.js.map +7 -0
  25. package/dist/dom/features/class/full.d.ts +1 -0
  26. package/dist/dom/features/class/full.js +91 -0
  27. package/dist/dom/features/class/full.js.map +7 -0
  28. package/dist/dom/features/class/index.d.ts +1 -0
  29. package/dist/dom/features/class/index.js +3 -0
  30. package/dist/dom/features/class/index.js.map +7 -0
  31. package/dist/dom/features/class/stub.d.ts +1 -0
  32. package/dist/dom/features/class/stub.js +50 -0
  33. package/dist/dom/features/class/stub.js.map +7 -0
  34. package/dist/dom/features/context/full.d.ts +1 -0
  35. package/dist/dom/features/context/full.js +49 -0
  36. package/dist/dom/features/context/full.js.map +7 -0
  37. package/dist/dom/features/context/index.d.ts +1 -0
  38. package/dist/dom/features/context/index.js +3 -0
  39. package/dist/dom/features/context/index.js.map +7 -0
  40. package/dist/dom/features/context/stub.d.ts +1 -0
  41. package/dist/dom/features/context/stub.js +22 -0
  42. package/dist/dom/features/context/stub.js.map +7 -0
  43. package/dist/dom/features/forward-ref/full.d.ts +1 -0
  44. package/dist/dom/features/forward-ref/full.js +51 -0
  45. package/dist/dom/features/forward-ref/full.js.map +7 -0
  46. package/dist/dom/features/forward-ref/index.d.ts +1 -0
  47. package/dist/dom/features/forward-ref/index.js +3 -0
  48. package/dist/dom/features/forward-ref/index.js.map +7 -0
  49. package/dist/dom/features/forward-ref/stub.d.ts +1 -0
  50. package/dist/dom/features/forward-ref/stub.js +22 -0
  51. package/dist/dom/features/forward-ref/stub.js.map +7 -0
  52. package/dist/dom/features/hydration/full.d.ts +61 -0
  53. package/dist/dom/features/hydration/full.js +264 -0
  54. package/dist/dom/features/hydration/full.js.map +7 -0
  55. package/dist/dom/features/hydration/index.d.ts +1 -0
  56. package/dist/dom/features/hydration/index.js +3 -0
  57. package/dist/dom/features/hydration/index.js.map +7 -0
  58. package/dist/dom/features/hydration/stub.d.ts +28 -0
  59. package/dist/dom/features/hydration/stub.js +66 -0
  60. package/dist/dom/features/hydration/stub.js.map +7 -0
  61. package/dist/dom/features/index.d.ts +7 -0
  62. package/dist/dom/features/index.js +9 -0
  63. package/dist/dom/features/index.js.map +7 -0
  64. package/dist/dom/features/lazy/full.d.ts +1 -0
  65. package/dist/dom/features/lazy/full.js +78 -0
  66. package/dist/dom/features/lazy/full.js.map +7 -0
  67. package/dist/dom/features/lazy/index.d.ts +1 -0
  68. package/dist/dom/features/lazy/index.js +3 -0
  69. package/dist/dom/features/lazy/index.js.map +7 -0
  70. package/dist/dom/features/lazy/stub.d.ts +1 -0
  71. package/dist/dom/features/lazy/stub.js +36 -0
  72. package/dist/dom/features/lazy/stub.js.map +7 -0
  73. package/dist/dom/features/memo/full.d.ts +1 -0
  74. package/dist/dom/features/memo/full.js +59 -0
  75. package/dist/dom/features/memo/full.js.map +7 -0
  76. package/dist/dom/features/memo/index.d.ts +1 -0
  77. package/dist/dom/features/memo/index.js +3 -0
  78. package/dist/dom/features/memo/index.js.map +7 -0
  79. package/dist/dom/features/memo/stub.d.ts +1 -0
  80. package/dist/dom/features/memo/stub.js +36 -0
  81. package/dist/dom/features/memo/stub.js.map +7 -0
  82. package/dist/dom/features/portal/full.d.ts +1 -0
  83. package/dist/dom/features/portal/full.js +19 -0
  84. package/dist/dom/features/portal/full.js.map +7 -0
  85. package/dist/dom/features/portal/index.d.ts +1 -0
  86. package/dist/dom/features/portal/index.js +3 -0
  87. package/dist/dom/features/portal/index.js.map +7 -0
  88. package/dist/dom/features/portal/stub.d.ts +1 -0
  89. package/dist/dom/features/portal/stub.js +7 -0
  90. package/dist/dom/features/portal/stub.js.map +7 -0
  91. package/dist/dom/features/suspense/full.d.ts +1 -0
  92. package/dist/dom/features/suspense/full.js +146 -0
  93. package/dist/dom/features/suspense/full.js.map +7 -0
  94. package/dist/dom/features/suspense/index.d.ts +1 -0
  95. package/dist/dom/features/suspense/index.js +3 -0
  96. package/dist/dom/features/suspense/index.js.map +7 -0
  97. package/dist/dom/features/suspense/stub.d.ts +1 -0
  98. package/dist/dom/features/suspense/stub.js +6 -0
  99. package/dist/dom/features/suspense/stub.js.map +7 -0
  100. package/dist/dom/index.d.ts +25 -0
  101. package/dist/dom/index.js +45 -0
  102. package/dist/dom/index.js.map +7 -0
  103. package/dist/dom/portal.d.ts +2 -0
  104. package/dist/dom/portal.js +15 -0
  105. package/dist/dom/portal.js.map +7 -0
  106. package/dist/dom/reconcile.d.ts +40 -0
  107. package/dist/dom/reconcile.js +795 -0
  108. package/dist/dom/reconcile.js.map +7 -0
  109. package/dist/dom/root.d.ts +15 -0
  110. package/dist/dom/root.js +85 -0
  111. package/dist/dom/root.js.map +7 -0
  112. package/dist/dom/test-utils.d.ts +1 -0
  113. package/dist/dom/test-utils.js +10 -0
  114. package/dist/dom/test-utils.js.map +7 -0
  115. package/dist/react/children.d.ts +8 -0
  116. package/dist/react/children.js +75 -0
  117. package/dist/react/children.js.map +7 -0
  118. package/dist/react/class.d.ts +31 -0
  119. package/dist/react/class.js +40 -0
  120. package/dist/react/class.js.map +7 -0
  121. package/dist/react/context.d.ts +27 -0
  122. package/dist/react/context.js +31 -0
  123. package/dist/react/context.js.map +7 -0
  124. package/dist/react/element.d.ts +10 -0
  125. package/dist/react/element.js +64 -0
  126. package/dist/react/element.js.map +7 -0
  127. package/dist/react/hooks.d.ts +37 -0
  128. package/dist/react/hooks.js +146 -0
  129. package/dist/react/hooks.js.map +7 -0
  130. package/dist/react/index.d.ts +76 -0
  131. package/dist/react/index.js +187 -0
  132. package/dist/react/index.js.map +7 -0
  133. package/dist/react/jsx-runtime.d.ts +5 -0
  134. package/dist/react/jsx-runtime.js +21 -0
  135. package/dist/react/jsx-runtime.js.map +7 -0
  136. package/dist/react/memo.d.ts +29 -0
  137. package/dist/react/memo.js +47 -0
  138. package/dist/react/memo.js.map +7 -0
  139. package/dist/react/portal.d.ts +1 -0
  140. package/dist/react/portal.js +6 -0
  141. package/dist/react/portal.js.map +7 -0
  142. package/dist/react/shared-internals.d.ts +33 -0
  143. package/dist/react/shared-internals.js +29 -0
  144. package/dist/react/shared-internals.js.map +7 -0
  145. package/dist/react/suspense.d.ts +15 -0
  146. package/dist/react/suspense.js +16 -0
  147. package/dist/react/suspense.js.map +7 -0
  148. package/dist/scheduler/index.d.ts +44 -0
  149. package/dist/scheduler/index.js +109 -0
  150. package/dist/scheduler/index.js.map +7 -0
  151. package/dist/server/bootstrap-script.d.ts +22 -0
  152. package/dist/server/bootstrap-script.js +16 -0
  153. package/dist/server/bootstrap-script.js.map +7 -0
  154. package/dist/server/dispatcher.d.ts +37 -0
  155. package/dist/server/dispatcher.js +140 -0
  156. package/dist/server/dispatcher.js.map +7 -0
  157. package/dist/server/escape.d.ts +7 -0
  158. package/dist/server/escape.js +159 -0
  159. package/dist/server/escape.js.map +7 -0
  160. package/dist/server/index.d.ts +16 -0
  161. package/dist/server/index.js +26 -0
  162. package/dist/server/index.js.map +7 -0
  163. package/dist/server/renderToString.d.ts +7 -0
  164. package/dist/server/renderToString.js +29 -0
  165. package/dist/server/renderToString.js.map +7 -0
  166. package/dist/server/stream.d.ts +40 -0
  167. package/dist/server/stream.js +200 -0
  168. package/dist/server/stream.js.map +7 -0
  169. package/dist/server/walk.d.ts +33 -0
  170. package/dist/server/walk.js +298 -0
  171. package/dist/server/walk.js.map +7 -0
  172. package/dist/vite/index.d.ts +96 -0
  173. package/dist/vite/index.js +217 -0
  174. package/dist/vite/index.js.map +7 -0
  175. package/package.json +83 -0
  176. package/src/core/index.ts +2 -0
  177. package/src/core/internal.ts +107 -0
  178. package/src/core/types.ts +36 -0
  179. package/src/dom/_all.ts +54 -0
  180. package/src/dom/client.ts +4 -0
  181. package/src/dom/dispatcher.ts +318 -0
  182. package/src/dom/dom.ts +316 -0
  183. package/src/dom/event-replay.ts +55 -0
  184. package/src/dom/features/class/full.ts +104 -0
  185. package/src/dom/features/class/index.ts +1 -0
  186. package/src/dom/features/class/stub.ts +65 -0
  187. package/src/dom/features/context/full.ts +57 -0
  188. package/src/dom/features/context/index.ts +1 -0
  189. package/src/dom/features/context/stub.ts +32 -0
  190. package/src/dom/features/forward-ref/full.ts +54 -0
  191. package/src/dom/features/forward-ref/index.ts +1 -0
  192. package/src/dom/features/forward-ref/stub.ts +28 -0
  193. package/src/dom/features/hydration/full.ts +345 -0
  194. package/src/dom/features/hydration/index.ts +1 -0
  195. package/src/dom/features/hydration/stub.ts +72 -0
  196. package/src/dom/features/index.ts +11 -0
  197. package/src/dom/features/lazy/full.ts +98 -0
  198. package/src/dom/features/lazy/index.ts +1 -0
  199. package/src/dom/features/lazy/stub.ts +45 -0
  200. package/src/dom/features/memo/full.ts +74 -0
  201. package/src/dom/features/memo/index.ts +1 -0
  202. package/src/dom/features/memo/stub.ts +42 -0
  203. package/src/dom/features/portal/full.ts +22 -0
  204. package/src/dom/features/portal/index.ts +1 -0
  205. package/src/dom/features/portal/stub.ts +11 -0
  206. package/src/dom/features/suspense/full.ts +191 -0
  207. package/src/dom/features/suspense/index.ts +1 -0
  208. package/src/dom/features/suspense/stub.ts +12 -0
  209. package/src/dom/index.ts +33 -0
  210. package/src/dom/portal.ts +16 -0
  211. package/src/dom/reconcile.ts +1169 -0
  212. package/src/dom/root.ts +107 -0
  213. package/src/dom/test-utils.ts +6 -0
  214. package/src/react/children.ts +85 -0
  215. package/src/react/class.ts +56 -0
  216. package/src/react/context.ts +50 -0
  217. package/src/react/element.ts +80 -0
  218. package/src/react/hooks.ts +190 -0
  219. package/src/react/index.ts +132 -0
  220. package/src/react/jsx-runtime.ts +16 -0
  221. package/src/react/memo.ts +45 -0
  222. package/src/react/portal.ts +1 -0
  223. package/src/react/shared-internals.ts +79 -0
  224. package/src/react/suspense.ts +18 -0
  225. package/src/scheduler/index.ts +124 -0
  226. package/src/server/bootstrap-script.ts +52 -0
  227. package/src/server/dispatcher.ts +158 -0
  228. package/src/server/escape.ts +187 -0
  229. package/src/server/index.ts +26 -0
  230. package/src/server/renderToString.ts +33 -0
  231. package/src/server/stream.ts +302 -0
  232. package/src/server/walk.ts +448 -0
  233. package/src/vite/index.ts +401 -0
@@ -0,0 +1,22 @@
1
+ // packages/redact/src/dom/features/context/stub.ts
2
+ import { FiberTag } from "../../../core";
3
+ import { REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE } from "../../../react";
4
+ import {
5
+ registerRenderer,
6
+ registerTypeMatcher,
7
+ reconcileChildren,
8
+ childrenToArray
9
+ } from "../../reconcile";
10
+ function renderConsumerStub(fiber, domParent, anchor) {
11
+ const ctx = fiber.type._context;
12
+ const props = fiber.pendingProps ?? {};
13
+ const value = ctx._currentValue;
14
+ const rendered = typeof props.children === "function" ? props.children(value) : null;
15
+ reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor);
16
+ fiber.memoizedProps = props;
17
+ }
18
+ registerTypeMatcher(
19
+ (_type, marker) => marker === REACT_PROVIDER_TYPE ? FiberTag.Fragment : marker === REACT_CONSUMER_TYPE ? FiberTag.Consumer : null
20
+ );
21
+ registerRenderer(FiberTag.Consumer, renderConsumerStub);
22
+ //# sourceMappingURL=stub.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/context/stub.ts"],
4
+ "sourcesContent": ["import { FiberTag, type Fiber } from '../../../core'\nimport { REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE } from '../../../react'\nimport {\n registerRenderer,\n registerTypeMatcher,\n reconcileChildren,\n childrenToArray,\n} from '../../reconcile'\n\n// Stub: Context feature disabled. Provider elements render as Fragments\n// (value is never propagated \u2014 descendants see only the Context's default).\n// Consumer elements still invoke their function-children with the default\n// value, so `<Ctx.Consumer>{v => ...}</Ctx.Consumer>` patterns keep working.\n// The default `readContext` capability returns `ctx._currentValue` without\n// walking, which matches the no-Provider-fibers-in-tree reality.\nfunction renderConsumerStub(fiber: Fiber, domParent: Node, anchor: Node | null): void {\n const ctx = (fiber.type as any)._context\n const props = fiber.pendingProps ?? {}\n const value = ctx._currentValue\n const rendered = typeof props.children === 'function' ? props.children(value) : null\n reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)\n fiber.memoizedProps = props\n}\n\nregisterTypeMatcher((_type, marker) =>\n marker === REACT_PROVIDER_TYPE\n ? FiberTag.Fragment\n : marker === REACT_CONSUMER_TYPE\n ? FiberTag.Consumer\n : null,\n)\nregisterRenderer(FiberTag.Consumer, renderConsumerStub)\n"],
5
+ "mappings": ";AAAA,SAAS,gBAA4B;AACrC,SAAS,qBAAqB,2BAA2B;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,mBAAmB,OAAc,WAAiB,QAA2B;AACpF,QAAM,MAAO,MAAM,KAAa;AAChC,QAAM,QAAQ,MAAM,gBAAgB,CAAC;AACrC,QAAM,QAAQ,IAAI;AAClB,QAAM,WAAW,OAAO,MAAM,aAAa,aAAa,MAAM,SAAS,KAAK,IAAI;AAChF,oBAAkB,OAAO,gBAAgB,QAAQ,GAAG,WAAW,MAAM;AACrE,QAAM,gBAAgB;AACxB;AAEA;AAAA,EAAoB,CAAC,OAAO,WAC1B,WAAW,sBACP,SAAS,WACT,WAAW,sBACT,SAAS,WACT;AACR;AACA,iBAAiB,SAAS,UAAU,kBAAkB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,51 @@
1
+ // packages/redact/src/dom/features/forward-ref/full.ts
2
+ import { FiberTag } from "../../../core";
3
+ import { ReactSharedInternals, REACT_FORWARD_REF_TYPE } from "../../../react";
4
+ import {
5
+ registerRenderer,
6
+ registerTypeMatcher,
7
+ reconcileChildren,
8
+ childrenToArray,
9
+ isThenable,
10
+ handleSuspended,
11
+ handleErrorInRender
12
+ } from "../../reconcile";
13
+ import { makeDispatcher } from "../../dispatcher";
14
+ function renderForwardRef(fiber, domParent, anchor) {
15
+ const props = fiber.pendingProps ?? {};
16
+ const render = fiber.type.render;
17
+ const ref = fiber.ref ?? (props.ref ?? null);
18
+ const prevDispatcher = ReactSharedInternals.H;
19
+ const prevFiber = ReactSharedInternals.currentFiber;
20
+ const prevHook = ReactSharedInternals.currentHook;
21
+ const prevIndex = ReactSharedInternals.hookIndex;
22
+ ReactSharedInternals.H = makeDispatcher();
23
+ ReactSharedInternals.currentFiber = fiber;
24
+ ReactSharedInternals.currentHook = null;
25
+ ReactSharedInternals.hookIndex = 0;
26
+ let rendered;
27
+ try {
28
+ const { ref: _omit, ...rest } = props;
29
+ rendered = render(rest, ref);
30
+ } catch (e) {
31
+ if (isThenable(e)) {
32
+ handleSuspended(fiber, e);
33
+ rendered = null;
34
+ } else {
35
+ handleErrorInRender(fiber, e);
36
+ return;
37
+ }
38
+ } finally {
39
+ ReactSharedInternals.H = prevDispatcher;
40
+ ReactSharedInternals.currentFiber = prevFiber;
41
+ ReactSharedInternals.currentHook = prevHook;
42
+ ReactSharedInternals.hookIndex = prevIndex;
43
+ }
44
+ reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor);
45
+ fiber.memoizedProps = props;
46
+ }
47
+ registerTypeMatcher(
48
+ (_type, marker) => marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null
49
+ );
50
+ registerRenderer(FiberTag.ForwardRef, renderForwardRef);
51
+ //# sourceMappingURL=full.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/forward-ref/full.ts"],
4
+ "sourcesContent": ["import { FiberTag, type Fiber, type ReactNode } from '../../../core'\nimport { ReactSharedInternals, REACT_FORWARD_REF_TYPE } from '../../../react'\nimport {\n registerRenderer,\n registerTypeMatcher,\n reconcileChildren,\n childrenToArray,\n isThenable,\n handleSuspended,\n handleErrorInRender,\n} from '../../reconcile'\nimport { makeDispatcher } from '../../dispatcher'\n\nfunction renderForwardRef(fiber: Fiber, domParent: Node, anchor: Node | null): void {\n const props = fiber.pendingProps ?? {}\n const render = (fiber.type as any).render\n const ref = fiber.ref ?? (props.ref ?? null)\n\n const prevDispatcher = ReactSharedInternals.H\n const prevFiber = ReactSharedInternals.currentFiber\n const prevHook = ReactSharedInternals.currentHook\n const prevIndex = ReactSharedInternals.hookIndex\n ReactSharedInternals.H = makeDispatcher()\n ReactSharedInternals.currentFiber = fiber\n ReactSharedInternals.currentHook = null\n ReactSharedInternals.hookIndex = 0\n\n let rendered: ReactNode\n try {\n const { ref: _omit, ...rest } = props\n rendered = render(rest, ref)\n } catch (e: any) {\n if (isThenable(e)) {\n handleSuspended(fiber, e)\n rendered = null\n } else {\n handleErrorInRender(fiber, e)\n return\n }\n } finally {\n ReactSharedInternals.H = prevDispatcher\n ReactSharedInternals.currentFiber = prevFiber\n ReactSharedInternals.currentHook = prevHook\n ReactSharedInternals.hookIndex = prevIndex\n }\n\n reconcileChildren(fiber, childrenToArray(rendered), domParent, anchor)\n fiber.memoizedProps = props\n}\n\nregisterTypeMatcher((_type, marker) =>\n marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null,\n)\nregisterRenderer(FiberTag.ForwardRef, renderForwardRef)\n"],
5
+ "mappings": ";AAAA,SAAS,gBAA4C;AACrD,SAAS,sBAAsB,8BAA8B;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,OAAc,WAAiB,QAA2B;AAClF,QAAM,QAAQ,MAAM,gBAAgB,CAAC;AACrC,QAAM,SAAU,MAAM,KAAa;AACnC,QAAM,MAAM,MAAM,QAAQ,MAAM,OAAO;AAEvC,QAAM,iBAAiB,qBAAqB;AAC5C,QAAM,YAAY,qBAAqB;AACvC,QAAM,WAAW,qBAAqB;AACtC,QAAM,YAAY,qBAAqB;AACvC,uBAAqB,IAAI,eAAe;AACxC,uBAAqB,eAAe;AACpC,uBAAqB,cAAc;AACnC,uBAAqB,YAAY;AAEjC,MAAI;AACJ,MAAI;AACF,UAAM,EAAE,KAAK,OAAO,GAAG,KAAK,IAAI;AAChC,eAAW,OAAO,MAAM,GAAG;AAAA,EAC7B,SAAS,GAAQ;AACf,QAAI,WAAW,CAAC,GAAG;AACjB,sBAAgB,OAAO,CAAC;AACxB,iBAAW;AAAA,IACb,OAAO;AACL,0BAAoB,OAAO,CAAC;AAC5B;AAAA,IACF;AAAA,EACF,UAAE;AACA,yBAAqB,IAAI;AACzB,yBAAqB,eAAe;AACpC,yBAAqB,cAAc;AACnC,yBAAqB,YAAY;AAAA,EACnC;AAEA,oBAAkB,OAAO,gBAAgB,QAAQ,GAAG,WAAW,MAAM;AACrE,QAAM,gBAAgB;AACxB;AAEA;AAAA,EAAoB,CAAC,OAAO,WAC1B,WAAW,yBAAyB,SAAS,aAAa;AAC5D;AACA,iBAAiB,SAAS,YAAY,gBAAgB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './full';
@@ -0,0 +1,3 @@
1
+ // packages/redact/src/dom/features/forward-ref/index.ts
2
+ export * from "./full";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/forward-ref/index.ts"],
4
+ "sourcesContent": ["export * from './full'\n"],
5
+ "mappings": ";AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ // packages/redact/src/dom/features/forward-ref/stub.ts
2
+ import { FiberTag } from "../../../core";
3
+ import { REACT_FORWARD_REF_TYPE } from "../../../react";
4
+ import { registerRenderer, registerTypeMatcher, renderFiber } from "../../reconcile";
5
+ function renderForwardRefStub(fiber, domParent, anchor) {
6
+ const render = fiber.type.render;
7
+ const savedTag = fiber.tag;
8
+ const savedType = fiber.type;
9
+ fiber.type = render;
10
+ fiber.tag = FiberTag.Function;
11
+ try {
12
+ renderFiber(fiber, domParent, anchor);
13
+ } finally {
14
+ fiber.tag = savedTag;
15
+ fiber.type = savedType;
16
+ }
17
+ }
18
+ registerTypeMatcher(
19
+ (_type, marker) => marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null
20
+ );
21
+ registerRenderer(FiberTag.ForwardRef, renderForwardRefStub);
22
+ //# sourceMappingURL=stub.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/forward-ref/stub.ts"],
4
+ "sourcesContent": ["import { FiberTag, type Fiber } from '../../../core'\nimport { REACT_FORWARD_REF_TYPE } from '../../../react'\nimport { registerRenderer, registerTypeMatcher, renderFiber } from '../../reconcile'\n\n// Stub: ForwardRef feature disabled. `forwardRef(fn)` elements still render,\n// but the ref prop is NOT forwarded \u2014 the component is called as a plain\n// function with just props. React 19+ supports refs as normal props on\n// function components, so most apps can drop forwardRef entirely; this stub\n// preserves JSX compatibility while stripping the dispatcher save/restore\n// machinery.\nfunction renderForwardRefStub(fiber: Fiber, domParent: Node, anchor: Node | null): void {\n const render = (fiber.type as any).render\n const savedTag = fiber.tag\n const savedType = fiber.type\n fiber.type = render\n fiber.tag = FiberTag.Function\n try {\n renderFiber(fiber, domParent, anchor)\n } finally {\n fiber.tag = savedTag\n fiber.type = savedType\n }\n}\n\nregisterTypeMatcher((_type, marker) =>\n marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null,\n)\nregisterRenderer(FiberTag.ForwardRef, renderForwardRefStub)\n"],
5
+ "mappings": ";AAAA,SAAS,gBAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,qBAAqB,mBAAmB;AAQnE,SAAS,qBAAqB,OAAc,WAAiB,QAA2B;AACtF,QAAM,SAAU,MAAM,KAAa;AACnC,QAAM,WAAW,MAAM;AACvB,QAAM,YAAY,MAAM;AACxB,QAAM,OAAO;AACb,QAAM,MAAM,SAAS;AACrB,MAAI;AACF,gBAAY,OAAO,WAAW,MAAM;AAAA,EACtC,UAAE;AACA,UAAM,MAAM;AACZ,UAAM,OAAO;AAAA,EACf;AACF;AAEA;AAAA,EAAoB,CAAC,OAAO,WAC1B,WAAW,yBAAyB,SAAS,aAAa;AAC5D;AACA,iBAAiB,SAAS,YAAY,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
1
+ import { type Fiber, type FiberRoot } from '../../../core';
2
+ export { drainReplayQueue } from '../../event-replay';
3
+ /**
4
+ * Preserve the user's scroll position across hydration. If the user scrolled
5
+ * between SSR paint and hydrate (common in dev where JS takes seconds to
6
+ * load), libraries that wire scroll-restoration into a `useLayoutEffect`
7
+ * near the root (e.g. TanStack Router) will run during our synchronous
8
+ * hydrate and call `window.scrollTo(savedFromLastVisit)` — overwriting the
9
+ * user's fresh scroll. We install a short-lived wrapper around scrollTo that
10
+ * suppresses programmatic calls when a user-initiated scroll happened
11
+ * recently. Only runs in the hydration feature — the stub skips it.
12
+ */
13
+ export declare function installHydrationScrollGuard(): void;
14
+ /**
15
+ * Hydration cursor: walks existing DOM children in document order so we can
16
+ * adopt them during fiber tree construction. One cursor per host parent.
17
+ *
18
+ * `endBefore` scopes the cursor to a subrange — used by rehydrateBoundary()
19
+ * so we only adopt DOM up to the closing `/$` marker for that boundary.
20
+ */
21
+ export declare class HydrationCursor {
22
+ next: ChildNode | null;
23
+ parent: Node;
24
+ endBefore: ChildNode | null;
25
+ constructor(parent: Node, start?: ChildNode | null, endBefore?: ChildNode | null);
26
+ takeHostNode(): ChildNode | null;
27
+ /**
28
+ * Position-insensitive lookup for head/html adoption. Scans forward past
29
+ * non-matching nodes without removing them, matching by tag AND the key
30
+ * attributes that identify head elements uniquely (rel/href for links,
31
+ * name/property for meta, src for script). Non-matching nodes stay in
32
+ * place so the SSR'd stylesheet/script order is preserved.
33
+ */
34
+ takeMatchingHeadElement(tag: string, props: Record<string, any>): ChildNode | null;
35
+ remaining(): ChildNode[];
36
+ }
37
+ export declare function beginHydration(root: FiberRoot): void;
38
+ export declare function endHydration(root: FiberRoot): void;
39
+ /**
40
+ * Inspect the current cursor position for a streaming-suspense boundary
41
+ * marker emitted by the server. Returns info + advances the cursor past the
42
+ * marker pair (start comment + fallback/real content + end comment).
43
+ */
44
+ export interface BoundaryInfo {
45
+ kind: 'pending' | 'resolved';
46
+ id: number;
47
+ startMark: Comment;
48
+ endMark: Comment;
49
+ }
50
+ export declare function tryConsumeBoundary(parent: Fiber): BoundaryInfo | null;
51
+ export declare function advanceCursorPast(parent: Fiber, node: Node): void;
52
+ export declare function getHydrationCursor(hostFiber: Fiber): HydrationCursor | undefined;
53
+ export declare function setHydrationCursor(hostFiber: Fiber, cursor: HydrationCursor): void;
54
+ export declare function clearHydrationCursor(hostFiber: Fiber): void;
55
+ /**
56
+ * Try to adopt a DOM node for this host fiber. Returns true if adopted.
57
+ * Attaches existing attrs/children via separate hydrate pass.
58
+ */
59
+ export declare function adoptHostDom(fiber: Fiber, parent: Fiber): boolean;
60
+ export declare function adoptTextDom(fiber: Fiber, parent: Fiber, text: string): boolean;
61
+ export declare function findHostParent(fiber: Fiber): Fiber;
@@ -0,0 +1,264 @@
1
+ // packages/redact/src/dom/features/hydration/full.ts
2
+ import { FiberTag } from "../../../core";
3
+ import { setProp } from "../../dom";
4
+ import { findRoot } from "../../reconcile";
5
+ import { drainReplayQueue } from "../../event-replay";
6
+ var GUARD_WINDOW_MS = 3e3;
7
+ function installHydrationScrollGuard() {
8
+ if (typeof window === "undefined") return;
9
+ const w = window;
10
+ if (w.__tdomScrollGuardInstalled) return;
11
+ w.__tdomScrollGuardInstalled = true;
12
+ const guardStartedAt = performance.now();
13
+ let lastUserScrollAt = 0;
14
+ let programmatic = 0;
15
+ w.__tdomScrollLog = [];
16
+ window.addEventListener(
17
+ "scroll",
18
+ () => {
19
+ if (programmatic === 0) {
20
+ lastUserScrollAt = performance.now();
21
+ w.__tdomScrollLog.push({ t: Math.round(lastUserScrollAt), ev: "user-scroll", y: window.scrollY });
22
+ }
23
+ },
24
+ { capture: true, passive: true }
25
+ );
26
+ const origScrollTo = window.scrollTo.bind(window);
27
+ window.scrollTo = function(...args) {
28
+ const now = performance.now();
29
+ const inGuardWindow = now - guardStartedAt < GUARD_WINDOW_MS;
30
+ const userScrolledRecently = lastUserScrollAt > 0 && now - lastUserScrollAt < 1500;
31
+ if (inGuardWindow && userScrolledRecently) {
32
+ w.__tdomScrollLog.push({
33
+ t: Math.round(now),
34
+ ev: "suppressed",
35
+ args: JSON.stringify(args).slice(0, 80),
36
+ tSinceHydrate: Math.round(now - guardStartedAt),
37
+ tSinceUserScroll: Math.round(now - lastUserScrollAt)
38
+ });
39
+ return;
40
+ }
41
+ w.__tdomScrollLog.push({
42
+ t: Math.round(now),
43
+ ev: "allowed",
44
+ args: JSON.stringify(args).slice(0, 80),
45
+ tSinceHydrate: Math.round(now - guardStartedAt),
46
+ inGuard: inGuardWindow,
47
+ userScrolled: userScrolledRecently
48
+ });
49
+ programmatic++;
50
+ try {
51
+ return origScrollTo.apply(this, args);
52
+ } finally {
53
+ queueMicrotask(() => {
54
+ programmatic = Math.max(0, programmatic - 1);
55
+ });
56
+ }
57
+ };
58
+ }
59
+ var HydrationCursor = class {
60
+ next;
61
+ parent;
62
+ endBefore;
63
+ constructor(parent, start = null, endBefore = null) {
64
+ this.parent = parent;
65
+ this.next = start ?? parent.firstChild;
66
+ this.endBefore = endBefore;
67
+ }
68
+ takeHostNode() {
69
+ while (this.next && this.next !== this.endBefore) {
70
+ const n = this.next;
71
+ if (n.nodeType !== 1 && n.nodeType !== 3) {
72
+ this.next = n.nextSibling;
73
+ continue;
74
+ }
75
+ this.next = n.nextSibling;
76
+ return n;
77
+ }
78
+ return null;
79
+ }
80
+ /**
81
+ * Position-insensitive lookup for head/html adoption. Scans forward past
82
+ * non-matching nodes without removing them, matching by tag AND the key
83
+ * attributes that identify head elements uniquely (rel/href for links,
84
+ * name/property for meta, src for script). Non-matching nodes stay in
85
+ * place so the SSR'd stylesheet/script order is preserved.
86
+ */
87
+ takeMatchingHeadElement(tag, props) {
88
+ const target = tag.toLowerCase();
89
+ const keyAttrs = HEAD_KEY_ATTRS[target] ?? [];
90
+ let scan = this.parent.firstChild;
91
+ while (scan) {
92
+ if (scan.nodeType === 1 && scan.tagName.toLowerCase() === target && headAttrsMatch(scan, props, keyAttrs)) {
93
+ CLAIMED.add(scan);
94
+ return scan;
95
+ }
96
+ scan = scan.nextSibling;
97
+ }
98
+ return null;
99
+ }
100
+ remaining() {
101
+ const out = [];
102
+ let n = this.next;
103
+ while (n && n !== this.endBefore) {
104
+ out.push(n);
105
+ n = n.nextSibling;
106
+ }
107
+ return out;
108
+ }
109
+ };
110
+ var hydrationCursors = /* @__PURE__ */ new WeakMap();
111
+ var HEAD_KEY_ATTRS = {
112
+ link: ["rel", "href", "sizes", "type"],
113
+ meta: ["name", "property", "charset", "http-equiv"],
114
+ script: ["src", "type"],
115
+ style: [],
116
+ title: []
117
+ };
118
+ var CLAIMED = /* @__PURE__ */ new WeakSet();
119
+ function headAttrsMatch(el, props, keys) {
120
+ if (CLAIMED.has(el)) return false;
121
+ if (keys.length === 0) return true;
122
+ for (const k of keys) {
123
+ const propVal = props[k] ?? (k === "http-equiv" ? props.httpEquiv : void 0);
124
+ const elVal = el.getAttribute(k);
125
+ if (propVal == null && elVal == null) continue;
126
+ if (propVal == null || elVal == null) continue;
127
+ if (String(propVal) !== elVal) return false;
128
+ }
129
+ return keys.some((k) => props[k] != null || el.hasAttribute(k));
130
+ }
131
+ function beginHydration(root) {
132
+ root.hydrating = true;
133
+ hydrationCursors.set(root.current, new HydrationCursor(root.container));
134
+ }
135
+ function endHydration(root) {
136
+ root.hydrating = false;
137
+ hydrationCursors.delete(root.current);
138
+ }
139
+ function tryConsumeBoundary(parent) {
140
+ const cursor = hydrationCursors.get(findHostParent(parent));
141
+ if (!cursor) return null;
142
+ const peek = cursor.next;
143
+ if (!peek || peek.nodeType !== 8) return null;
144
+ const data = peek.data;
145
+ const m = /^(\$\??)(\d+)$/.exec(data);
146
+ if (!m) return null;
147
+ const kind = m[1] === "$?" ? "pending" : "resolved";
148
+ const id = Number(m[2]);
149
+ const startMark = peek;
150
+ cursor.next = startMark.nextSibling;
151
+ let endMark = null;
152
+ let scan = startMark.nextSibling;
153
+ while (scan) {
154
+ if (scan.nodeType === 8 && scan.data === "/$") {
155
+ endMark = scan;
156
+ break;
157
+ }
158
+ scan = scan.nextSibling;
159
+ }
160
+ if (!endMark) return null;
161
+ return { kind, id, startMark, endMark };
162
+ }
163
+ function advanceCursorPast(parent, node) {
164
+ const cursor = hydrationCursors.get(findHostParent(parent));
165
+ if (!cursor) return;
166
+ cursor.next = node.nextSibling;
167
+ }
168
+ function getHydrationCursor(hostFiber) {
169
+ return hydrationCursors.get(hostFiber);
170
+ }
171
+ function setHydrationCursor(hostFiber, cursor) {
172
+ hydrationCursors.set(hostFiber, cursor);
173
+ }
174
+ function clearHydrationCursor(hostFiber) {
175
+ hydrationCursors.delete(hostFiber);
176
+ }
177
+ function adoptHostDom(fiber, parent) {
178
+ const hostParent = findHostParent(parent);
179
+ const cursor = hydrationCursors.get(hostParent);
180
+ if (!cursor) return false;
181
+ const tag = fiber.type.toLowerCase();
182
+ const parentEl = cursor.parent;
183
+ const parentTag = parentEl.nodeType === 1 ? parentEl.tagName.toLowerCase() : "";
184
+ const isHeadish = parentTag === "head" || parentTag === "html";
185
+ let candidate;
186
+ if (isHeadish) {
187
+ candidate = cursor.takeMatchingHeadElement(tag, fiber.pendingProps ?? {});
188
+ } else {
189
+ candidate = cursor.takeHostNode();
190
+ }
191
+ if (!candidate) {
192
+ if (!isHeadish) onMismatch(fiber, null);
193
+ return false;
194
+ }
195
+ if (candidate.nodeType !== 1 || candidate.tagName.toLowerCase() !== tag) {
196
+ onMismatch(fiber, candidate);
197
+ return false;
198
+ }
199
+ fiber.dom = candidate;
200
+ const props = fiber.pendingProps ?? {};
201
+ const isSvg = tag === "svg" || candidate.namespaceURI === "http://www.w3.org/2000/svg" && tag !== "foreignobject";
202
+ for (const k in props) {
203
+ if (k === "children") continue;
204
+ if (k[0] === "o" && k[1] === "n" && typeof props[k] === "function") {
205
+ setProp(candidate, k, props[k], void 0, isSvg);
206
+ }
207
+ }
208
+ hydrationCursors.set(fiber, new HydrationCursor(candidate));
209
+ return true;
210
+ }
211
+ function adoptTextDom(fiber, parent, text) {
212
+ const cursor = hydrationCursors.get(findHostParent(parent));
213
+ if (!cursor) return false;
214
+ const candidate = cursor.takeHostNode();
215
+ if (!candidate) return false;
216
+ if (candidate.nodeType === 3) {
217
+ if (candidate.data !== text) {
218
+ ;
219
+ candidate.data = text;
220
+ }
221
+ fiber.dom = candidate;
222
+ return true;
223
+ }
224
+ onMismatch(fiber, candidate);
225
+ return false;
226
+ }
227
+ function findHostParent(fiber) {
228
+ let f = fiber;
229
+ while (f) {
230
+ if (hydrationCursors.has(f)) return f;
231
+ if (f.tag === FiberTag.Host || f.tag === FiberTag.Root || f.tag === FiberTag.Portal) {
232
+ return f;
233
+ }
234
+ f = f.parent;
235
+ }
236
+ throw new Error("No host parent found");
237
+ }
238
+ function onMismatch(fiber, actualNode) {
239
+ const root = findRoot(fiber);
240
+ if (root?.onRecoverableError) {
241
+ root.onRecoverableError(
242
+ new Error(
243
+ `Hydration mismatch: expected <${fiber.type ?? "text"}> but found ${actualNode ? actualNode.nodeType === 1 ? actualNode.tagName : "text" : "nothing"}.`
244
+ )
245
+ );
246
+ }
247
+ if (actualNode && actualNode.parentNode) actualNode.parentNode.removeChild(actualNode);
248
+ }
249
+ export {
250
+ HydrationCursor,
251
+ adoptHostDom,
252
+ adoptTextDom,
253
+ advanceCursorPast,
254
+ beginHydration,
255
+ clearHydrationCursor,
256
+ drainReplayQueue,
257
+ endHydration,
258
+ findHostParent,
259
+ getHydrationCursor,
260
+ installHydrationScrollGuard,
261
+ setHydrationCursor,
262
+ tryConsumeBoundary
263
+ };
264
+ //# sourceMappingURL=full.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/hydration/full.ts"],
4
+ "sourcesContent": ["import { FiberTag, type Fiber, type FiberRoot } from '../../../core'\nimport { setProp } from '../../dom'\nimport { findRoot } from '../../reconcile'\n\n// Re-export from event-replay so all hydration concerns live behind one\n// feature boundary \u2014 the plugin's stub swap strips drainReplayQueue too.\nexport { drainReplayQueue } from '../../event-replay'\n\nconst GUARD_WINDOW_MS = 3000\n\n/**\n * Preserve the user's scroll position across hydration. If the user scrolled\n * between SSR paint and hydrate (common in dev where JS takes seconds to\n * load), libraries that wire scroll-restoration into a `useLayoutEffect`\n * near the root (e.g. TanStack Router) will run during our synchronous\n * hydrate and call `window.scrollTo(savedFromLastVisit)` \u2014 overwriting the\n * user's fresh scroll. We install a short-lived wrapper around scrollTo that\n * suppresses programmatic calls when a user-initiated scroll happened\n * recently. Only runs in the hydration feature \u2014 the stub skips it.\n */\nexport function installHydrationScrollGuard(): void {\n if (typeof window === 'undefined') return\n const w = window as any\n if (w.__tdomScrollGuardInstalled) return\n w.__tdomScrollGuardInstalled = true\n const guardStartedAt = performance.now()\n let lastUserScrollAt = 0\n let programmatic = 0\n w.__tdomScrollLog = []\n window.addEventListener(\n 'scroll',\n () => {\n if (programmatic === 0) {\n lastUserScrollAt = performance.now()\n w.__tdomScrollLog.push({ t: Math.round(lastUserScrollAt), ev: 'user-scroll', y: window.scrollY })\n }\n },\n { capture: true, passive: true },\n )\n const origScrollTo = window.scrollTo.bind(window)\n window.scrollTo = function (this: any, ...args: any[]) {\n const now = performance.now()\n const inGuardWindow = now - guardStartedAt < GUARD_WINDOW_MS\n const userScrolledRecently = lastUserScrollAt > 0 && now - lastUserScrollAt < 1500\n if (inGuardWindow && userScrolledRecently) {\n w.__tdomScrollLog.push({\n t: Math.round(now),\n ev: 'suppressed',\n args: JSON.stringify(args).slice(0, 80),\n tSinceHydrate: Math.round(now - guardStartedAt),\n tSinceUserScroll: Math.round(now - lastUserScrollAt),\n })\n return\n }\n w.__tdomScrollLog.push({\n t: Math.round(now),\n ev: 'allowed',\n args: JSON.stringify(args).slice(0, 80),\n tSinceHydrate: Math.round(now - guardStartedAt),\n inGuard: inGuardWindow,\n userScrolled: userScrolledRecently,\n })\n programmatic++\n try {\n return (origScrollTo as any).apply(this, args)\n } finally {\n queueMicrotask(() => {\n programmatic = Math.max(0, programmatic - 1)\n })\n }\n }\n}\n\n/**\n * Hydration cursor: walks existing DOM children in document order so we can\n * adopt them during fiber tree construction. One cursor per host parent.\n *\n * `endBefore` scopes the cursor to a subrange \u2014 used by rehydrateBoundary()\n * so we only adopt DOM up to the closing `/$` marker for that boundary.\n */\nexport class HydrationCursor {\n next: ChildNode | null\n parent: Node\n endBefore: ChildNode | null\n constructor(parent: Node, start: ChildNode | null = null, endBefore: ChildNode | null = null) {\n this.parent = parent\n this.next = start ?? parent.firstChild\n this.endBefore = endBefore\n }\n takeHostNode(): ChildNode | null {\n while (this.next && this.next !== this.endBefore) {\n const n = this.next\n // Skip anything that isn't an element (1) or text (3):\n // comments (8), doctype (10), processing instructions (7), cdata (4).\n if (n.nodeType !== 1 && n.nodeType !== 3) {\n this.next = n.nextSibling\n continue\n }\n this.next = n.nextSibling\n return n\n }\n return null\n }\n /**\n * Position-insensitive lookup for head/html adoption. Scans forward past\n * non-matching nodes without removing them, matching by tag AND the key\n * attributes that identify head elements uniquely (rel/href for links,\n * name/property for meta, src for script). Non-matching nodes stay in\n * place so the SSR'd stylesheet/script order is preserved.\n */\n takeMatchingHeadElement(tag: string, props: Record<string, any>): ChildNode | null {\n const target = tag.toLowerCase()\n const keyAttrs = HEAD_KEY_ATTRS[target] ?? []\n let scan = this.parent.firstChild\n while (scan) {\n if (\n scan.nodeType === 1 &&\n (scan as Element).tagName.toLowerCase() === target &&\n headAttrsMatch(scan as Element, props, keyAttrs)\n ) {\n CLAIMED.add(scan)\n return scan\n }\n scan = scan.nextSibling\n }\n return null\n }\n remaining(): ChildNode[] {\n const out: ChildNode[] = []\n let n = this.next\n while (n && n !== this.endBefore) {\n out.push(n)\n n = n.nextSibling\n }\n return out\n }\n}\n\nconst hydrationCursors = new WeakMap<Fiber, HydrationCursor>()\n\n// Head elements that we match against server DOM by attribute signature.\nconst HEAD_KEY_ATTRS: Record<string, ReadonlyArray<string>> = {\n link: ['rel', 'href', 'sizes', 'type'],\n meta: ['name', 'property', 'charset', 'http-equiv'],\n script: ['src', 'type'],\n style: [],\n title: [],\n}\n\n// DOM elements already claimed by some fiber during this hydration pass.\nconst CLAIMED = new WeakSet<Node>()\n\nfunction headAttrsMatch(\n el: Element,\n props: Record<string, any>,\n keys: ReadonlyArray<string>,\n): boolean {\n if (CLAIMED.has(el)) return false\n if (keys.length === 0) return true\n for (const k of keys) {\n const propVal = props[k] ?? (k === 'http-equiv' ? props.httpEquiv : undefined)\n const elVal = el.getAttribute(k)\n // If neither defines it, skip this key; if one defines it, they must match.\n if (propVal == null && elVal == null) continue\n if (propVal == null || elVal == null) continue // tolerate missing on either side\n if (String(propVal) !== elVal) return false\n }\n // At least one matching signal must be present.\n return keys.some((k) => props[k] != null || el.hasAttribute(k))\n}\n\nexport function beginHydration(root: FiberRoot): void {\n root.hydrating = true\n hydrationCursors.set(root.current, new HydrationCursor(root.container))\n}\n\nexport function endHydration(root: FiberRoot): void {\n root.hydrating = false\n hydrationCursors.delete(root.current)\n}\n\n/**\n * Inspect the current cursor position for a streaming-suspense boundary\n * marker emitted by the server. Returns info + advances the cursor past the\n * marker pair (start comment + fallback/real content + end comment).\n */\nexport interface BoundaryInfo {\n kind: 'pending' | 'resolved'\n id: number\n startMark: Comment\n endMark: Comment\n}\n\nexport function tryConsumeBoundary(parent: Fiber): BoundaryInfo | null {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return null\n const peek = cursor.next\n if (!peek || peek.nodeType !== 8) return null\n const data = (peek as Comment).data\n const m = /^(\\$\\??)(\\d+)$/.exec(data)\n if (!m) return null\n const kind = m[1] === '$?' ? 'pending' : 'resolved'\n const id = Number(m[2])\n const startMark = peek as Comment\n // Advance past the start comment\n cursor.next = startMark.nextSibling\n // Locate end comment: closest <!--/$-->\n let endMark: Comment | null = null\n let scan = startMark.nextSibling\n while (scan) {\n if (scan.nodeType === 8 && (scan as Comment).data === '/$') {\n endMark = scan as Comment\n break\n }\n scan = scan.nextSibling\n }\n if (!endMark) return null\n return { kind, id, startMark, endMark }\n}\n\nexport function advanceCursorPast(parent: Fiber, node: Node): void {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return\n cursor.next = node.nextSibling\n}\n\nexport function getHydrationCursor(hostFiber: Fiber): HydrationCursor | undefined {\n return hydrationCursors.get(hostFiber)\n}\n\nexport function setHydrationCursor(hostFiber: Fiber, cursor: HydrationCursor): void {\n hydrationCursors.set(hostFiber, cursor)\n}\n\nexport function clearHydrationCursor(hostFiber: Fiber): void {\n hydrationCursors.delete(hostFiber)\n}\n\n/**\n * Try to adopt a DOM node for this host fiber. Returns true if adopted.\n * Attaches existing attrs/children via separate hydrate pass.\n */\nexport function adoptHostDom(fiber: Fiber, parent: Fiber): boolean {\n const hostParent = findHostParent(parent)\n const cursor = hydrationCursors.get(hostParent)\n if (!cursor) return false\n\n const tag = (fiber.type as string).toLowerCase()\n const parentEl = cursor.parent as Element\n const parentTag =\n parentEl.nodeType === 1 ? (parentEl as Element).tagName.toLowerCase() : ''\n const isHeadish = parentTag === 'head' || parentTag === 'html'\n\n let candidate: ChildNode | null\n if (isHeadish) {\n // Head/html children are position-insensitive \u2014 server may emit them in\n // a different order than the React tree (React 19 head hoisting, etc.).\n // Scan forward without removing non-matching nodes; match on attribute\n // signature so we don't adopt the wrong <link> and clobber its props.\n candidate = cursor.takeMatchingHeadElement(tag, fiber.pendingProps ?? {})\n } else {\n candidate = cursor.takeHostNode()\n }\n\n if (!candidate) {\n // Client expected a host here but the cursor is exhausted \u2014 server gave\n // fewer children than the client tree. Report the structural gap (React\n // fires `onRecoverableError` for this exact case) and let the reconciler\n // mount a fresh DOM for this fiber below.\n // Exception: <head> children are position-insensitive; a missing match\n // there means \"server didn't hoist this one yet\", which we silently mount.\n if (!isHeadish) onMismatch(fiber, null)\n return false\n }\n\n if (candidate.nodeType !== 1 || (candidate as Element).tagName.toLowerCase() !== tag) {\n // mismatch \u2014 log and re-render fresh from this point\n onMismatch(fiber, candidate)\n return false\n }\n fiber.dom = candidate\n // Apply props (attach events, sync IDL props). Don't re-set existing attrs.\n const props = fiber.pendingProps ?? {}\n const isSvg =\n tag === 'svg' ||\n ((candidate as Element).namespaceURI === 'http://www.w3.org/2000/svg' &&\n tag !== 'foreignobject')\n for (const k in props) {\n if (k === 'children') continue\n if (k[0] === 'o' && k[1] === 'n' && typeof props[k] === 'function') {\n setProp(candidate as Element, k, props[k], undefined, isSvg)\n }\n // Non-event props: trust the server HTML, skip\n }\n // Set up child cursor for this host's children\n hydrationCursors.set(fiber, new HydrationCursor(candidate))\n return true\n}\n\nexport function adoptTextDom(fiber: Fiber, parent: Fiber, text: string): boolean {\n const cursor = hydrationCursors.get(findHostParent(parent))\n if (!cursor) return false\n const candidate = cursor.takeHostNode()\n if (!candidate) return false\n if (candidate.nodeType === 3) {\n if ((candidate as Text).data !== text) {\n ;(candidate as Text).data = text\n }\n fiber.dom = candidate\n return true\n }\n onMismatch(fiber, candidate)\n return false\n}\n\nexport function findHostParent(fiber: Fiber): Fiber {\n let f: Fiber | null = fiber\n while (f) {\n // A fiber explicitly holding a cursor acts as a boundary for hydration\n // (e.g. Suspense with a scoped cursor during fallback/boundary hydration).\n if (hydrationCursors.has(f)) return f\n if (f.tag === FiberTag.Host || f.tag === FiberTag.Root || f.tag === FiberTag.Portal) {\n return f\n }\n f = f.parent\n }\n throw new Error('No host parent found')\n}\n\nfunction onMismatch(fiber: Fiber, actualNode: ChildNode | null): void {\n // For v1: log and exit hydration for this subtree. The normal reconciler\n // will create a fresh DOM node below.\n const root = findRoot(fiber)\n if (root?.onRecoverableError) {\n root.onRecoverableError(\n new Error(\n `Hydration mismatch: expected <${(fiber.type as string) ?? 'text'}> but found ${\n actualNode ? (actualNode.nodeType === 1 ? (actualNode as Element).tagName : 'text') : 'nothing'\n }.`,\n ),\n )\n }\n // Remove stale DOM if still there\n if (actualNode && actualNode.parentNode) actualNode.parentNode.removeChild(actualNode)\n}\n"],
5
+ "mappings": ";AAAA,SAAS,gBAA4C;AACrD,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAIzB,SAAS,wBAAwB;AAEjC,IAAM,kBAAkB;AAYjB,SAAS,8BAAoC;AAClD,MAAI,OAAO,WAAW,YAAa;AACnC,QAAM,IAAI;AACV,MAAI,EAAE,2BAA4B;AAClC,IAAE,6BAA6B;AAC/B,QAAM,iBAAiB,YAAY,IAAI;AACvC,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,IAAE,kBAAkB,CAAC;AACrB,SAAO;AAAA,IACL;AAAA,IACA,MAAM;AACJ,UAAI,iBAAiB,GAAG;AACtB,2BAAmB,YAAY,IAAI;AACnC,UAAE,gBAAgB,KAAK,EAAE,GAAG,KAAK,MAAM,gBAAgB,GA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F;AAEA,mBAAiB,IAAI,OAAO,IAAI,gBAAgB,SAAS,CAAC;AAC1D,SAAO;AACT;AAEO,SAAS,aAAa,OAAc,QAAe,MAAuB;AAC/E,QAAM,SAAS,iBAAiB,IAAI,eAAe,MAAM,CAAC;AAC1D,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,YAAY,OAAO,aAAa;AACtC,MAAI,CAAC,UAAW,QAAO;AACvB,MAAI,UAAU,aAAa,GAAG;AAC5B,QAAK,UAAmB,SAAS,MAAM;AACrC;AAAC,MAAC,UAAmB,OAAO;AAAA,IAC9B;AACA,UAAM,MAAM;AACZ,WAAO;AAAA,EACT;AACA,aAAW,OAAO,SAAS;AAC3B,SAAO;AACT;AAEO,SAAS,eAAe,OAAqB;AAClD,MAAI,IAAkB;AACtB,SAAO,GAAG;AAGR,QAAI,iBAAiB,IAAI,CAAC,EAAG,QAAO;AACpC,QAAI,EAAE,QAAQ,SAAS,QAAQ,EAAE,QAAQ,SAAS,QAAQ,EAAE,QAAQ,SAAS,QAAQ;AACnF,aAAO;AAAA,IACT;AACA,QAAI,EAAE;AAAA,EACR;AACA,QAAM,IAAI,MAAM,sBAAsB;AACxC;AAEA,SAAS,WAAW,OAAc,YAAoC;AAGpE,QAAM,OAAO,SAAS,KAAK;AAC3B,MAAI,MAAM,oBAAoB;AAC5B,SAAK;AAAA,MACH,IAAI;AAAA,QACF,iCAAkC,MAAM,QAAmB,MAAM,eAC/D,aAAc,WAAW,aAAa,IAAK,WAAuB,UAAU,SAAU,SACxF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,cAAc,WAAW,WAAY,YAAW,WAAW,YAAY,UAAU;AACvF;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './full';
@@ -0,0 +1,3 @@
1
+ // packages/redact/src/dom/features/hydration/index.ts
2
+ export * from "./full";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/hydration/index.ts"],
4
+ "sourcesContent": ["export * from './full'\n"],
5
+ "mappings": ";AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import type { Fiber, FiberRoot } from '../../../core';
2
+ export declare class HydrationCursor {
3
+ next: ChildNode | null;
4
+ parent: Node;
5
+ endBefore: ChildNode | null;
6
+ constructor(parent?: Node, _s?: ChildNode | null, _e?: ChildNode | null);
7
+ takeHostNode(): ChildNode | null;
8
+ takeMatchingHeadElement(): ChildNode | null;
9
+ remaining(): ChildNode[];
10
+ }
11
+ export interface BoundaryInfo {
12
+ kind: 'pending' | 'resolved';
13
+ id: number;
14
+ startMark: Comment;
15
+ endMark: Comment;
16
+ }
17
+ export declare function beginHydration(_root: FiberRoot): void;
18
+ export declare function endHydration(_root: FiberRoot): void;
19
+ export declare function tryConsumeBoundary(_parent: Fiber): BoundaryInfo | null;
20
+ export declare function advanceCursorPast(_parent: Fiber, _node: Node): void;
21
+ export declare function getHydrationCursor(_hostFiber: Fiber): HydrationCursor | undefined;
22
+ export declare function setHydrationCursor(_hostFiber: Fiber, _cursor: HydrationCursor): void;
23
+ export declare function clearHydrationCursor(_hostFiber: Fiber): void;
24
+ export declare function adoptHostDom(_fiber: Fiber, _parent: Fiber): boolean;
25
+ export declare function adoptTextDom(_fiber: Fiber, _parent: Fiber, _text: string): boolean;
26
+ export declare function findHostParent(fiber: Fiber): Fiber;
27
+ export declare function installHydrationScrollGuard(): void;
28
+ export declare function drainReplayQueue(): void;
@@ -0,0 +1,66 @@
1
+ // packages/redact/src/dom/features/hydration/stub.ts
2
+ var HydrationCursor = class {
3
+ next = null;
4
+ parent;
5
+ endBefore = null;
6
+ constructor(parent, _s, _e) {
7
+ this.parent = parent;
8
+ }
9
+ takeHostNode() {
10
+ return null;
11
+ }
12
+ takeMatchingHeadElement() {
13
+ return null;
14
+ }
15
+ remaining() {
16
+ return [];
17
+ }
18
+ };
19
+ function beginHydration(_root) {
20
+ throw new Error(
21
+ "`hydrateRoot` requires the `hydration` feature. Enable it via @tanstack/redact/vite `features.hydration = true`, or use `createRoot` for a SPA (no SSR hydration)."
22
+ );
23
+ }
24
+ function endHydration(_root) {
25
+ }
26
+ function tryConsumeBoundary(_parent) {
27
+ return null;
28
+ }
29
+ function advanceCursorPast(_parent, _node) {
30
+ }
31
+ function getHydrationCursor(_hostFiber) {
32
+ return void 0;
33
+ }
34
+ function setHydrationCursor(_hostFiber, _cursor) {
35
+ }
36
+ function clearHydrationCursor(_hostFiber) {
37
+ }
38
+ function adoptHostDom(_fiber, _parent) {
39
+ return false;
40
+ }
41
+ function adoptTextDom(_fiber, _parent, _text) {
42
+ return false;
43
+ }
44
+ function findHostParent(fiber) {
45
+ return fiber;
46
+ }
47
+ function installHydrationScrollGuard() {
48
+ }
49
+ function drainReplayQueue() {
50
+ }
51
+ export {
52
+ HydrationCursor,
53
+ adoptHostDom,
54
+ adoptTextDom,
55
+ advanceCursorPast,
56
+ beginHydration,
57
+ clearHydrationCursor,
58
+ drainReplayQueue,
59
+ endHydration,
60
+ findHostParent,
61
+ getHydrationCursor,
62
+ installHydrationScrollGuard,
63
+ setHydrationCursor,
64
+ tryConsumeBoundary
65
+ };
66
+ //# sourceMappingURL=stub.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/dom/features/hydration/stub.ts"],
4
+ "sourcesContent": ["import type { Fiber, FiberRoot } from '../../../core'\n\n// Stub: Hydration feature disabled. Every adoption attempt returns \"no match\",\n// all cursor operations no-op, and `beginHydration` throws so `hydrateRoot`\n// fails loudly \u2014 apps that opt out of hydration should use `createRoot`.\n// The SSR walk-the-DOM machinery, streaming-boundary coordination, head\n// element matching, and the WeakMap of cursors per fiber are all stripped.\n\nexport class HydrationCursor {\n next: ChildNode | null = null\n parent: Node\n endBefore: ChildNode | null = null\n constructor(parent?: Node, _s?: ChildNode | null, _e?: ChildNode | null) {\n this.parent = parent as Node\n }\n takeHostNode(): ChildNode | null {\n return null\n }\n takeMatchingHeadElement(): ChildNode | null {\n return null\n }\n remaining(): ChildNode[] {\n return []\n }\n}\n\nexport interface BoundaryInfo {\n kind: 'pending' | 'resolved'\n id: number\n startMark: Comment\n endMark: Comment\n}\n\nexport function beginHydration(_root: FiberRoot): void {\n throw new Error(\n '`hydrateRoot` requires the `hydration` feature. ' +\n 'Enable it via @tanstack/redact/vite `features.hydration = true`, ' +\n 'or use `createRoot` for a SPA (no SSR hydration).',\n )\n}\n\nexport function endHydration(_root: FiberRoot): void {}\n\nexport function tryConsumeBoundary(_parent: Fiber): BoundaryInfo | null {\n return null\n}\n\nexport function advanceCursorPast(_parent: Fiber, _node: Node): void {}\n\nexport function getHydrationCursor(_hostFiber: Fiber): HydrationCursor | undefined {\n return undefined\n}\n\nexport function setHydrationCursor(_hostFiber: Fiber, _cursor: HydrationCursor): void {}\n\nexport function clearHydrationCursor(_hostFiber: Fiber): void {}\n\nexport function adoptHostDom(_fiber: Fiber, _parent: Fiber): boolean {\n return false\n}\n\nexport function adoptTextDom(_fiber: Fiber, _parent: Fiber, _text: string): boolean {\n return false\n}\n\nexport function findHostParent(fiber: Fiber): Fiber {\n return fiber\n}\n\nexport function installHydrationScrollGuard(): void {}\n\nexport function drainReplayQueue(): void {}\n"],
5
+ "mappings": ";AAQO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,OAAyB;AAAA,EACzB;AAAA,EACA,YAA8B;AAAA,EAC9B,YAAY,QAAe,IAAuB,IAAuB;AACvE,SAAK,SAAS;AAAA,EAChB;AAAA,EACA,eAAiC;AAC/B,WAAO;AAAA,EACT;AAAA,EACA,0BAA4C;AAC1C,WAAO;AAAA,EACT;AAAA,EACA,YAAyB;AACvB,WAAO,CAAC;AAAA,EACV;AACF;AASO,SAAS,eAAe,OAAwB;AACrD,QAAM,IAAI;AAAA,IACR;AAAA,EAGF;AACF;AAEO,SAAS,aAAa,OAAwB;AAAC;AAE/C,SAAS,mBAAmB,SAAqC;AACtE,SAAO;AACT;AAEO,SAAS,kBAAkB,SAAgB,OAAmB;AAAC;AAE/D,SAAS,mBAAmB,YAAgD;AACjF,SAAO;AACT;AAEO,SAAS,mBAAmB,YAAmB,SAAgC;AAAC;AAEhF,SAAS,qBAAqB,YAAyB;AAAC;AAExD,SAAS,aAAa,QAAe,SAAyB;AACnE,SAAO;AACT;AAEO,SAAS,aAAa,QAAe,SAAgB,OAAwB;AAClF,SAAO;AACT;AAEO,SAAS,eAAe,OAAqB;AAClD,SAAO;AACT;AAEO,SAAS,8BAAoC;AAAC;AAE9C,SAAS,mBAAyB;AAAC;",
6
+ "names": []
7
+ }