@bleedingdev/tanstack-redact 0.0.0-stage → 0.2.2

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 (476) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cloudflare/index.d.ts +6 -0
  3. package/dist/cloudflare/index.js +39 -0
  4. package/dist/cloudflare/index.js.map +7 -0
  5. package/dist/core/attributes.d.ts +4 -0
  6. package/dist/core/attributes.js +30 -0
  7. package/dist/core/attributes.js.map +7 -0
  8. package/dist/core/browser.d.ts +9 -0
  9. package/dist/core/browser.js +32 -0
  10. package/dist/core/browser.js.map +7 -0
  11. package/dist/core/class-props.d.ts +1 -0
  12. package/dist/core/class-props.js +15 -0
  13. package/dist/core/class-props.js.map +7 -0
  14. package/dist/core/devtools.d.ts +26 -0
  15. package/dist/core/devtools.js +70 -0
  16. package/dist/core/devtools.js.map +7 -0
  17. package/dist/core/functions.d.ts +6 -0
  18. package/dist/core/functions.js +14 -0
  19. package/dist/core/functions.js.map +7 -0
  20. package/dist/core/index.d.ts +2 -0
  21. package/dist/core/index.js +3 -0
  22. package/dist/core/index.js.map +7 -0
  23. package/dist/core/internal.d.ts +103 -0
  24. package/dist/core/internal.js +43 -0
  25. package/dist/core/internal.js.map +7 -0
  26. package/dist/core/resource-hints.d.ts +7 -0
  27. package/dist/core/resource-hints.js +20 -0
  28. package/dist/core/resource-hints.js.map +7 -0
  29. package/dist/core/types.d.ts +23 -0
  30. package/dist/core/types.js +8 -0
  31. package/dist/core/types.js.map +7 -0
  32. package/dist/core/unitless-style.d.ts +1 -0
  33. package/dist/core/unitless-style.js +5 -0
  34. package/dist/core/unitless-style.js.map +7 -0
  35. package/dist/dom/_all.d.ts +27 -0
  36. package/dist/dom/_all.js +51 -0
  37. package/dist/dom/_all.js.map +7 -0
  38. package/dist/dom/client.d.ts +9 -0
  39. package/dist/dom/client.js +13 -0
  40. package/dist/dom/client.js.map +7 -0
  41. package/dist/dom/commit.d.ts +27 -0
  42. package/dist/dom/commit.js +237 -0
  43. package/dist/dom/commit.js.map +7 -0
  44. package/dist/dom/devtools-effects.d.ts +8 -0
  45. package/dist/dom/devtools-effects.js +80 -0
  46. package/dist/dom/devtools-effects.js.map +7 -0
  47. package/dist/dom/devtools.d.ts +33 -0
  48. package/dist/dom/devtools.js +635 -0
  49. package/dist/dom/devtools.js.map +7 -0
  50. package/dist/dom/dispatcher.d.ts +4 -0
  51. package/dist/dom/dispatcher.js +437 -0
  52. package/dist/dom/dispatcher.js.map +7 -0
  53. package/dist/dom/document-metadata.d.ts +7 -0
  54. package/dist/dom/document-metadata.js +44 -0
  55. package/dist/dom/document-metadata.js.map +7 -0
  56. package/dist/dom/dom.d.ts +11 -0
  57. package/dist/dom/dom.js +165 -0
  58. package/dist/dom/dom.js.map +7 -0
  59. package/dist/dom/error-info.d.ts +2 -0
  60. package/dist/dom/error-info.js +19 -0
  61. package/dist/dom/error-info.js.map +7 -0
  62. package/dist/dom/event-replay.d.ts +13 -0
  63. package/dist/dom/event-replay.js +24 -0
  64. package/dist/dom/event-replay.js.map +7 -0
  65. package/dist/dom/features/activity/full.d.ts +1 -0
  66. package/dist/dom/features/activity/full.js +140 -0
  67. package/dist/dom/features/activity/full.js.map +7 -0
  68. package/dist/dom/features/activity/index.d.ts +1 -0
  69. package/dist/dom/features/activity/index.js +2 -0
  70. package/dist/dom/features/activity/index.js.map +7 -0
  71. package/dist/dom/features/activity/stub.d.ts +1 -0
  72. package/dist/dom/features/activity/stub.js +10 -0
  73. package/dist/dom/features/activity/stub.js.map +7 -0
  74. package/dist/dom/features/class/full.d.ts +1 -0
  75. package/dist/dom/features/class/full.js +208 -0
  76. package/dist/dom/features/class/full.js.map +7 -0
  77. package/dist/dom/features/class/index.d.ts +1 -0
  78. package/dist/dom/features/class/index.js +2 -0
  79. package/dist/dom/features/class/index.js.map +7 -0
  80. package/dist/dom/features/class/stub.d.ts +1 -0
  81. package/dist/dom/features/class/stub.js +46 -0
  82. package/dist/dom/features/class/stub.js.map +7 -0
  83. package/dist/dom/features/context/full.d.ts +4 -0
  84. package/dist/dom/features/context/full.js +103 -0
  85. package/dist/dom/features/context/full.js.map +7 -0
  86. package/dist/dom/features/context/index.d.ts +1 -0
  87. package/dist/dom/features/context/index.js +2 -0
  88. package/dist/dom/features/context/index.js.map +7 -0
  89. package/dist/dom/features/context/stub.d.ts +4 -0
  90. package/dist/dom/features/context/stub.js +21 -0
  91. package/dist/dom/features/context/stub.js.map +7 -0
  92. package/dist/dom/features/forward-ref/full.d.ts +1 -0
  93. package/dist/dom/features/forward-ref/full.js +9 -0
  94. package/dist/dom/features/forward-ref/full.js.map +7 -0
  95. package/dist/dom/features/forward-ref/index.d.ts +1 -0
  96. package/dist/dom/features/forward-ref/index.js +2 -0
  97. package/dist/dom/features/forward-ref/index.js.map +7 -0
  98. package/dist/dom/features/forward-ref/stub.d.ts +1 -0
  99. package/dist/dom/features/forward-ref/stub.js +9 -0
  100. package/dist/dom/features/forward-ref/stub.js.map +7 -0
  101. package/dist/dom/features/fragment-refs/index.d.ts +1 -0
  102. package/dist/dom/features/fragment-refs/index.js +9 -0
  103. package/dist/dom/features/fragment-refs/index.js.map +7 -0
  104. package/dist/dom/features/fragment-refs/stub.d.ts +5 -0
  105. package/dist/dom/features/fragment-refs/stub.js +17 -0
  106. package/dist/dom/features/fragment-refs/stub.js.map +7 -0
  107. package/dist/dom/features/hydration/full.d.ts +68 -0
  108. package/dist/dom/features/hydration/full.js +493 -0
  109. package/dist/dom/features/hydration/full.js.map +7 -0
  110. package/dist/dom/features/hydration/index.d.ts +1 -0
  111. package/dist/dom/features/hydration/index.js +2 -0
  112. package/dist/dom/features/hydration/index.js.map +7 -0
  113. package/dist/dom/features/hydration/stub.d.ts +36 -0
  114. package/dist/dom/features/hydration/stub.js +80 -0
  115. package/dist/dom/features/hydration/stub.js.map +7 -0
  116. package/dist/dom/features/index.d.ts +8 -0
  117. package/dist/dom/features/index.js +9 -0
  118. package/dist/dom/features/index.js.map +7 -0
  119. package/dist/dom/features/lazy/full.d.ts +1 -0
  120. package/dist/dom/features/lazy/full.js +23 -0
  121. package/dist/dom/features/lazy/full.js.map +7 -0
  122. package/dist/dom/features/lazy/index.d.ts +1 -0
  123. package/dist/dom/features/lazy/index.js +2 -0
  124. package/dist/dom/features/lazy/index.js.map +7 -0
  125. package/dist/dom/features/lazy/stub.d.ts +1 -0
  126. package/dist/dom/features/lazy/stub.js +19 -0
  127. package/dist/dom/features/lazy/stub.js.map +7 -0
  128. package/dist/dom/features/memo/full.d.ts +1 -0
  129. package/dist/dom/features/memo/full.js +34 -0
  130. package/dist/dom/features/memo/full.js.map +7 -0
  131. package/dist/dom/features/memo/index.d.ts +1 -0
  132. package/dist/dom/features/memo/index.js +2 -0
  133. package/dist/dom/features/memo/index.js.map +7 -0
  134. package/dist/dom/features/memo/stub.d.ts +1 -0
  135. package/dist/dom/features/memo/stub.js +9 -0
  136. package/dist/dom/features/memo/stub.js.map +7 -0
  137. package/dist/dom/features/portal/full.d.ts +1 -0
  138. package/dist/dom/features/portal/full.js +11 -0
  139. package/dist/dom/features/portal/full.js.map +7 -0
  140. package/dist/dom/features/portal/index.d.ts +1 -0
  141. package/dist/dom/features/portal/index.js +2 -0
  142. package/dist/dom/features/portal/index.js.map +7 -0
  143. package/dist/dom/features/portal/stub.d.ts +1 -0
  144. package/dist/dom/features/portal/stub.js +5 -0
  145. package/dist/dom/features/portal/stub.js.map +7 -0
  146. package/dist/dom/features/suspense/full.d.ts +1 -0
  147. package/dist/dom/features/suspense/full.js +389 -0
  148. package/dist/dom/features/suspense/full.js.map +7 -0
  149. package/dist/dom/features/suspense/index.d.ts +1 -0
  150. package/dist/dom/features/suspense/index.js +2 -0
  151. package/dist/dom/features/suspense/index.js.map +7 -0
  152. package/dist/dom/features/suspense/stub.d.ts +1 -0
  153. package/dist/dom/features/suspense/stub.js +4 -0
  154. package/dist/dom/features/suspense/stub.js.map +7 -0
  155. package/dist/dom/features/suspense-runtime/index.d.ts +1 -0
  156. package/dist/dom/features/suspense-runtime/index.js +2 -0
  157. package/dist/dom/features/suspense-runtime/index.js.map +7 -0
  158. package/dist/dom/features/suspense-runtime/stub.d.ts +1 -0
  159. package/dist/dom/features/suspense-runtime/stub.js +11 -0
  160. package/dist/dom/features/suspense-runtime/stub.js.map +7 -0
  161. package/dist/dom/features/view-transition/full.d.ts +7 -0
  162. package/dist/dom/features/view-transition/full.js +324 -0
  163. package/dist/dom/features/view-transition/full.js.map +7 -0
  164. package/dist/dom/features/view-transition/index.d.ts +1 -0
  165. package/dist/dom/features/view-transition/index.js +2 -0
  166. package/dist/dom/features/view-transition/index.js.map +7 -0
  167. package/dist/dom/features/view-transition/resources.d.ts +11 -0
  168. package/dist/dom/features/view-transition/resources.js +117 -0
  169. package/dist/dom/features/view-transition/resources.js.map +7 -0
  170. package/dist/dom/features/view-transition/stub.d.ts +7 -0
  171. package/dist/dom/features/view-transition/stub.js +21 -0
  172. package/dist/dom/features/view-transition/stub.js.map +7 -0
  173. package/dist/dom/features/view-transition/visual.d.ts +14 -0
  174. package/dist/dom/features/view-transition/visual.js +404 -0
  175. package/dist/dom/features/view-transition/visual.js.map +7 -0
  176. package/dist/dom/form-actions.d.ts +4 -0
  177. package/dist/dom/form-actions.js +74 -0
  178. package/dist/dom/form-actions.js.map +7 -0
  179. package/dist/dom/form-controls.d.ts +3 -0
  180. package/dist/dom/form-controls.js +91 -0
  181. package/dist/dom/form-controls.js.map +7 -0
  182. package/dist/dom/fragment-instance.d.ts +33 -0
  183. package/dist/dom/fragment-instance.js +449 -0
  184. package/dist/dom/fragment-instance.js.map +7 -0
  185. package/dist/dom/index.d.ts +61 -0
  186. package/dist/dom/index.js +71 -0
  187. package/dist/dom/index.js.map +7 -0
  188. package/dist/dom/portal.d.ts +2 -0
  189. package/dist/dom/portal.js +14 -0
  190. package/dist/dom/portal.js.map +7 -0
  191. package/dist/dom/react-ids.d.ts +6 -0
  192. package/dist/dom/react-ids.js +38 -0
  193. package/dist/dom/react-ids.js.map +7 -0
  194. package/dist/dom/reconcile.d.ts +86 -0
  195. package/dist/dom/reconcile.js +1305 -0
  196. package/dist/dom/reconcile.js.map +7 -0
  197. package/dist/dom/refresh.d.ts +12 -0
  198. package/dist/dom/refresh.js +174 -0
  199. package/dist/dom/refresh.js.map +7 -0
  200. package/dist/dom/resource-hints.d.ts +6 -0
  201. package/dist/dom/resource-hints.js +107 -0
  202. package/dist/dom/resource-hints.js.map +7 -0
  203. package/dist/dom/resource-store.d.ts +13 -0
  204. package/dist/dom/resource-store.js +47 -0
  205. package/dist/dom/resource-store.js.map +7 -0
  206. package/dist/dom/resources.d.ts +1 -0
  207. package/dist/dom/resources.js +46 -0
  208. package/dist/dom/resources.js.map +7 -0
  209. package/dist/dom/retained-effects.d.ts +6 -0
  210. package/dist/dom/retained-effects.js +67 -0
  211. package/dist/dom/retained-effects.js.map +7 -0
  212. package/dist/dom/root-internal.d.ts +11 -0
  213. package/dist/dom/root-internal.js +35 -0
  214. package/dist/dom/root-internal.js.map +7 -0
  215. package/dist/dom/root.d.ts +17 -0
  216. package/dist/dom/root.js +38 -0
  217. package/dist/dom/root.js.map +7 -0
  218. package/dist/dom/synthetic-event.d.ts +1 -0
  219. package/dist/dom/synthetic-event.js +37 -0
  220. package/dist/dom/synthetic-event.js.map +7 -0
  221. package/dist/dom/test-utils.d.ts +1 -0
  222. package/dist/dom/test-utils.js +5 -0
  223. package/dist/dom/test-utils.js.map +7 -0
  224. package/dist/dom/transitions.d.ts +9 -0
  225. package/dist/dom/transitions.js +147 -0
  226. package/dist/dom/transitions.js.map +7 -0
  227. package/dist/dom/tree.d.ts +5 -0
  228. package/dist/dom/tree.js +62 -0
  229. package/dist/dom/tree.js.map +7 -0
  230. package/dist/dom/walk.d.ts +2 -0
  231. package/dist/dom/walk.js +14 -0
  232. package/dist/dom/walk.js.map +7 -0
  233. package/dist/next/client.d.ts +9 -0
  234. package/dist/next/client.js +14 -0
  235. package/dist/next/client.js.map +7 -0
  236. package/dist/next/dev-cache-loader.cjs +13 -0
  237. package/dist/next/index.d.ts +2 -0
  238. package/dist/next/index.js +97 -0
  239. package/dist/next/index.js.map +7 -0
  240. package/dist/next/loader.cjs +10 -0
  241. package/dist/next/react.d.ts +71 -0
  242. package/dist/next/react.js +9 -0
  243. package/dist/next/react.js.map +7 -0
  244. package/dist/react/act.d.ts +3 -0
  245. package/dist/react/act.js +124 -0
  246. package/dist/react/act.js.map +7 -0
  247. package/dist/react/action-scope.d.ts +17 -0
  248. package/dist/react/action-scope.js +60 -0
  249. package/dist/react/action-scope.js.map +7 -0
  250. package/dist/react/activity.d.ts +7 -0
  251. package/dist/react/activity.js +7 -0
  252. package/dist/react/activity.js.map +7 -0
  253. package/dist/react/children.d.ts +8 -0
  254. package/dist/react/children.js +76 -0
  255. package/dist/react/children.js.map +7 -0
  256. package/dist/react/class.d.ts +36 -0
  257. package/dist/react/class.js +39 -0
  258. package/dist/react/class.js.map +7 -0
  259. package/dist/react/compiler-runtime.d.ts +1 -0
  260. package/dist/react/compiler-runtime.js +9 -0
  261. package/dist/react/compiler-runtime.js.map +7 -0
  262. package/dist/react/context.d.ts +32 -0
  263. package/dist/react/context.js +25 -0
  264. package/dist/react/context.js.map +7 -0
  265. package/dist/react/element.d.ts +13 -0
  266. package/dist/react/element.js +70 -0
  267. package/dist/react/element.js.map +7 -0
  268. package/dist/react/form-state.d.ts +26 -0
  269. package/dist/react/form-state.js +30 -0
  270. package/dist/react/form-state.js.map +7 -0
  271. package/dist/react/hooks.d.ts +67 -0
  272. package/dist/react/hooks.js +165 -0
  273. package/dist/react/hooks.js.map +7 -0
  274. package/dist/react/index.d.ts +99 -0
  275. package/dist/react/index.js +143 -0
  276. package/dist/react/index.js.map +7 -0
  277. package/dist/react/jsx-runtime.d.ts +24 -0
  278. package/dist/react/jsx-runtime.js +37 -0
  279. package/dist/react/jsx-runtime.js.map +7 -0
  280. package/dist/react/memo.d.ts +20 -0
  281. package/dist/react/memo.js +27 -0
  282. package/dist/react/memo.js.map +7 -0
  283. package/dist/react/portal.d.ts +1 -0
  284. package/dist/react/portal.js +5 -0
  285. package/dist/react/portal.js.map +7 -0
  286. package/dist/react/shared-internals.d.ts +52 -0
  287. package/dist/react/shared-internals.js +22 -0
  288. package/dist/react/shared-internals.js.map +7 -0
  289. package/dist/react/suspense.d.ts +15 -0
  290. package/dist/react/suspense.js +15 -0
  291. package/dist/react/suspense.js.map +7 -0
  292. package/dist/react/thenable.d.ts +1 -0
  293. package/dist/react/thenable.js +25 -0
  294. package/dist/react/thenable.js.map +7 -0
  295. package/dist/react/view-transition.d.ts +32 -0
  296. package/dist/react/view-transition.js +12 -0
  297. package/dist/react/view-transition.js.map +7 -0
  298. package/dist/scheduler/index.d.ts +44 -0
  299. package/dist/scheduler/index.js +109 -0
  300. package/dist/scheduler/index.js.map +7 -0
  301. package/dist/server/bootstrap-script.d.ts +3 -0
  302. package/dist/server/bootstrap-script.js +17 -0
  303. package/dist/server/bootstrap-script.js.map +7 -0
  304. package/dist/server/dispatcher.d.ts +57 -0
  305. package/dist/server/dispatcher.js +157 -0
  306. package/dist/server/dispatcher.js.map +7 -0
  307. package/dist/server/escape.d.ts +6 -0
  308. package/dist/server/escape.js +75 -0
  309. package/dist/server/escape.js.map +7 -0
  310. package/dist/server/index.d.ts +16 -0
  311. package/dist/server/index.js +25 -0
  312. package/dist/server/index.js.map +7 -0
  313. package/dist/server/insertion-context.d.ts +3 -0
  314. package/dist/server/insertion-context.js +32 -0
  315. package/dist/server/renderToString.d.ts +7 -0
  316. package/dist/server/renderToString.js +33 -0
  317. package/dist/server/renderToString.js.map +7 -0
  318. package/dist/server/resource-hints.d.ts +22 -0
  319. package/dist/server/resource-hints.js +168 -0
  320. package/dist/server/resource-hints.js.map +7 -0
  321. package/dist/server/stream-ids.d.ts +3 -0
  322. package/dist/server/stream-ids.js +8 -0
  323. package/dist/server/stream.d.ts +61 -0
  324. package/dist/server/stream.js +418 -0
  325. package/dist/server/stream.js.map +7 -0
  326. package/dist/server/walk.d.ts +58 -0
  327. package/dist/server/walk.js +378 -0
  328. package/dist/server/walk.js.map +7 -0
  329. package/dist/vinext/compatibility.d.ts +23 -0
  330. package/dist/vinext/compatibility.js +127 -0
  331. package/dist/vinext/compatibility.js.map +7 -0
  332. package/dist/vinext/flight-timing.d.ts +1 -0
  333. package/dist/vinext/flight-timing.js +46 -0
  334. package/dist/vinext/flight-timing.js.map +7 -0
  335. package/dist/vinext/index.d.ts +5 -0
  336. package/dist/vinext/index.js +50 -0
  337. package/dist/vinext/index.js.map +7 -0
  338. package/dist/vite/index.d.ts +102 -0
  339. package/dist/vite/index.js +291 -0
  340. package/dist/vite/index.js.map +7 -0
  341. package/dist/vite/react18.d.ts +4 -0
  342. package/dist/vite/react18.js +74 -0
  343. package/dist/vite/react18.js.map +7 -0
  344. package/package.json +121 -4
  345. package/src/cloudflare/index.ts +44 -0
  346. package/src/core/attributes.ts +20 -0
  347. package/src/core/browser.ts +34 -0
  348. package/src/core/class-props.ts +12 -0
  349. package/src/core/devtools.ts +69 -0
  350. package/src/core/functions.ts +11 -0
  351. package/src/core/index.ts +2 -0
  352. package/src/core/internal.ts +123 -0
  353. package/src/core/resource-hints.ts +39 -0
  354. package/src/core/types.ts +39 -0
  355. package/src/core/unitless-style.ts +1 -0
  356. package/src/dom/_all.ts +46 -0
  357. package/src/dom/client.ts +17 -0
  358. package/src/dom/commit.ts +223 -0
  359. package/src/dom/devtools-effects.ts +78 -0
  360. package/src/dom/devtools.ts +527 -0
  361. package/src/dom/dispatcher.ts +476 -0
  362. package/src/dom/document-metadata.ts +41 -0
  363. package/src/dom/dom.ts +181 -0
  364. package/src/dom/error-info.ts +20 -0
  365. package/src/dom/event-replay.ts +39 -0
  366. package/src/dom/features/activity/full.ts +150 -0
  367. package/src/dom/features/activity/index.ts +1 -0
  368. package/src/dom/features/activity/stub.ts +12 -0
  369. package/src/dom/features/class/full.ts +202 -0
  370. package/src/dom/features/class/index.ts +1 -0
  371. package/src/dom/features/class/stub.ts +58 -0
  372. package/src/dom/features/context/full.ts +107 -0
  373. package/src/dom/features/context/index.ts +1 -0
  374. package/src/dom/features/context/stub.ts +26 -0
  375. package/src/dom/features/forward-ref/full.ts +9 -0
  376. package/src/dom/features/forward-ref/index.ts +1 -0
  377. package/src/dom/features/forward-ref/stub.ts +15 -0
  378. package/src/dom/features/fragment-refs/index.ts +1 -0
  379. package/src/dom/features/fragment-refs/stub.ts +6 -0
  380. package/src/dom/features/hydration/full.ts +563 -0
  381. package/src/dom/features/hydration/index.ts +1 -0
  382. package/src/dom/features/hydration/stub.ts +86 -0
  383. package/src/dom/features/index.ts +12 -0
  384. package/src/dom/features/lazy/full.ts +27 -0
  385. package/src/dom/features/lazy/index.ts +1 -0
  386. package/src/dom/features/lazy/stub.ts +24 -0
  387. package/src/dom/features/memo/full.ts +39 -0
  388. package/src/dom/features/memo/index.ts +1 -0
  389. package/src/dom/features/memo/stub.ts +13 -0
  390. package/src/dom/features/portal/full.ts +14 -0
  391. package/src/dom/features/portal/index.ts +1 -0
  392. package/src/dom/features/portal/stub.ts +11 -0
  393. package/src/dom/features/suspense/full.ts +469 -0
  394. package/src/dom/features/suspense/index.ts +1 -0
  395. package/src/dom/features/suspense/stub.ts +13 -0
  396. package/src/dom/features/suspense-runtime/index.ts +1 -0
  397. package/src/dom/features/suspense-runtime/stub.ts +1 -0
  398. package/src/dom/features/view-transition/full.ts +292 -0
  399. package/src/dom/features/view-transition/index.ts +1 -0
  400. package/src/dom/features/view-transition/resources.ts +123 -0
  401. package/src/dom/features/view-transition/stub.ts +8 -0
  402. package/src/dom/features/view-transition/visual.ts +454 -0
  403. package/src/dom/form-actions.ts +69 -0
  404. package/src/dom/form-controls.ts +91 -0
  405. package/src/dom/fragment-instance.ts +462 -0
  406. package/src/dom/index.ts +49 -0
  407. package/src/dom/portal.ts +16 -0
  408. package/src/dom/react-ids.ts +36 -0
  409. package/src/dom/reconcile.ts +1423 -0
  410. package/src/dom/refresh.ts +171 -0
  411. package/src/dom/resource-hints.ts +104 -0
  412. package/src/dom/resource-store.ts +50 -0
  413. package/src/dom/resources.ts +47 -0
  414. package/src/dom/retained-effects.ts +57 -0
  415. package/src/dom/root-internal.ts +37 -0
  416. package/src/dom/root.ts +59 -0
  417. package/src/dom/synthetic-event.ts +27 -0
  418. package/src/dom/test-utils.ts +1 -0
  419. package/src/dom/transitions.ts +141 -0
  420. package/src/dom/tree.ts +56 -0
  421. package/src/dom/walk.ts +8 -0
  422. package/src/next/client.ts +10 -0
  423. package/src/next/dev-cache-loader.cjs +13 -0
  424. package/src/next/index.ts +95 -0
  425. package/src/next/loader.cjs +10 -0
  426. package/src/next/react.ts +7 -0
  427. package/src/react/act.ts +105 -0
  428. package/src/react/action-scope.ts +57 -0
  429. package/src/react/activity.ts +10 -0
  430. package/src/react/children.ts +86 -0
  431. package/src/react/class.ts +66 -0
  432. package/src/react/compiler-runtime.ts +8 -0
  433. package/src/react/context.ts +46 -0
  434. package/src/react/element.ts +82 -0
  435. package/src/react/form-state.ts +35 -0
  436. package/src/react/hooks.ts +214 -0
  437. package/src/react/index.ts +91 -0
  438. package/src/react/jsx-runtime.ts +50 -0
  439. package/src/react/memo.ts +42 -0
  440. package/src/react/portal.ts +1 -0
  441. package/src/react/shared-internals.ts +80 -0
  442. package/src/react/suspense.ts +18 -0
  443. package/src/react/thenable.ts +21 -0
  444. package/src/react/view-transition.ts +41 -0
  445. package/src/scheduler/index.ts +124 -0
  446. package/src/server/bootstrap-script.ts +92 -0
  447. package/src/server/dispatcher.ts +168 -0
  448. package/src/server/escape.ts +102 -0
  449. package/src/server/index.ts +26 -0
  450. package/src/server/insertion-context.ts +28 -0
  451. package/src/server/renderToString.ts +35 -0
  452. package/src/server/resource-hints.ts +166 -0
  453. package/src/server/stream-ids.ts +5 -0
  454. package/src/server/stream.ts +525 -0
  455. package/src/server/walk.ts +555 -0
  456. package/src/vinext/compatibility.ts +122 -0
  457. package/src/vinext/flight-timing.ts +37 -0
  458. package/src/vinext/index.ts +47 -0
  459. package/src/vite/index.ts +476 -0
  460. package/src/vite/react18.ts +74 -0
  461. package/vendor/cloudflare-vite-plugin/LICENSE +25 -0
  462. package/vendor/cloudflare-vite-plugin/README.md +9 -0
  463. package/vendor/cloudflare-vite-plugin/dist/chunk-U6NEESU5-BmLHqeIt.mjs +43 -0
  464. package/vendor/cloudflare-vite-plugin/dist/index.d.mts +155 -0
  465. package/vendor/cloudflare-vite-plugin/dist/index.mjs +94700 -0
  466. package/vendor/cloudflare-vite-plugin/dist/open-PCXX3ZDZ-DYH87NhH.mjs +530 -0
  467. package/vendor/cloudflare-vite-plugin/dist/package-4cnqy5mM.mjs +84 -0
  468. package/vendor/cloudflare-vite-plugin/dist/workers/asset-worker/index.js +5996 -0
  469. package/vendor/cloudflare-vite-plugin/dist/workers/router-worker/index.js +6414 -0
  470. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/index.js +457 -0
  471. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner-legacy.js +1129 -0
  472. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner.js +1259 -0
  473. package/vendor/cloudflare-vite-plugin/dist/workers/vite-proxy-worker/index.js +31 -0
  474. package/vendor/cloudflare-vite-plugin/package.json +90 -0
  475. package/vendor/cloudflare-vite-plugin/provenance.json +26 -0
  476. package/README.md +0 -3
