@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,378 @@
1
+ import { boundaryId } from "./stream-ids.js";
2
+ import { childInsertionContext } from "./insertion-context.js";
3
+ import { forkId } from "../dom/react-ids.js";
4
+ import { isTextContent } from "../core/functions.js";
5
+ import { isFunction, isThenable } from "../core/functions.js";
6
+ import { resolveClassProps } from "../core/class-props.js";
7
+ import { REACT_ELEMENT_TYPE, REACT_LEGACY_ELEMENT_TYPE, REACT_FRAGMENT_TYPE } from "../core/index.js";
8
+ import { REACT_SUSPENSE_TYPE, REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE, REACT_FORWARD_REF_TYPE, REACT_MEMO_TYPE, REACT_LAZY_TYPE, REACT_STRICT_MODE_TYPE, REACT_PROFILER_TYPE, REACT_PORTAL_TYPE, REACT_ACTIVITY_TYPE, REACT_VIEW_TRANSITION_TYPE } from "../react/index.js";
9
+ import { escapeAttr, attrToHtml, escapeText, escapeScript, VOID_ELEMENTS, RAW_TEXT_ELEMENTS } from "./escape.js";
10
+ import { pushContext, popContext, snapshotContexts, recordHostResource, currentSSRFrame } from "./dispatcher.js";
11
+ import { isBrowserError } from "../core/browser.js";
12
+ import { resourceKind } from "../core/resource-hints.js";
13
+ function walk(node, opts) {
14
+ if (!opts.textState)
15
+ opts = { ...opts, textState: { bits: +(opts.insertionContext === "svg") } };
16
+ walkNode(node, opts);
17
+ }
18
+ const selectValueStack = [];
19
+ function pushSelectContext(value) {
20
+ selectValueStack.push(value);
21
+ }
22
+ function popSelectContext() {
23
+ selectValueStack.pop();
24
+ }
25
+ function currentSelectValue() {
26
+ return selectValueStack.length ? selectValueStack[selectValueStack.length - 1] : void 0;
27
+ }
28
+ function optionChildText(children) {
29
+ if (children == null)
30
+ return "";
31
+ if (isTextContent(children))
32
+ return "" + children;
33
+ if (Array.isArray(children))
34
+ return children.map(optionChildText).join("");
35
+ return "";
36
+ }
37
+ function emitText(text, opts) {
38
+ if (text === "")
39
+ return;
40
+ if (opts.textState.bits & 2)
41
+ opts.emit("<!-- -->");
42
+ opts.emit(escapeText(text));
43
+ opts.textState.bits |= 2;
44
+ }
45
+ function walkNode(node, opts) {
46
+ if (node == null || node === false || node === true)
47
+ return;
48
+ if (isTextContent(node)) {
49
+ emitText("" + node, opts);
50
+ return;
51
+ }
52
+ if (Array.isArray(node)) {
53
+ const treeId = opts.treeId ?? 1n;
54
+ for (let i = 0; i < node.length; i++)
55
+ walkNode(node[i], { ...opts, treeId: forkId(treeId, node.length, i) });
56
+ return;
57
+ }
58
+ if (isFunction(node[Symbol.iterator])) {
59
+ walkNode(Array.from(node), opts);
60
+ return;
61
+ }
62
+ if (typeof node !== "object")
63
+ return;
64
+ const t = node.$$typeof;
65
+ if (t === REACT_LAZY_TYPE) {
66
+ const lazy = node;
67
+ const resolved = lazy._init(lazy._payload);
68
+ walkNode(resolved, opts);
69
+ return;
70
+ }
71
+ if (t !== REACT_ELEMENT_TYPE && t !== REACT_LEGACY_ELEMENT_TYPE)
72
+ return;
73
+ const el = node;
74
+ walkElement(el, opts);
75
+ }
76
+ function walkElement(el, opts) {
77
+ const type = el.type;
78
+ const props = el.props ?? {};
79
+ if (typeof type === "string") {
80
+ walkHost(type, props, opts);
81
+ return;
82
+ }
83
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_PROFILER_TYPE) {
84
+ walkNode(props.children, opts);
85
+ return;
86
+ }
87
+ if (type === REACT_SUSPENSE_TYPE) {
88
+ walkSuspense(props, opts);
89
+ return;
90
+ }
91
+ if (type === REACT_ACTIVITY_TYPE) {
92
+ if (props.mode !== "hidden")
93
+ walkNode(props.children, opts);
94
+ return;
95
+ }
96
+ if (type === REACT_VIEW_TRANSITION_TYPE) {
97
+ walkNode(props.children, opts);
98
+ return;
99
+ }
100
+ const marker = type?.$$typeof;
101
+ if (marker === REACT_PORTAL_TYPE) {
102
+ return;
103
+ }
104
+ if (marker === REACT_CONTEXT_TYPE || marker === REACT_PROVIDER_TYPE) {
105
+ const ctx = type._context;
106
+ pushContext(ctx, props.value);
107
+ try {
108
+ walkNode(props.children, opts);
109
+ } finally {
110
+ popContext(ctx);
111
+ }
112
+ return;
113
+ }
114
+ if (marker === REACT_CONSUMER_TYPE) {
115
+ const render = props.children;
116
+ if (isFunction(render)) {
117
+ walkNode(render(type._context._currentValue), opts);
118
+ }
119
+ return;
120
+ }
121
+ if (marker === REACT_FORWARD_REF_TYPE) {
122
+ const render = type.render;
123
+ const ref = props.ref ?? null;
124
+ const { ref: _omit, ...rest } = props;
125
+ walkComponent(render, rest, opts, ref);
126
+ return;
127
+ }
128
+ if (marker === REACT_MEMO_TYPE) {
129
+ const inner = type.type;
130
+ walkElement({ ...el, type: inner }, opts);
131
+ return;
132
+ }
133
+ if (marker === REACT_LAZY_TYPE) {
134
+ const { _payload, _init } = type;
135
+ const resolved = _init(_payload);
136
+ walkElement({ ...el, type: resolved }, opts);
137
+ return;
138
+ }
139
+ if (isFunction(type)) {
140
+ walkComponent(type, props, opts);
141
+ return;
142
+ }
143
+ }
144
+ function walkHost(tag, props, opts) {
145
+ const isSvg = !!(opts.textState.bits & 1) || tag === "svg";
146
+ if (!isSvg && resourceKind(tag, props) && recordHostResource(tag, props, opts.resourceScope))
147
+ return;
148
+ const isTextarea = tag === "textarea";
149
+ const textareaValue = isTextarea ? props.value != null ? props.value : props.defaultValue : void 0;
150
+ const isInput = tag === "input";
151
+ const inputValueAttr = isInput && props.value == null && props.defaultValue != null ? props.defaultValue : void 0;
152
+ const inputCheckedAttr = isInput && props.checked == null && props.defaultChecked != null ? props.defaultChecked : void 0;
153
+ const isSelect = tag === "select";
154
+ if (isSelect) {
155
+ const val = props.value != null ? props.value : props.defaultValue;
156
+ pushSelectContext(val);
157
+ }
158
+ const isOption = tag === "option";
159
+ try {
160
+ if (tag === "html")
161
+ opts.emit("<!DOCTYPE html>");
162
+ opts.emit("<" + tag);
163
+ for (const k in props) {
164
+ if (isTextarea && (k === "value" || k === "defaultValue"))
165
+ continue;
166
+ if (isInput && (k === "defaultValue" || k === "defaultChecked"))
167
+ continue;
168
+ if (isSelect && (k === "value" || k === "defaultValue"))
169
+ continue;
170
+ if (isOption && k === "selected")
171
+ continue;
172
+ opts.emit(attrToHtml(k, props[k], isSvg));
173
+ }
174
+ if (inputValueAttr !== void 0) {
175
+ opts.emit(attrToHtml("value", inputValueAttr, isSvg));
176
+ }
177
+ if (inputCheckedAttr !== void 0) {
178
+ opts.emit(attrToHtml("checked", inputCheckedAttr, isSvg));
179
+ }
180
+ if (isOption) {
181
+ const selectVal = currentSelectValue();
182
+ if (selectVal !== void 0) {
183
+ const optionValue = props.value != null ? props.value : optionChildText(props.children);
184
+ const matches = Array.isArray(selectVal) ? selectVal.some((v) => "" + v === "" + optionValue) : "" + selectVal === "" + optionValue;
185
+ if (matches)
186
+ opts.emit(' selected=""');
187
+ } else if (props.selected) {
188
+ opts.emit(' selected=""');
189
+ }
190
+ }
191
+ if (VOID_ELEMENTS.has(tag)) {
192
+ opts.emit("/>");
193
+ opts.textState.bits &= 1;
194
+ return;
195
+ }
196
+ opts.emit(">");
197
+ if (tag === "head")
198
+ opts.onHead?.();
199
+ const parentTextState = opts.textState;
200
+ if (tag === "html" && !hasHeadChild(props.children)) {
201
+ opts.emit("<head>");
202
+ opts.onHead?.();
203
+ opts.emit("</head>");
204
+ }
205
+ const dangerouslyHtml = props.dangerouslySetInnerHTML?.__html;
206
+ if (isTextarea && textareaValue != null) {
207
+ opts.emit(escapeText(String(textareaValue)));
208
+ opts.emit(`</${tag}>`);
209
+ parentTextState.bits &= 1;
210
+ return;
211
+ }
212
+ if (RAW_TEXT_ELEMENTS.has(tag)) {
213
+ if (dangerouslyHtml != null) {
214
+ opts.emit(escapeScript(String(dangerouslyHtml)));
215
+ } else {
216
+ const children = props.children;
217
+ if (typeof children === "string" || typeof children === "number") {
218
+ opts.emit(escapeScript(String(children)));
219
+ } else if (Array.isArray(children)) {
220
+ opts.emit(escapeScript(children.filter((c) => c != null).join("")));
221
+ }
222
+ }
223
+ opts.emit(`</${tag}>`);
224
+ parentTextState.bits &= 1;
225
+ return;
226
+ }
227
+ if (dangerouslyHtml != null) {
228
+ opts.emit(String(dangerouslyHtml));
229
+ } else {
230
+ const previousState = parentTextState.bits;
231
+ parentTextState.bits = +(isSvg && tag !== "foreignObject");
232
+ try {
233
+ walkNode(props.children, { ...opts, insertionContext: childInsertionContext(tag, props, opts.insertionContext ?? "html") });
234
+ } finally {
235
+ parentTextState.bits = previousState;
236
+ }
237
+ }
238
+ opts.emit(`</${tag}>`);
239
+ parentTextState.bits &= 1;
240
+ } finally {
241
+ if (isSelect)
242
+ popSelectContext();
243
+ }
244
+ }
245
+ function hasHeadChild(children) {
246
+ if (children == null || typeof children === "boolean")
247
+ return false;
248
+ if (Array.isArray(children))
249
+ return children.some(hasHeadChild);
250
+ if (typeof children !== "string" && isIterable(children)) {
251
+ for (const child of children) {
252
+ if (hasHeadChild(child))
253
+ return true;
254
+ }
255
+ return false;
256
+ }
257
+ return isElementOfType(children, "head");
258
+ }
259
+ function isElementOfType(value, type) {
260
+ const marker = value?.$$typeof;
261
+ return !!value && typeof value === "object" && (marker === REACT_ELEMENT_TYPE || marker === REACT_LEGACY_ELEMENT_TYPE) && value.type === type;
262
+ }
263
+ function isIterable(value) {
264
+ return !!value && isFunction(value[Symbol.iterator]);
265
+ }
266
+ function walkComponent(fn, props, opts, ref) {
267
+ if (opts.onBrowserBailout) {
268
+ opts = { ...opts, componentStack: `
269
+ at ${fn.displayName || fn.name || "Anonymous"}${opts.componentStack || ""}` };
270
+ }
271
+ const frame = currentSSRFrame();
272
+ const previousTree = frame.treeId, previousLocal = frame.localId;
273
+ frame.treeId = opts.treeId ?? 1n;
274
+ frame.localId = 0;
275
+ try {
276
+ if (fn.prototype?.isReactComponent) {
277
+ props = resolveClassProps(fn, props);
278
+ const ctxType = fn.contextType;
279
+ const ctxValue = ctxType ? ctxType._currentValue : void 0;
280
+ const instance = new fn(props, ctxValue);
281
+ instance.props = props;
282
+ instance.context = ctxValue;
283
+ if (fn.getDerivedStateFromProps) {
284
+ const d = fn.getDerivedStateFromProps(props, instance.state);
285
+ if (d)
286
+ instance.state = { ...instance.state, ...d };
287
+ }
288
+ walkNode(instance.render(), opts);
289
+ return;
290
+ }
291
+ const rendered = fn(props, ref);
292
+ walkNode(rendered, frame.localId ? { ...opts, treeId: forkId(frame.treeId, 1, 0) } : opts);
293
+ } catch (error) {
294
+ if (opts.thrownInfo && !opts.thrownInfo.componentStack)
295
+ opts.thrownInfo.componentStack = opts.componentStack;
296
+ if (isBrowserError(error) && !error.componentStack) {
297
+ Object.defineProperty(error, "componentStack", { value: opts.componentStack });
298
+ }
299
+ throw error;
300
+ } finally {
301
+ frame.treeId = previousTree;
302
+ frame.localId = previousLocal;
303
+ }
304
+ }
305
+ function walkSuspense(props, opts) {
306
+ const id = opts.nextBoundaryId();
307
+ const contextSnapshot = snapshotContexts();
308
+ const childParts = [];
309
+ const nested = [];
310
+ const thrownInfo = {};
311
+ const childEmit = (s) => childParts.push(s);
312
+ const resourceScope = currentSSRFrame().shellFlushed ? {} : void 0;
313
+ try {
314
+ walkNode(props.children, {
315
+ ...opts,
316
+ resourceScope,
317
+ thrownInfo,
318
+ emit: childEmit,
319
+ onSuspend: opts.onSuspend ? (boundary) => nested.push(boundary) : void 0,
320
+ nextBoundaryId: opts.nextBoundaryId
321
+ });
322
+ } catch (thenable) {
323
+ nested.length = 0;
324
+ const suspended = isThenable(thenable);
325
+ if (!suspended) {
326
+ if (isBrowserError(thenable))
327
+ opts.onBrowserBailout?.(thenable, { componentStack: thenable.componentStack || opts.componentStack || "" });
328
+ else
329
+ opts.onError?.(thenable);
330
+ }
331
+ const fallbackParts = [];
332
+ walkNode(props.fallback, {
333
+ ...opts,
334
+ emit: (s) => fallbackParts.push(s),
335
+ onSuspend: opts.onSuspend ? (boundary2) => nested.push(boundary2) : void 0,
336
+ nextBoundaryId: opts.nextBoundaryId
337
+ });
338
+ const boundary = suspended && opts.onSuspend ? {
339
+ id,
340
+ treeId: opts.treeId ?? 1n,
341
+ insertionContext: opts.insertionContext ?? "html",
342
+ fallback: fallbackParts,
343
+ children: props.children,
344
+ thenable,
345
+ contextSnapshot,
346
+ componentStack: thrownInfo.componentStack || opts.componentStack || ""
347
+ } : void 0;
348
+ if (boundary)
349
+ opts.emit(boundary);
350
+ else
351
+ emitBoundary(opts, id, fallbackParts, suspended ? "$?" : isBrowserError(thenable) ? "$!" : "$E");
352
+ for (const inner of nested)
353
+ opts.onSuspend?.(inner);
354
+ if (boundary)
355
+ opts.onSuspend(boundary);
356
+ return;
357
+ }
358
+ if (resourceScope)
359
+ currentSSRFrame().resources?.mergeScope(resourceScope, opts.resourceScope);
360
+ emitBoundary(opts, id, childParts, "$");
361
+ for (const boundary of nested)
362
+ opts.onSuspend?.(boundary);
363
+ }
364
+ function emitBoundary(opts, id, parts, marker) {
365
+ const [open, close] = boundaryEdges(id, marker, opts.insertionContext, currentSSRFrame().identifierPrefix);
366
+ opts.emit(open);
367
+ for (const part of parts)
368
+ opts.emit(part);
369
+ opts.emit(close);
370
+ }
371
+ function boundaryEdges(id, marker, context, prefix) {
372
+ const close = context === "table" ? "</tbody></colgroup>" : "";
373
+ return [`${close}<!--${marker}${id}-->${marker === "$?" ? `<template id="${escapeAttr(boundaryId(id, prefix))}"></template>` : ""}`, `${close}<!--/$-->`];
374
+ }
375
+ export {
376
+ boundaryEdges,
377
+ walk
378
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/server/walk.ts"],
4
+ "sourcesContent": ["import { isFunction, isThenable } from '../core/functions'\nimport { resolveClassProps } from '../core/class-props'\nimport {\n REACT_ELEMENT_TYPE,\n REACT_LEGACY_ELEMENT_TYPE,\n REACT_FRAGMENT_TYPE,\n type ReactNode,\n type ReactElement,\n} from '../core'\nimport {\n REACT_SUSPENSE_TYPE,\n REACT_CONTEXT_TYPE,\n REACT_PROVIDER_TYPE,\n REACT_CONSUMER_TYPE,\n REACT_FORWARD_REF_TYPE,\n REACT_MEMO_TYPE,\n REACT_LAZY_TYPE,\n REACT_STRICT_MODE_TYPE,\n REACT_PROFILER_TYPE,\n REACT_PORTAL_TYPE,\n REACT_ACTIVITY_TYPE,\n REACT_VIEW_TRANSITION_TYPE,\n} from '../react'\nimport {\n attrToHtml,\n escapeText,\n escapeScript,\n VOID_ELEMENTS,\n RAW_TEXT_ELEMENTS,\n} from './escape'\nimport {\n pushContext,\n popContext,\n snapshotContexts,\n recordHostResource,\n currentSSRFrame,\n type ContextSnapshot,\n} from './dispatcher'\nimport { isBrowserError } from '../core/browser'\nimport { resourceKind } from '../core/resource-hints'\nimport type { ResourceScope } from './resource-hints'\n\nexport interface ServerErrorInfo {\n componentStack: string\n}\n\nexport type BrowserBailoutCallback = (error: Error, errorInfo: ServerErrorInfo) => void\n\nexport interface SuspendedBoundary {\n id: number\n fallbackHTML: string\n children: ReactNode\n thenable: Promise<any>\n contextSnapshot: ContextSnapshot\n componentStack: string\n}\n\nexport interface WalkOptions {\n emit: (chunk: string) => void\n onHead?: () => void\n onSuspend?: ((boundary: SuspendedBoundary) => void) | undefined\n onBrowserBailout?: BrowserBailoutCallback | undefined\n onError?: ((error: unknown) => unknown) | undefined\n componentStack?: string | undefined\n thrownInfo?: { componentStack?: string | undefined }\n nextBoundaryId: () => number\n bootstrapped?: boolean | undefined\n isBoundaryResolution?: boolean | undefined\n resourceScope?: ResourceScope | undefined\n // Shared traversal flags: SVG = 1, adjacent text = 2.\n // Host children restore previous flags on return or throw.\n textState?: { bits: number }\n}\n\n/**\n * Synchronously walk a React node and emit HTML string pieces to `opts.emit`.\n * Suspended boundaries are emitted as fallbacks with marker IDs; if `opts.onSuspend`\n * is provided, the suspension is recorded for later streaming.\n */\nexport function walk(node: ReactNode, opts: WalkOptions): void {\n // Seed a text state if the caller didn't provide one so the separator logic\n // is active for the whole tree.\n if (!opts.textState) opts = { ...opts, textState: { bits: 0 } }\n walkNode(node, opts)\n}\n\n// --- <select> selection context ----------------------------------------------\n// Stack of active select values (or `undefined` when the current select has\n// no controlled value). `<option>` walks read the top of stack to decide\n// whether to emit `selected=\"\"`.\nconst selectValueStack: unknown[] = []\nfunction pushSelectContext(value: unknown): void {\n selectValueStack.push(value)\n}\nfunction popSelectContext(): void {\n selectValueStack.pop()\n}\nfunction currentSelectValue(): unknown {\n return selectValueStack.length ? selectValueStack[selectValueStack.length - 1] : undefined\n}\n\nfunction optionChildText(children: unknown): string {\n // `<option>Text</option>` — if no `value` prop, the option's value is its\n // flat string/number child content. Matches DOM semantics (`option.value`\n // defaults to `textContent` when no attribute is set).\n if (children == null) return ''\n if (typeof children === 'string' || typeof children === 'number') return '' + children\n if (Array.isArray(children)) return children.map(optionChildText).join('')\n return ''\n}\n\nfunction emitText(text: string, opts: WalkOptions): void {\n // Empty string renders no text node and doesn't start/extend a text flow —\n // skip entirely so sibling text isn't separated by a stray `<!-- -->`.\n if (text === '') return\n if (opts.textState!.bits & 2) opts.emit('<!-- -->')\n opts.emit(escapeText(text))\n opts.textState!.bits |= 2\n}\n\nfunction walkNode(node: ReactNode, opts: WalkOptions): void {\n if (node == null || node === false || node === true) return\n\n if (typeof node === 'string') {\n emitText(node, opts)\n return\n }\n if (typeof node === 'number') {\n emitText(String(node), opts)\n return\n }\n if (Array.isArray(node)) {\n for (const c of node) walkNode(c, opts)\n return\n }\n if (isFunction((node as any)[Symbol.iterator])) {\n for (const item of node as Iterable<ReactNode>) walkNode(item, opts)\n return\n }\n\n if (typeof node !== 'object') return\n const t = (node as any).$$typeof\n\n // Raw React.lazy in the tree (RSC Flight encodes 'use client' components —\n // CodeBlock, CodeExplorer, etc. — as bare Lazy objects directly in the\n // tree, not wrapped in REACT_ELEMENT_TYPE). SSR previously dropped these\n // here, so code snippets never made it into the server HTML. The RSC\n // decoder server-side awaits payloads before rendering, so status is\n // 'fulfilled' and `_init()` returns the resolved element synchronously.\n // If still pending (shouldn't happen post-awaitLazyElements), throw the\n // thenable so streaming SSR suspends the current boundary and retries.\n if (t === REACT_LAZY_TYPE) {\n const lazy = node as any\n const resolved = lazy._init(lazy._payload)\n walkNode(resolved, opts)\n return\n }\n\n if (t !== REACT_ELEMENT_TYPE && t !== REACT_LEGACY_ELEMENT_TYPE) return\n\n const el = node as ReactElement\n walkElement(el, opts)\n}\n\nfunction walkElement(el: ReactElement, opts: WalkOptions): void {\n const type = el.type\n const props = el.props ?? {}\n\n if (typeof type === 'string') {\n walkHost(type, props, opts)\n return\n }\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_PROFILER_TYPE) {\n walkNode(props.children, opts)\n return\n }\n\n if (type === REACT_SUSPENSE_TYPE) {\n walkSuspense(props, opts)\n return\n }\n\n if (type === REACT_ACTIVITY_TYPE) {\n if (props.mode !== 'hidden') walkNode(props.children, opts)\n return\n }\n if (type === REACT_VIEW_TRANSITION_TYPE) {\n walkNode(props.children, opts)\n return\n }\n\n const marker = (type as any)?.$$typeof\n\n if (marker === REACT_PORTAL_TYPE) {\n // Portals don't render to the main HTML output on the server.\n return\n }\n\n if (marker === REACT_CONTEXT_TYPE || marker === REACT_PROVIDER_TYPE) {\n const ctx = (type as any)._context\n pushContext(ctx, props.value)\n try {\n walkNode(props.children, opts)\n } finally {\n popContext(ctx)\n }\n return\n }\n\n if (marker === REACT_CONSUMER_TYPE) {\n const render = props.children\n if (isFunction(render)) {\n walkNode(render((type as any)._context._currentValue), opts)\n }\n return\n }\n\n if (marker === REACT_FORWARD_REF_TYPE) {\n const render = (type as any).render\n const ref = (props as any).ref ?? null\n const { ref: _omit, ...rest } = props as any\n walkComponent(render, rest, opts, ref)\n return\n }\n\n if (marker === REACT_MEMO_TYPE) {\n const inner = (type as any).type\n walkElement({ ...el, type: inner } as ReactElement, opts)\n return\n }\n\n if (marker === REACT_LAZY_TYPE) {\n const { _payload, _init } = type as any\n const resolved = _init(_payload)\n walkElement({ ...el, type: resolved } as ReactElement, opts)\n return\n }\n\n if (isFunction(type)) {\n walkComponent(type, props, opts)\n return\n }\n}\n\nfunction walkHost(\n tag: string,\n props: Record<string, any>,\n opts: WalkOptions,\n): void {\n const isSvg = !!(opts.textState!.bits & 1) || tag === 'svg'\n if (!isSvg && resourceKind(tag, props) && recordHostResource(tag, props, opts.resourceScope)) return\n // <textarea value=\"...\"> serializes its value as a TEXT CHILD, not an\n // attribute. `defaultValue` is the fallback when `value` is absent. This\n // matches React and the HTML spec — `<textarea value=\"x\">` is not valid\n // HTML; the value is the element's textContent.\n const isTextarea = tag === 'textarea'\n const textareaValue = isTextarea\n ? props.value != null\n ? props.value\n : props.defaultValue\n : undefined\n\n // <input defaultValue=\"...\"> should parse with that value — emit it as a\n // `value` attribute. Similarly `defaultChecked` becomes `checked`. This\n // keeps hydration consistent: the browser parser sees the initial value,\n // and on client commit our setProp seeds `.defaultValue`/`.defaultChecked`\n // without stomping the user-typed value.\n const isInput = tag === 'input'\n const inputValueAttr =\n isInput && props.value == null && props.defaultValue != null\n ? props.defaultValue\n : undefined\n const inputCheckedAttr =\n isInput && props.checked == null && props.defaultChecked != null\n ? props.defaultChecked\n : undefined\n\n // <select value=\"...\"> does NOT become an attribute on `<select>` — the\n // HTML spec has no such attribute. React resolves the selection by stamping\n // `selected` on the matching `<option>` children during render. Stash the\n // target value(s) on the walk state and the child `<option>` walk reads it.\n const isSelect = tag === 'select'\n if (isSelect) {\n const val = props.value != null ? props.value : props.defaultValue\n pushSelectContext(val)\n }\n const isOption = tag === 'option'\n try {\n\n // Prepend the HTML5 doctype to the stream when rendering an <html> root.\n // Without it the browser parses the document in quirks mode, which breaks\n // CSS sizing (documentElement.clientHeight returns the content height, not\n // the viewport) — and Floating-UI-based libraries (Radix dropdowns etc.)\n // then compute off-screen positions for overlays.\n if (tag === 'html') opts.emit('<!DOCTYPE html>')\n\n opts.emit('<' + tag)\n for (const k in props) {\n if (isTextarea && (k === 'value' || k === 'defaultValue')) continue\n if (isInput && (k === 'defaultValue' || k === 'defaultChecked')) continue\n if (isSelect && (k === 'value' || k === 'defaultValue')) continue\n if (isOption && k === 'selected') continue\n opts.emit(attrToHtml(k, props[k], isSvg))\n }\n if (inputValueAttr !== undefined) {\n opts.emit(attrToHtml('value', inputValueAttr, isSvg))\n }\n if (inputCheckedAttr !== undefined) {\n opts.emit(attrToHtml('checked', inputCheckedAttr, isSvg))\n }\n if (isOption) {\n const selectVal = currentSelectValue()\n if (selectVal !== undefined) {\n const optionValue =\n props.value != null ? props.value : optionChildText(props.children)\n const matches = Array.isArray(selectVal)\n ? selectVal.some((v) => '' + v === '' + optionValue)\n : '' + selectVal === '' + optionValue\n if (matches) opts.emit(' selected=\"\"')\n } else if (props.selected) {\n opts.emit(' selected=\"\"')\n }\n }\n\n if (VOID_ELEMENTS.has(tag)) {\n opts.emit('/>')\n opts.textState!.bits &= 1\n return\n }\n opts.emit('>')\n if (tag === 'head') opts.onHead?.()\n // Opening a host element starts a fresh text flow context for its children.\n // Children's text separator tracking is independent of the outer context.\n const parentTextState = opts.textState\n\n if (tag === 'html' && !hasHeadChild(props.children)) {\n opts.emit('<head>')\n opts.onHead?.()\n opts.emit('</head>')\n }\n\n const dangerouslyHtml = props.dangerouslySetInnerHTML?.__html\n\n if (isTextarea && textareaValue != null) {\n opts.emit(escapeText(String(textareaValue)))\n opts.emit(`</${tag}>`)\n parentTextState!.bits &= 1\n return\n }\n\n if (RAW_TEXT_ELEMENTS.has(tag)) {\n // script/style: raw-text. React allows either a string/number child or\n // dangerouslySetInnerHTML — some libs (Start's Scripts) use the latter.\n if (dangerouslyHtml != null) {\n opts.emit(escapeScript(String(dangerouslyHtml)))\n } else {\n const children = props.children\n if (typeof children === 'string' || typeof children === 'number') {\n opts.emit(escapeScript(String(children)))\n } else if (Array.isArray(children)) {\n opts.emit(escapeScript(children.filter((c) => c != null).join('')))\n }\n }\n opts.emit(`</${tag}>`)\n parentTextState!.bits &= 1\n return\n }\n\n if (dangerouslyHtml != null) {\n opts.emit(String(dangerouslyHtml))\n } else {\n const previousState = parentTextState!.bits\n parentTextState!.bits = +(isSvg && tag !== 'foreignObject')\n try {\n walkNode(props.children, opts)\n } finally {\n parentTextState!.bits = previousState\n }\n }\n opts.emit(`</${tag}>`)\n // Host element closing resets outer flow — next sibling text starts fresh.\n parentTextState!.bits &= 1\n } finally {\n if (isSelect) popSelectContext()\n }\n}\n\nfunction hasHeadChild(children: unknown): boolean {\n if (children == null || typeof children === 'boolean') return false\n if (Array.isArray(children)) return children.some(hasHeadChild)\n if (typeof children !== 'string' && isIterable(children)) {\n for (const child of children as Iterable<unknown>) {\n if (hasHeadChild(child)) return true\n }\n return false\n }\n return isElementOfType(children, 'head')\n}\n\nfunction isElementOfType(value: unknown, type: string): value is ReactElement {\n const marker = (value as ReactElement | null)?.$$typeof as unknown\n return (\n !!value &&\n typeof value === 'object' &&\n (marker === REACT_ELEMENT_TYPE || marker === REACT_LEGACY_ELEMENT_TYPE) &&\n (value as ReactElement).type === type\n )\n}\n\nfunction isIterable(value: unknown): value is Iterable<unknown> {\n return !!value && isFunction((value as { [Symbol.iterator]?: unknown })[Symbol.iterator])\n}\n\nfunction walkComponent(\n fn: Function,\n props: Record<string, any>,\n opts: WalkOptions,\n ref?: unknown,\n): void {\n if (opts.onBrowserBailout) {\n opts = { ...opts, componentStack: `\\n at ${(fn as any).displayName || fn.name || 'Anonymous'}${opts.componentStack || ''}` }\n }\n try {\n if ((fn as any).prototype?.isReactComponent) {\n props = resolveClassProps(fn, props)\n const ctxType = (fn as any).contextType\n const ctxValue = ctxType ? ctxType._currentValue : undefined\n const instance = new (fn as any)(props, ctxValue)\n instance.props = props\n instance.context = ctxValue\n if ((fn as any).getDerivedStateFromProps) {\n const d = (fn as any).getDerivedStateFromProps(props, instance.state)\n if (d) instance.state = { ...instance.state, ...d }\n }\n walkNode(instance.render(), opts)\n return\n }\n const rendered = (fn as any)(props, ref)\n walkNode(rendered, opts)\n } catch (error) {\n if (opts.thrownInfo && !opts.thrownInfo.componentStack) opts.thrownInfo.componentStack = opts.componentStack\n if (isBrowserError(error) && !(error as any).componentStack) {\n Object.defineProperty(error, 'componentStack', { value: opts.componentStack })\n }\n throw error\n }\n}\n\nfunction walkSuspense(\n props: Record<string, any>,\n opts: WalkOptions,\n): void {\n const id = opts.nextBoundaryId()\n // Snapshot contexts BEFORE attempting children, so if a descendant suspends\n // we can replay the same provider stack when re-rendering the boundary.\n const contextSnapshot = snapshotContexts()\n\n // Try to render the children synchronously. If a thenable is thrown,\n // record the boundary and emit the fallback.\n const childParts: string[] = []\n const nested: SuspendedBoundary[] = []\n const thrownInfo: { componentStack?: string | undefined } = {}\n const childEmit = (s: string) => childParts.push(s)\n const resourceScope: ResourceScope | undefined = currentSSRFrame().shellFlushed ? {} : undefined\n try {\n walkNode(props.children, {\n ...opts,\n resourceScope,\n thrownInfo,\n emit: childEmit,\n onSuspend: opts.onSuspend ? (boundary) => nested.push(boundary) : undefined,\n nextBoundaryId: opts.nextBoundaryId,\n })\n } catch (thenable: any) {\n nested.length = 0\n const suspended = isThenable(thenable)\n if (!suspended) {\n if (isBrowserError(thenable)) opts.onBrowserBailout?.(thenable, { componentStack: (thenable as any).componentStack || opts.componentStack || '' })\n else opts.onError?.(thenable)\n }\n const fallbackParts: string[] = []\n walkNode(props.fallback, {\n ...opts,\n emit: (s) => fallbackParts.push(s),\n onSuspend: opts.onSuspend ? (boundary) => nested.push(boundary) : undefined,\n nextBoundaryId: opts.nextBoundaryId,\n })\n if (!suspended) {\n opts.emit(`<!--${isBrowserError(thenable) ? '$!' : '$E'}${id}-->${fallbackParts.join('')}<!--/$-->`)\n } else emitBoundary(opts, id, fallbackParts.join(''))\n for (const boundary of nested) opts.onSuspend?.(boundary)\n if (suspended) opts.onSuspend?.({\n id, fallbackHTML: fallbackParts.join(''), children: props.children, thenable, contextSnapshot,\n componentStack: thrownInfo.componentStack || opts.componentStack || '',\n })\n return\n }\n\n if (resourceScope) currentSSRFrame().resources?.mergeScope(resourceScope, opts.resourceScope)\n\n // Children rendered fully — emit them wrapped in resolved-boundary markers\n // (`<!--$N-->` / `<!--/$-->`). Without markers, the client hydrator has no\n // way to know this subtree is inside a Suspense, so if the client version\n // of a descendant (e.g. `React.lazy`) suspends it can't pinpoint which DOM\n // range to adopt on resolve — it creates fresh DOM next to the SSR content,\n // producing visible duplicates (e.g. double navbar logos). Markers let the\n // client treat this as a resolved boundary and hydrate in-place.\n opts.emit(`<!--$${id}-->`)\n opts.emit(childParts.join(''))\n opts.emit(`<!--/$-->`)\n for (const boundary of nested) opts.onSuspend?.(boundary)\n}\n\nfunction emitBoundary(opts: WalkOptions, id: number, fallbackHTML: string): void {\n // Visible div wrapper so the fallback UI shows; B: id lets $RC locate it on\n // reveal. The leading/trailing comments let hydration detect a pending\n // boundary and register a reveal callback.\n opts.emit(`<!--$?${id}--><div id=\"B:${id}\">`)\n opts.emit(fallbackHTML)\n opts.emit(`</div><!--/$-->`)\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,kBAAkB;AACvC,SAAS,yBAAyB;AAClC,SACE,oBACA,2BACA,2BAGK;AACP,SACE,qBACA,oBACA,qBACA,qBACA,wBACA,iBACA,iBACA,wBACA,qBACA,mBACA,qBACA,kCACK;AACP,SACE,YACA,YACA,cACA,eACA,yBACK;AACP,SACE,aACA,YACA,kBACA,oBACA,uBAEK;AACP,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAwCvB,SAAU,KAAK,MAAiB,MAAiB;AAGrD,MAAI,CAAC,KAAK;AAAW,WAAO,EAAE,GAAG,MAAM,WAAW,EAAE,MAAM,EAAC,EAAE;AAC7D,WAAS,MAAM,IAAI;AACrB;AAMA,MAAM,mBAA8B,CAAA;AACpC,SAAS,kBAAkB,OAAc;AACvC,mBAAiB,KAAK,KAAK;AAC7B;AACA,SAAS,mBAAgB;AACvB,mBAAiB,IAAG;AACtB;AACA,SAAS,qBAAkB;AACzB,SAAO,iBAAiB,SAAS,iBAAiB,iBAAiB,SAAS,CAAC,IAAI;AACnF;AAEA,SAAS,gBAAgB,UAAiB;AAIxC,MAAI,YAAY;AAAM,WAAO;AAC7B,MAAI,OAAO,aAAa,YAAY,OAAO,aAAa;AAAU,WAAO,KAAK;AAC9E,MAAI,MAAM,QAAQ,QAAQ;AAAG,WAAO,SAAS,IAAI,eAAe,EAAE,KAAK,EAAE;AACzE,SAAO;AACT;AAEA,SAAS,SAAS,MAAc,MAAiB;AAG/C,MAAI,SAAS;AAAI;AACjB,MAAI,KAAK,UAAW,OAAO;AAAG,SAAK,KAAK,UAAU;AAClD,OAAK,KAAK,WAAW,IAAI,CAAC;AAC1B,OAAK,UAAW,QAAQ;AAC1B;AAEA,SAAS,S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AK,YAAY;QAC9B;QAAI,cAAc,cAAc,KAAK,EAAE;QAAG,UAAU,MAAM;QAAU;QAAU;QAC9E,gBAAgB,WAAW,kBAAkB,KAAK,kBAAkB;OACrE;AACD;EACF;AAEA,MAAI;AAAe,oBAAe,EAAG,WAAW,WAAW,eAAe,KAAK,aAAa;AAS5F,OAAK,KAAK,QAAQ,EAAE,KAAK;AACzB,OAAK,KAAK,WAAW,KAAK,EAAE,CAAC;AAC7B,OAAK,KAAK,WAAW;AACrB,aAAW,YAAY;AAAQ,SAAK,YAAY,QAAQ;AAC1D;AAEA,SAAS,aAAa,MAAmB,IAAY,cAAoB;AAIvE,OAAK,KAAK,SAAS,EAAE,iBAAiB,EAAE,IAAI;AAC5C,OAAK,KAAK,YAAY;AACtB,OAAK,KAAK,iBAAiB;AAC7B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ export declare function correctVinextModule(code: string, id: string, directory: string): string | null;
2
+ export declare function vinextCompatibility(): {
3
+ config: {
4
+ order: string;
5
+ handler(config: any): Promise<void>;
6
+ };
7
+ configEnvironment: {
8
+ order: string;
9
+ handler: (name: string, config: any) => void;
10
+ };
11
+ configResolved: {
12
+ order: string;
13
+ handler(config: any): void;
14
+ };
15
+ resolveHandler(id: string): {
16
+ id: any;
17
+ external: boolean;
18
+ };
19
+ transform: (this: any, code: string, id: string) => {
20
+ code: string;
21
+ map: any;
22
+ };
23
+ };
@@ -0,0 +1,127 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { createRequire, findPackageJSON } from "node:module";
3
+ import { dirname, resolve } from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
+ import { correctFlightTimings } from "./flight-timing.js";
6
+ const shimPackages = ["next", "vinext", "server-only", "client-only", "private-next-instrumentation-client"];
7
+ const requestHandlers = ["vinext/server/app-rsc-handler", "vinext/server/app-rsc-combined-handler"];
8
+ const clientDependencies = ["vinext > @unpic/react", "vinext > ipaddr.js", "vinext > web-vitals"];
9
+ function correctVinextModule(code, id, directory) {
10
+ id = id.split("?")[0].replace(/\\/g, "/");
11
+ directory = directory.replace(/\\/g, "/");
12
+ if (id === directory + "/server/app-rsc-handler.js") {
13
+ const original = "if (!options.skipTrailingSlashRedirect) {";
14
+ if (code.includes("if (!isDataRequest && !options.skipTrailingSlashRedirect) {"))
15
+ return null;
16
+ if (code.split(original).length !== 2)
17
+ throw new Error("Unsupported Vinext Pages data handler. Update the Redact integration for this Vinext build.");
18
+ return code.replace(original, "if (!isDataRequest && !options.skipTrailingSlashRedirect) {");
19
+ }
20
+ if (id === directory + "/client/instrumentation-client-state.js") {
21
+ if (code.includes('Symbol.for("vinext.client.instrumentationHooks")'))
22
+ return null;
23
+ const replacements = [
24
+ ["let clientInstrumentationHooks = null;", 'const clientInstrumentationKey = Symbol.for("vinext.client.instrumentationHooks");'],
25
+ ["clientInstrumentationHooks = hooks;", "Reflect.set(globalThis, clientInstrumentationKey, hooks);"],
26
+ ["return clientInstrumentationHooks;", "return Reflect.get(globalThis, clientInstrumentationKey) ?? null;"],
27
+ ["clientInstrumentationHooks?.onRouterTransitionStart?.(href, navigationType);", "getClientInstrumentationHooks()?.onRouterTransitionStart?.(href, navigationType);"]
28
+ ];
29
+ for (const [original, corrected] of replacements) {
30
+ const expected = original === "return clientInstrumentationHooks;" ? 3 : 2;
31
+ if (code.split(original).length !== expected)
32
+ throw new Error("Unsupported Vinext instrumentation state. Update the Redact integration for this Vinext build.");
33
+ code = code.split(original).join(corrected);
34
+ }
35
+ return code;
36
+ }
37
+ return null;
38
+ }
39
+ function isShimInclude(id, excludes) {
40
+ const target = id.slice(id.lastIndexOf(">") + 1).trim();
41
+ return excludes.some((excluded) => target === excluded || target.startsWith(excluded + "/"));
42
+ }
43
+ function vinextCompatibility() {
44
+ let directory = "", hasApp = false, excludes = [], externalRequire;
45
+ const transform = function(code, id) {
46
+ const corrected = directory && (correctVinextModule(code, id, directory) || correctFlightTimings(code, id, (source) => this.parse(source)));
47
+ return corrected ? { code: corrected, map: null } : null;
48
+ };
49
+ const modulePlugin = { name: "redact:vinext-modules", transform };
50
+ const requirePlugins = /* @__PURE__ */ new WeakSet();
51
+ function configure(name, config) {
52
+ if (!directory)
53
+ return;
54
+ const client = name === "client" || config.consumer === "client";
55
+ if (!client) {
56
+ config.resolve ||= {};
57
+ if (Array.isArray(config.resolve.external))
58
+ config.resolve.external = config.resolve.external.filter((id) => !requestHandlers.includes(id));
59
+ if (config.resolve.noExternal !== true) {
60
+ const existing = config.resolve.noExternal;
61
+ config.resolve.noExternal = [...Array.isArray(existing) ? existing : existing ? [existing] : [], "vinext"];
62
+ }
63
+ }
64
+ const optimizer = config.optimizeDeps ||= {};
65
+ const optimizerActive = !optimizer.noDiscovery || !!optimizer.include?.length;
66
+ const options = optimizer.rolldownOptions ||= {};
67
+ let plugins = [options.plugins || []].flat(Infinity);
68
+ plugins = plugins.filter((plugin) => plugin?.name !== modulePlugin.name);
69
+ if (!client || hasApp) {
70
+ optimizer.exclude = [.../* @__PURE__ */ new Set([...optimizer.exclude || [], ...excludes])];
71
+ optimizer.include = optimizer.include?.filter((id) => !isShimInclude(id, excludes));
72
+ plugins = plugins.filter((plugin) => plugin?.name !== "vinext:dep-optimize-alias");
73
+ if (!client && !plugins.some((plugin) => plugin && typeof plugin === "object" && requirePlugins.has(plugin))) {
74
+ const plugin = externalRequire({ external: excludes });
75
+ requirePlugins.add(plugin);
76
+ plugins.push(plugin);
77
+ }
78
+ if (client && optimizerActive) {
79
+ optimizer.include = [.../* @__PURE__ */ new Set([...optimizer.include || [], ...clientDependencies.filter((id) => !isShimInclude(id, optimizer.exclude.filter((entry) => !shimPackages.includes(entry))))])];
80
+ }
81
+ }
82
+ options.plugins = [...plugins, modulePlugin];
83
+ }
84
+ return {
85
+ config: {
86
+ order: "post",
87
+ async handler(config) {
88
+ const require2 = createRequire(resolve(config.root || ".", "package.json"));
89
+ const packagePath = findPackageJSON("vinext", pathToFileURL(resolve(config.root || ".", "package.json")));
90
+ if (!packagePath)
91
+ throw new Error("Install vinext 1.3.0 before using the Redact Vinext integration.");
92
+ directory = resolve(dirname(packagePath), "dist");
93
+ const pkg = JSON.parse(readFileSync(packagePath, "utf8"));
94
+ if (pkg.version !== "1.3.0")
95
+ throw new Error(`Redact Vinext integration supports vinext 1.3.0; found ${pkg.version}.`);
96
+ hasApp = !!config.environments?.rsc;
97
+ const aliases = Array.isArray(config.resolve?.alias) ? config.resolve.alias : Object.entries(config.resolve?.alias || {}).map(([find, replacement]) => ({ find, replacement }));
98
+ const publicShims = Object.keys((await import(pathToFileURL(resolve(directory, "shims/public-shim-map.json.js")).href)).default);
99
+ const shimEntries = [...publicShims, "next/dist/client/components/navigation"].flatMap((id) => [id, id + ".js"]);
100
+ excludes = [.../* @__PURE__ */ new Set([...shimPackages, ...shimEntries, ...aliases.filter((alias) => typeof alias.find === "string" && (alias.find.startsWith("next/") || alias.replacement?.replace(/\\/g, "/").startsWith(directory.replace(/\\/g, "/") + "/"))).map((alias) => alias.find)])];
101
+ const vite = await import(pathToFileURL(require2.resolve("vite")).href);
102
+ externalRequire = vite.esmExternalRequirePlugin;
103
+ if (typeof externalRequire !== "function")
104
+ throw new Error("Redact Vinext integration requires Vite 8 with esmExternalRequirePlugin support.");
105
+ }
106
+ },
107
+ configEnvironment: { order: "post", handler: configure },
108
+ configResolved: {
109
+ order: "post",
110
+ handler(config) {
111
+ for (const [name, environment] of Object.entries(config.environments))
112
+ configure(name, environment);
113
+ }
114
+ },
115
+ resolveHandler(id) {
116
+ if (directory && requestHandlers.includes(id))
117
+ return { id: resolve(directory, id.slice("vinext/".length) + ".js"), external: false };
118
+ return null;
119
+ },
120
+ transform
121
+ };
122
+ }
123
+ export {
124
+ correctVinextModule,
125
+ vinextCompatibility
126
+ };
127
+ //# sourceMappingURL=compatibility.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/vinext/compatibility.ts"],
4
+ "sourcesContent": ["import { readFileSync } from 'node:fs'\nimport { createRequire, findPackageJSON } from 'node:module'\nimport { dirname, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { correctFlightTimings } from './flight-timing'\n\nconst shimPackages = ['next', 'vinext', 'server-only', 'client-only', 'private-next-instrumentation-client']\nconst requestHandlers = ['vinext/server/app-rsc-handler', 'vinext/server/app-rsc-combined-handler']\nconst clientDependencies = ['vinext > @unpic/react', 'vinext > ipaddr.js', 'vinext > web-vitals']\n\n// These modules carry framework state or request semantics. Both Vite's main\n// graph and its separate dependency optimizer must see the same correction.\nexport function correctVinextModule(code: string, id: string, directory: string): string | null {\n id = id.split('?')[0]!.replace(/\\\\/g, '/')\n directory = directory.replace(/\\\\/g, '/')\n if (id === directory + '/server/app-rsc-handler.js') {\n const original = 'if (!options.skipTrailingSlashRedirect) {'\n if (code.includes('if (!isDataRequest && !options.skipTrailingSlashRedirect) {')) return null\n if (code.split(original).length !== 2) throw new Error('Unsupported Vinext Pages data handler. Update the Redact integration for this Vinext build.')\n return code.replace(original, 'if (!isDataRequest && !options.skipTrailingSlashRedirect) {')\n }\n if (id === directory + '/client/instrumentation-client-state.js') {\n if (code.includes('Symbol.for(\"vinext.client.instrumentationHooks\")')) return null\n const replacements = [\n ['let clientInstrumentationHooks = null;', 'const clientInstrumentationKey = Symbol.for(\"vinext.client.instrumentationHooks\");'],\n ['clientInstrumentationHooks = hooks;', 'Reflect.set(globalThis, clientInstrumentationKey, hooks);'],\n ['return clientInstrumentationHooks;', 'return Reflect.get(globalThis, clientInstrumentationKey) ?? null;'],\n ['clientInstrumentationHooks?.onRouterTransitionStart?.(href, navigationType);', 'getClientInstrumentationHooks()?.onRouterTransitionStart?.(href, navigationType);'],\n ]\n for (const [original, corrected] of replacements) {\n const expected = original === 'return clientInstrumentationHooks;' ? 3 : 2\n if (code.split(original!).length !== expected) throw new Error('Unsupported Vinext instrumentation state. Update the Redact integration for this Vinext build.')\n code = code.split(original!).join(corrected!)\n }\n return code\n }\n return null\n}\n\nfunction isShimInclude(id: string, excludes: string[]) {\n const target = id.slice(id.lastIndexOf('>') + 1).trim()\n // A package root covers its explicit, nested, .js, and glob entrypoints.\n return excludes.some(excluded => target === excluded || target.startsWith(excluded + '/'))\n}\n\nexport function vinextCompatibility() {\n let directory = '', hasApp = false, excludes: string[] = [], externalRequire: any\n const transform = function(this: any, code: string, id: string) {\n const corrected = directory && (correctVinextModule(code, id, directory) || correctFlightTimings(code, id, source => this.parse(source)))\n return corrected ? { code: corrected, map: null } : null\n }\n const modulePlugin = { name: 'redact:vinext-modules', transform }\n const requirePlugins = new WeakSet<object>()\n function configure(name: string, config: any) {\n if (!directory) return\n const client = name === 'client' || config.consumer === 'client'\n if (!client) {\n config.resolve ||= {}\n if (Array.isArray(config.resolve.external)) config.resolve.external = config.resolve.external.filter((id: string) => !requestHandlers.includes(id))\n if (config.resolve.noExternal !== true) {\n const existing = config.resolve.noExternal\n config.resolve.noExternal = [...(Array.isArray(existing) ? existing : existing ? [existing] : []), 'vinext']\n }\n }\n const optimizer = config.optimizeDeps ||= {}\n const optimizerActive = !optimizer.noDiscovery || !!optimizer.include?.length\n const options = optimizer.rolldownOptions ||= {}\n let plugins = [options.plugins || []].flat(Infinity)\n plugins = plugins.filter((plugin: any) => plugin?.name !== modulePlugin.name)\n if (!client || hasApp) {\n optimizer.exclude = [...new Set([...(optimizer.exclude || []), ...excludes])]\n optimizer.include = optimizer.include?.filter((id: string) => !isShimInclude(id, excludes))\n plugins = plugins.filter((plugin: any) => plugin?.name !== 'vinext:dep-optimize-alias')\n if (!client && !plugins.some((plugin: any) => plugin && typeof plugin === 'object' && requirePlugins.has(plugin))) {\n // Rolldown's built-in plugins are class instances. Preserve the instance\n // so its native implementation and options reach the optimizer.\n const plugin = externalRequire({ external: excludes })\n requirePlugins.add(plugin)\n plugins.push(plugin)\n }\n if (client && optimizerActive) {\n optimizer.include = [...new Set([...(optimizer.include || []), ...clientDependencies.filter(id => !isShimInclude(id, optimizer.exclude.filter((entry: string) => !shimPackages.includes(entry))))])]\n }\n }\n options.plugins = [...plugins, modulePlugin]\n }\n return {\n config: {\n order: 'post',\n async handler(config: any) {\n const require = createRequire(resolve(config.root || '.', 'package.json'))\n // Vinext is ESM-only, so resolve its public package manifest through its\n // import condition without loading a second copy of the plugin.\n const packagePath = findPackageJSON('vinext', pathToFileURL(resolve(config.root || '.', 'package.json')))\n if (!packagePath) throw new Error('Install vinext 1.3.0 before using the Redact Vinext integration.')\n directory = resolve(dirname(packagePath), 'dist')\n const pkg = JSON.parse(readFileSync(packagePath, 'utf8'))\n if (pkg.version !== '1.3.0') throw new Error(`Redact Vinext integration supports vinext 1.3.0; found ${pkg.version}.`)\n hasApp = !!config.environments?.rsc\n const aliases = Array.isArray(config.resolve?.alias) ? config.resolve.alias : Object.entries(config.resolve?.alias || {}).map(([find, replacement]) => ({ find, replacement }))\n const publicShims = Object.keys((await import(pathToFileURL(resolve(directory, 'shims/public-shim-map.json.js')).href)).default)\n const shimEntries = [...publicShims, 'next/dist/client/components/navigation'].flatMap(id => [id, id + '.js'])\n excludes = [...new Set([...shimPackages, ...shimEntries, ...aliases.filter((alias: any) => typeof alias.find === 'string' && (alias.find.startsWith('next/') || alias.replacement?.replace(/\\\\/g, '/').startsWith(directory.replace(/\\\\/g, '/') + '/'))).map((alias: any) => alias.find)])] as string[]\n const vite = await import(pathToFileURL(require.resolve('vite')).href)\n externalRequire = vite.esmExternalRequirePlugin\n if (typeof externalRequire !== 'function') throw new Error('Redact Vinext integration requires Vite 8 with esmExternalRequirePlugin support.')\n },\n },\n configEnvironment: { order: 'post', handler: configure },\n configResolved: {\n order: 'post',\n handler(config: any) {\n for (const [name, environment] of Object.entries(config.environments)) configure(name, environment)\n },\n },\n resolveHandler(id: string) {\n if (directory && requestHandlers.includes(id)) return { id: resolve(directory, id.slice('vinext/'.length) + '.js'), external: false }\n return null\n },\n transform,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe,uBAAuB;AAC/C,SAAS,SAAS,eAA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