@@ -0,0 +1,27 @@
1
+ import { FiberTag, type Fiber } from '../../../core';
2
+ import { REACT_LAZY_TYPE } from '../../../react';
3
+ import { installRenderer, registerTypeMatcher, delegateFiber, isThenable, handleSuspended, deferHydration, } from '../../reconcile';
4
+ import { resolveRefreshType } from '../../refresh';
5
+ function renderLazy(fiber: Fiber): void {
6
+ const { _payload, _init } = fiber.type as any;
7
+ let resolved: any;
8
+ try {
9
+ resolved = _init(_payload);
10
+ if (process.env.NODE_ENV !== 'production')
11
+ resolved = resolveRefreshType(resolved);
12
+ }
13
+ catch (thenable: any) {
14
+ if (isThenable(thenable)) {
15
+ if (deferHydration(fiber, thenable))
16
+ return;
17
+ handleSuspended(fiber, thenable);
18
+ // reconcile would be called here if we were rendering children,
19
+ // but Lazy delegates and has no children of its own.
20
+ return;
21
+ }
22
+ throw thenable;
23
+ }
24
+ delegateFiber(fiber, resolved);
25
+ }
26
+ registerTypeMatcher((_type, marker) => (marker === REACT_LAZY_TYPE ? FiberTag.Lazy : null));
27
+ installRenderer(FiberTag.Lazy, renderLazy);
@@ -0,0 +1 @@
1
+ export * from './full'
@@ -0,0 +1,24 @@
1
+ import { FiberTag, type Fiber } from '../../../core';
2
+ import { REACT_LAZY_TYPE } from '../../../react';
3
+ import { installRenderer, registerTypeMatcher, delegateFiber, isThenable, handleSuspended, } from '../../reconcile';
4
+ // Stub: Lazy feature disabled. Lazy elements still resolve — sync if the
5
+ // payload is ready, otherwise the thrown thenable goes through the default
6
+ // `handleSuspended` capability (retry-on-settle). What's stripped: the
7
+ // hydration-deferred-reveal pathway and the Suspense-awaiting coordination.
8
+ function renderLazyStub(fiber: Fiber): void {
9
+ const { _payload, _init } = fiber.type as any;
10
+ let resolved: any;
11
+ try {
12
+ resolved = _init(_payload);
13
+ }
14
+ catch (thrown: any) {
15
+ if (isThenable(thrown)) {
16
+ handleSuspended(fiber, thrown);
17
+ return;
18
+ }
19
+ throw thrown;
20
+ }
21
+ delegateFiber(fiber, resolved);
22
+ }
23
+ registerTypeMatcher((_type, marker) => (marker === REACT_LAZY_TYPE ? FiberTag.Lazy : null));
24
+ installRenderer(FiberTag.Lazy, renderLazyStub);
@@ -0,0 +1,39 @@
1
+ import { FiberTag, type Fiber } from '../../../core';
2
+ import { REACT_MEMO_TYPE, } from '../../../react';
3
+ import { installRenderer, registerTypeMatcher, delegateFiber, getForceRerenderingFiber, } from '../../reconcile';
4
+ import { ownContextChanged, renderContextConsumers } from '../context';
5
+ import { resolveRefreshMemo } from '../../refresh';
6
+ function shallowEqual(a: any, b: any): boolean {
7
+ if (a === b)
8
+ return true;
9
+ if (!a || !b)
10
+ return false;
11
+ const ak = Object.keys(a);
12
+ const bk = Object.keys(b);
13
+ if (ak.length !== bk.length)
14
+ return false;
15
+ for (const k of ak) {
16
+ if (a[k] !== b[k])
17
+ return false;
18
+ }
19
+ return true;
20
+ }
21
+ function renderMemo(fiber: Fiber): void {
22
+ const { type, compare } = process.env.NODE_ENV !== 'production' ? resolveRefreshMemo(fiber.type) : fiber.type as any;
23
+ const props = fiber.v ?? {};
24
+ const prev = fiber.m;
25
+ // Memo's prop-equality gate guards PARENT-triggered rerenders. If this
26
+ // render is a STATE-triggered rerender of this exact fiber (hook update,
27
+ // useSyncExternalStore notification), props haven't changed by definition —
28
+ // bailing would swallow the state change and the subscriber never re-runs.
29
+ // rerenderFiber tags the fiber so we skip the gate here.
30
+ const bypassMemo = fiber.g || fiber === getForceRerenderingFiber();
31
+ const eq = !bypassMemo && prev && (compare ? compare(prev, props) : shallowEqual(prev, props));
32
+ if (eq && !ownContextChanged(fiber)) {
33
+ renderContextConsumers(fiber);
34
+ return;
35
+ }
36
+ delegateFiber(fiber, type);
37
+ }
38
+ registerTypeMatcher((_type, marker) => (marker === REACT_MEMO_TYPE ? FiberTag.Memo : null));
39
+ installRenderer(FiberTag.Memo, renderMemo);
@@ -0,0 +1 @@
1
+ export * from './full'
@@ -0,0 +1,13 @@
1
+ import { FiberTag, type Fiber } from '../../../core';
2
+ import { REACT_MEMO_TYPE, } from '../../../react';
3
+ import { installRenderer, registerTypeMatcher, delegateFiber } from '../../reconcile';
4
+ // Stub: Memo feature disabled. `memo(Component)` still works — the element
5
+ // renders — but without the prop-equality gate, so every parent rerender
6
+ // passes through to the inner component. `shallowEqual` and the
7
+ // forceRerenderingFiber read are stripped.
8
+ function renderMemoStub(fiber: Fiber): void {
9
+ const { type } = fiber.type as any;
10
+ delegateFiber(fiber, type);
11
+ }
12
+ registerTypeMatcher((_type, marker) => (marker === REACT_MEMO_TYPE ? FiberTag.Memo : null));
13
+ installRenderer(FiberTag.Memo, renderMemoStub);
@@ -0,0 +1,14 @@
1
+ import { FiberTag, type Fiber, type ReactNode } from '../../../core';
2
+ import { REACT_PORTAL_TYPE } from '../../../react';
3
+ import { installRenderer, registerTypeMatcher, registerElementMarker, reconcileRaw, childrenToArray, } from '../../reconcile';
4
+ function renderPortal(fiber: Fiber): void {
5
+ const { children } = fiber.v as {
6
+ children: ReactNode;
7
+ container: Element;
8
+ };
9
+ reconcileRaw(fiber, children);
10
+ fiber.m = fiber.v;
11
+ }
12
+ registerElementMarker(REACT_PORTAL_TYPE);
13
+ registerTypeMatcher((type) => (type === REACT_PORTAL_TYPE ? FiberTag.Portal : null));
14
+ installRenderer(FiberTag.Portal, renderPortal);
@@ -0,0 +1 @@
1
+ export * from './full'
@@ -0,0 +1,11 @@
1
+ import { FiberTag } from '../../../core'
2
+ import { REACT_PORTAL_TYPE } from '../../../react'
3
+ import { registerTypeMatcher, registerElementMarker } from '../../reconcile'
4
+
5
+ // Stub: Portal feature disabled. Portal elements still flow through JSX
6
+ // (otherwise they'd be silently dropped by child normalization), but render
7
+ // in place as a Fragment — the `container` prop is ignored. No Portal
8
+ // renderer is registered, so the `renderPortal` function and its deps don't
9
+ // ship in builds that select this stub.
10
+ registerElementMarker(REACT_PORTAL_TYPE)
11
+ registerTypeMatcher((type) => (type === REACT_PORTAL_TYPE ? FiberTag.Fragment : null))
@@ -0,0 +1,469 @@
1
+ import { readOwnerStack, runWithOwnerStack } from '../../../core/devtools';
2
+ import { a as transitionRender } from '../suspense-runtime';
3
+ import { cleanupEffect } from '../../dispatcher';
4
+ import { checkpointCommit, rewindCommit, queueMutation, onCommitFailure, onCommitRollback, commitSynchronously } from '../../commit';
5
+ import { REACT_SUSPENSE_TYPE, ReactSharedInternals, startTransition } from '../../../react';
6
+ import { FiberTag, createFiber, type Fiber } from '../../../core';
7
+ import { disconnectClass, inSuspensePrimary, setRetainedFlag, walkRetained } from '../../retained-effects';
8
+ import { hasContextChanged, renderContextConsumers } from '../context';
9
+ import { installRenderer, registerTypeMatcher, installCapability, reconcileRaw, childrenToArray, renderNode, scheduleUpdate, unmountAllChildren, removeFiber, findRoot, runEffects, getCurrentRoot, withCurrentRoot, discardPendingWork, findSuspenseBoundary, RenderSuspenseCapture, activityIsDisconnected, isActivityHidden, attachRef, detachRef, enqueueEffect, flushFiberCommits, scheduleLifecycle, handleCommitError, disposeCleanup, isThenable, defaultHandleSuspended, } from '../../reconcile';
10
+ import { HydrationCursor, setHydrationCursor, clearHydrationCursor, advanceCursorPast, tryConsumeBoundary, isHydrationBailout, } from '../hydration';
11
+ import { devToolsSuspension } from '../../devtools';
12
+ let suspendHandler: ((t: Promise<any>) => void) | null = null;
13
+ function clearBoundaryRange(startMark: Comment, endMark: Comment): void {
14
+ queueMutation(() => {
15
+ let node = startMark.nextSibling;
16
+ while (node && node !== endMark) {
17
+ const next = node.nextSibling;
18
+ (node as ChildNode).remove();
19
+ node = next;
20
+ }
21
+ });
22
+ }
23
+ function rehydrateBoundary(fiber: Fiber): void {
24
+ const state = fiber.b;
25
+ if (!state?.b || !state.e)
26
+ return;
27
+ const root = findRoot(fiber);
28
+ const parent = state.b.parentNode as Node;
29
+ if (!(root && parent))
30
+ return;
31
+ // Both initial hydration and a streamed reveal adopt the same marked range.
32
+ commitSynchronously(() => withCurrentRoot(root, () => {
33
+ const previous = root.h;
34
+ try {
35
+ const kind = state.b.data.startsWith('$E') ? 3 : state.b.data.startsWith('$!') ? 2 : 0;
36
+ if (!kind)
37
+ unmountAllChildren(fiber);
38
+ root.h = true;
39
+ hydrateSuspenseBoundary(fiber, { ...fiber.v, children: state.r }, [kind, 0, state.b, state.e], true);
40
+ }
41
+ finally {
42
+ root.h = previous;
43
+ }
44
+ runEffects(root);
45
+ }));
46
+ }
47
+ // React's Suspense semantics: when a re-render of an already-committed
48
+ // boundary suspends, the previously-committed children are kept in the DOM
49
+ // (hidden) so their scroll position, focus, selection, native form state,
50
+ // and component state survive across the suspension. The fallback is mounted
51
+ // alongside the hidden primary until the pending promise resolves.
52
+ //
53
+ // We track the hidden subtree DOM in `state.d` (root host nodes +
54
+ // their original `display` so we can restore it) and the fallback as a
55
+ // detached Fragment fiber in `state.f` (deliberately kept OUT of
56
+ // `fiber.c` so reconciles against `props.children` don't trip on it).
57
+ // First-mount suspensions discard the failed primary but retain a separate
58
+ // fallback fiber so unsuccessful retries preserve its state and DOM.
59
+ interface SuspenseState {
60
+ p?: Promise<any> | null;
61
+ b?: Comment;
62
+ e?: Comment;
63
+ r?: any;
64
+ w?: boolean;
65
+ x?: () => void;
66
+ u?: boolean;
67
+ // Re-suspend preservation:
68
+ d?: Array<[
69
+ HTMLElement,
70
+ string
71
+ ]> | null;
72
+ f?: Fiber | null;
73
+ }
74
+ function reportServerFailure(fiber: Fiber): void {
75
+ const error = new Error(process.env.NODE_ENV !== 'production' ? 'Switched to client rendering because the server render did not complete.' : '');
76
+ const handler = findRoot(fiber)?.re;
77
+ if (handler) {
78
+ if (process.env.NODE_ENV !== 'production') runWithOwnerStack(readOwnerStack(fiber), () => handler(error, { componentStack: null }));
79
+ else handler(error, { componentStack: null });
80
+ }
81
+ else
82
+ console.error(error);
83
+ }
84
+ function recoverBoundaryHydration(fiber: Fiber, children: any, parent: Node, startMark: Comment | null, endMark: Comment | null, retryBoundary?: boolean): void {
85
+ const clear = () => {
86
+ const dispose = fiber.b?.x;
87
+ if (dispose) queueMutation(dispose);
88
+ if (startMark && endMark)
89
+ clearBoundaryRange(startMark, endMark);
90
+ else
91
+ queueMutation(() => { parent.textContent = ''; });
92
+ };
93
+ const root = findRoot(fiber)!;
94
+ const prevHydrating = root.h;
95
+ if (!retryBoundary)
96
+ discardPendingWork(root);
97
+ clear();
98
+ unmountAllChildren(fiber);
99
+ root.h = false;
100
+ try {
101
+ if (retryBoundary) {
102
+ fiber.b = { b: startMark, e: endMark };
103
+ renderSuspense(fiber);
104
+ }
105
+ else
106
+ reconcileRaw(fiber, children);
107
+ if (endMark)
108
+ advanceCursorPast(fiber.p!, endMark);
109
+ }
110
+ catch (clientError) {
111
+ onCommitFailure(() => {
112
+ clear();
113
+ unmountAllChildren(fiber);
114
+ });
115
+ throw clientError;
116
+ }
117
+ finally {
118
+ root.h = prevHydrating;
119
+ }
120
+ }
121
+ function scheduleRetry(fiber: Fiber): void {
122
+ const previous = ReactSharedInternals.T;
123
+ ReactSharedInternals.T = null;
124
+ try {
125
+ startTransition(() => scheduleUpdate(fiber));
126
+ }
127
+ finally {
128
+ ReactSharedInternals.T = previous;
129
+ }
130
+ }
131
+ function retryHydration(fiber: Fiber, thenable: Promise<any>): void {
132
+ const retry = () => { if (!fiber.u) scheduleRetry(fiber); };
133
+ thenable.then(retry, retry);
134
+ }
135
+ function hydrateSuspenseBoundary(fiber: Fiber, props: any, boundary: [
136
+ 0 | 1 | 2 | 3,
137
+ number,
138
+ Comment,
139
+ Comment
140
+ ], reveal?: boolean): void {
141
+ const [pendingBoundary, id, startMark, endMark] = boundary;
142
+ // Record the boundary shape so we can re-hydrate on reveal.
143
+ fiber.b = {
144
+ b: startMark,
145
+ e: endMark,
146
+ r: props.children,
147
+ };
148
+ if (pendingBoundary >= 2) {
149
+ if (pendingBoundary === 3)
150
+ reportServerFailure(fiber);
151
+ recoverBoundaryHydration(fiber, props.children, startMark.parentNode!, startMark, endMark, true);
152
+ fiber.m = props;
153
+ return;
154
+ }
155
+ if (!pendingBoundary) {
156
+ // Real DOM is inline between startMark and endMark. Hydrate into it.
157
+ const checkpoint = checkpointCommit(fiber);
158
+ const parent = startMark.parentNode!;
159
+ try {
160
+ setHydrationCursor(fiber, new HydrationCursor(parent, startMark.nextSibling, endMark));
161
+ reconcileRaw(fiber, props.children);
162
+ advanceCursorPast(fiber.p!, endMark);
163
+ }
164
+ catch (e) {
165
+ // A marked boundary owns a known server range. Roll back only its
166
+ // unfinished preparation so siblings can hydrate while it waits.
167
+ if (isThenable(e)) {
168
+ rewindCommit(checkpoint);
169
+ fiber.b.w = true;
170
+ retryHydration(fiber, e);
171
+ advanceCursorPast(fiber.p!, endMark);
172
+ }
173
+ else if (!isHydrationBailout(e)) {
174
+ onCommitFailure(() => {
175
+ clearBoundaryRange(startMark, endMark);
176
+ unmountAllChildren(fiber);
177
+ });
178
+ throw e;
179
+ }
180
+ else recoverBoundaryHydration(fiber, props.children, parent, startMark, endMark);
181
+ }
182
+ finally {
183
+ clearHydrationCursor(fiber);
184
+ }
185
+ fiber.m = props;
186
+ return;
187
+ }
188
+ if (startMark.data === '$?' || startMark.data === '$~') {
189
+ // React owns this pending server range until its reveal script runs.
190
+ // Hydrating the fallback would consume the transport template as a host.
191
+ fiber.b.w = true;
192
+ (startMark as any)._reactRetry = () => {
193
+ if (!fiber.u)
194
+ scheduleRetry(fiber);
195
+ };
196
+ advanceCursorPast(fiber.p!, endMark);
197
+ fiber.m = props;
198
+ return;
199
+ }
200
+ // Pending transport owns this range until reveal. Keep the opaque server
201
+ // range owned by this fiber so deletion also retires its template/fallback.
202
+ fiber.b.w = true;
203
+ advanceCursorPast(fiber.p!, endMark);
204
+ const boundaryId = (findRoot(fiber)?.i ?? '') + 'B:' + id.toString(16);
205
+ const dispose = (globalThis as any).$RH?.(boundaryId, () => {
206
+ if (!fiber.u && !fiber.pd) rehydrateBoundary(fiber);
207
+ });
208
+ fiber.b.x = dispose;
209
+ if (dispose) onCommitRollback(dispose);
210
+ // If the inline runtime isn't present, nothing external will mark us dy.
211
+ fiber.m = props;
212
+ }
213
+ function reconnectLayout(fiber: Fiber): void {
214
+ if (!fiber.ld || isActivityHidden(fiber) || activityIsDisconnected(fiber))
215
+ return;
216
+ if (inSuspensePrimary(fiber))
217
+ return;
218
+ setRetainedFlag(fiber, 'ld', false);
219
+ const instance = fiber.i?._f === fiber ? fiber.i : null;
220
+ if (fiber.t === FiberTag.Host || fiber.t === FiberTag.Resource)
221
+ attachRef(fiber, fiber.n);
222
+ else if (instance || fiber.t === FiberTag.Fragment)
223
+ attachRef(fiber, fiber.i);
224
+ for (const effect of fiber.ef?.values() ?? []) {
225
+ if (effect.t === 1 && !effect.s)
226
+ enqueueEffect(fiber, effect);
227
+ }
228
+ if (instance?.componentDidMount)
229
+ scheduleLifecycle(fiber, () => instance.componentDidMount());
230
+ flushFiberCommits(fiber);
231
+ }
232
+ function disconnectLayout(fiber: Fiber): void {
233
+ if (setRetainedFlag(fiber, 'ld', true) || activityIsDisconnected(fiber))
234
+ return;
235
+ queueMutation(() => {
236
+ for (const [hook, effect] of fiber.ef ?? []) {
237
+ if (effect.t === 1 && !effect.s)
238
+ cleanupEffect(hook, fiber);
239
+ }
240
+ const cleanup = fiber.rc;
241
+ fiber.rc = null;
242
+ if (cleanup)
243
+ disposeCleanup(fiber, cleanup);
244
+ detachRef(fiber.cr ?? fiber.ref, fiber);
245
+ fiber.cr = null;
246
+ disconnectClass(fiber);
247
+ });
248
+ }
249
+ // Walk a fiber subtree collecting host/text DOM nodes that sit at the root
250
+ // of the subtree (do not descend through their children — display:none on
251
+ // the root hides the whole element). Used by the hide-on-suspend path.
252
+ function hideRootHostDoms(fiber: Fiber, out: Array<[
253
+ HTMLElement,
254
+ string
255
+ ]>): void {
256
+ if (fiber.t === FiberTag.Host) {
257
+ const el = fiber.n as HTMLElement;
258
+ const existing = out.find(([node]) => node === el);
259
+ const entry: [
260
+ HTMLElement,
261
+ string
262
+ ] = existing ?? [el, el.style.display];
263
+ if (!existing)
264
+ out.push(entry);
265
+ const display = fiber.v?.style?.display;
266
+ queueMutation(() => {
267
+ // Earlier Activity or host updates in this commit can change display.
268
+ if (!existing || el.style.display !== 'none' || display === 'none')
269
+ entry[1] = el.style.display;
270
+ el.style.display = 'none';
271
+ });
272
+ return;
273
+ }
274
+ if (fiber.t === FiberTag.Portal)
275
+ return;
276
+ let c = fiber.c;
277
+ while (c) {
278
+ hideRootHostDoms(c, out);
279
+ c = c.s;
280
+ }
281
+ }
282
+ function setUpdateBoundary(fiber: Fiber, boundary: Fiber | null | undefined): void {
283
+ fiber.su = boundary ?? null;
284
+ const primary = fiber.t === FiberTag.Suspense && fiber.b?.p ? fiber : boundary;
285
+ for (let child = fiber.c; child; child = child.s)
286
+ setUpdateBoundary(child, primary);
287
+ if (fiber.t === FiberTag.Suspense && fiber.b?.f)
288
+ setUpdateBoundary(fiber.b.f, boundary);
289
+ }
290
+ function renderSuspense(fiber: Fiber): void {
291
+ const props = fiber.v ?? {};
292
+ let state = (fiber.b ??= {}) as SuspenseState;
293
+ // Streaming hydration: if the next DOM node is a server-emitted boundary
294
+ // marker, route through the boundary-aware hydration path.
295
+ const root = getCurrentRoot();
296
+ if (root)
297
+ root.sp = true;
298
+ if (root?.h && !state.b) {
299
+ const boundary = tryConsumeBoundary(fiber.p!);
300
+ if (boundary) {
301
+ hydrateSuspenseBoundary(fiber, props, boundary);
302
+ return;
303
+ }
304
+ }
305
+ if (state.w && state.b && state.e) {
306
+ if (state.b.data.startsWith('$?') || state.b.data === '$~') {
307
+ if (!root?.h && props.children !== fiber.m?.children) {
308
+ ;
309
+ (state.b as any)._reactRetry = undefined;
310
+ recoverBoundaryHydration(fiber, props.children, state.b.parentNode!, state.b, state.e, true);
311
+ fiber.m = props;
312
+ return;
313
+ }
314
+ state.r = props.children;
315
+ fiber.m = props;
316
+ return;
317
+ }
318
+ const checkpoint = checkpointCommit(fiber);
319
+ const wasHydrating = root!.h;
320
+ root!.h = true;
321
+ try {
322
+ hydrateSuspenseBoundary(fiber, props, [state.b.data === '$!' ? 2 : 0, 0, state.b, state.e]);
323
+ }
324
+ catch (error) {
325
+ if (!isThenable(error))
326
+ throw error;
327
+ rewindCommit(checkpoint);
328
+ fiber.b = state;
329
+ retryHydration(fiber, error);
330
+ }
331
+ finally {
332
+ root!.h = wasHydrating;
333
+ }
334
+ return;
335
+ }
336
+ // New primary children or context can unblock a boundary before its old
337
+ // promise settles. A fallback-only update can keep the pending primary.
338
+ if (state.p && !state.u && props.children === fiber.m?.children && !hasContextChanged(fiber, false)) {
339
+ if (state.f) {
340
+ renderFallback(state.f, props.fallback);
341
+ }
342
+ else {
343
+ // Initial-mount suspended path: no committed primary to preserve.
344
+ reconcileRaw(fiber, props.fallback);
345
+ }
346
+ fiber.m = props;
347
+ return;
348
+ }
349
+ // Snapshot whether we have an existing committed primary tree before
350
+ // attempting the new render. If the new attempt suspends and we did have a
351
+ // committed primary, we keep it (hidden) rather than destroying it.
352
+ const hadCommittedPrimary = fiber.m && fiber.c;
353
+ state.u = false;
354
+ const checkpoint = checkpointCommit(fiber);
355
+ const prevHandler = suspendHandler;
356
+ fiber.cx?.clear();
357
+ let pendingThenable: any;
358
+ suspendHandler = (thenable) => {
359
+ pendingThenable = thenable;
360
+ };
361
+ try {
362
+ if (process.env.NODE_ENV === 'production' || !(pendingThenable = devToolsSuspension(fiber))) reconcileRaw(fiber, props.children);
363
+ }
364
+ catch (error) {
365
+ if (root?.h || !isThenable(error))
366
+ throw error;
367
+ pendingThenable = error;
368
+ }
369
+ finally {
370
+ suspendHandler = prevHandler;
371
+ }
372
+ if (pendingThenable) {
373
+ if (transitionRender && hadCommittedPrimary && !state.f && !isActivityHidden(fiber))
374
+ throw pendingThenable;
375
+ rewindCommit(checkpoint);
376
+ state = (fiber.b ??= {}) as SuspenseState;
377
+ const previousThenable = state.p;
378
+ state.p = pendingThenable;
379
+ const onSettle = () => {
380
+ const current = fiber.b as SuspenseState | null;
381
+ if (!current || current.p !== pendingThenable)
382
+ return;
383
+ current.p = null;
384
+ scheduleRetry(fiber);
385
+ };
386
+ if (previousThenable !== pendingThenable)
387
+ pendingThenable.then(onSettle, onSettle);
388
+ // Rewind restored the committed tree, including its existing hidden state.
389
+ // Only the first hide needs update-target, lifecycle and DOM work.
390
+ if (hadCommittedPrimary && !state.d) {
391
+ // Hide the primary subtree's root host doms so the fallback is the only
392
+ // thing visible, but the underlying nodes (and their scroll/state/focus)
393
+ // survive. Save original `display` for the resume path.
394
+ const hidden: Array<[
395
+ HTMLElement,
396
+ string
397
+ ]> = [];
398
+ let c: Fiber | null = hadCommittedPrimary;
399
+ while (c) {
400
+ setUpdateBoundary(c, fiber);
401
+ walkRetained(c, disconnectLayout);
402
+ c = c.s;
403
+ }
404
+ c = hadCommittedPrimary;
405
+ while (c) {
406
+ hideRootHostDoms(c, hidden);
407
+ c = c.s;
408
+ }
409
+ state.d = hidden;
410
+ }
411
+ else if (!hadCommittedPrimary) {
412
+ // First-mount suspension — nothing to preserve.
413
+ unmountAllChildren(fiber);
414
+ }
415
+ // Keep fallback identity across unsuccessful retries of an initial mount.
416
+ if (!state.f) {
417
+ state.f = createFiber(FiberTag.Fragment, null, null);
418
+ state.f.p = fiber;
419
+ }
420
+ renderFallback(state.f, props.fallback);
421
+ }
422
+ else {
423
+ state.p = null;
424
+ fiber.cx?.clear();
425
+ const wasHidden = !!state.d;
426
+ // Render succeeded. Clean up any preserved-suspend state from a prior
427
+ // suspension cycle: unhide primary, unmount the orphan fallback fiber.
428
+ if (state.d) {
429
+ for (let child = fiber.c; child; child = child.s)
430
+ setUpdateBoundary(child, fiber.su);
431
+ const hidden = state.d;
432
+ queueMutation(() => {
433
+ for (const [el, origDisplay] of hidden)
434
+ el.style.display = origDisplay;
435
+ });
436
+ state.d = null;
437
+ }
438
+ if (state.f) {
439
+ removeFiber(state.f);
440
+ state.f = null;
441
+ }
442
+ if (wasHidden)
443
+ for (let child = fiber.c; child; child = child.s)
444
+ walkRetained(child, reconnectLayout, true);
445
+ }
446
+ fiber.m = props;
447
+ }
448
+ function renderFallback(fiber: Fiber, children: any): void {
449
+ // Local updates remain independently queued, unless an outer hidden primary
450
+ // owns them. Context must still cross an otherwise unchanged fallback.
451
+ if (fiber.m && fiber.m.children === children && !fiber.su)
452
+ renderContextConsumers(fiber);
453
+ else {
454
+ fiber.v = { children };
455
+ renderNode(fiber);
456
+ }
457
+ }
458
+ function realHandleSuspended(fiber: Fiber, thenable: Promise<any>): void {
459
+ if (suspendHandler)
460
+ return suspendHandler(thenable);
461
+ const boundary = findSuspenseBoundary(fiber);
462
+ if (boundary)
463
+ throw new RenderSuspenseCapture(boundary);
464
+ // Fallback: schedule re-render when promise settles
465
+ defaultHandleSuspended(fiber, thenable);
466
+ }
467
+ registerTypeMatcher((type) => (type === REACT_SUSPENSE_TYPE ? FiberTag.Suspense : null));
468
+ installRenderer(FiberTag.Suspense, renderSuspense);
469
+ installCapability('h', realHandleSuspended);
@@ -0,0 +1 @@
1
+ export * from './full'
@@ -0,0 +1,13 @@
1
+ import { FiberTag } from '../../../core'
2
+ import { REACT_SUSPENSE_TYPE } from '../../../react'
3
+ import { registerTypeMatcher } from '../../reconcile'
4
+
5
+
6
+ // Stub: Suspense feature disabled. `<Suspense>` elements render as Fragments
7
+ // — children mount inline and `fallback` is ignored. Thrown thenables in
8
+ // descendants fall through to the default `handleSuspended` capability
9
+ // (in reconcile.ts), which schedules a re-render when the promise settles.
10
+ // Eventual consistency still works; there's just no fallback UI during the
11
+ // pending window. Boundary-handler stack, streaming hydration integration,
12
+ // and fallback-swap logic are all stripped.
13
+ registerTypeMatcher((type) => (type === REACT_SUSPENSE_TYPE ? FiberTag.Fragment : null))
@@ -0,0 +1 @@
1
+ export * from '../../transitions'
@@ -0,0 +1 @@
1
+ export const a = undefined, p = undefined, q = undefined, r = undefined, t = undefined, v = undefined, c = undefined, s = undefined