@bleedingdev/tanstack-redact 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cloudflare/index.d.ts +6 -0
- package/dist/cloudflare/index.js +39 -0
- package/dist/cloudflare/index.js.map +7 -0
- package/dist/core/attributes.d.ts +4 -0
- package/dist/core/attributes.js +30 -0
- package/dist/core/attributes.js.map +7 -0
- package/dist/core/browser.d.ts +9 -0
- package/dist/core/browser.js +32 -0
- package/dist/core/browser.js.map +7 -0
- package/dist/core/class-props.d.ts +1 -0
- package/dist/core/class-props.js +15 -0
- package/dist/core/class-props.js.map +7 -0
- package/dist/core/devtools.d.ts +26 -0
- package/dist/core/devtools.js +70 -0
- package/dist/core/devtools.js.map +7 -0
- package/dist/core/functions.d.ts +6 -0
- package/dist/core/functions.js +14 -0
- package/dist/core/functions.js.map +7 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +7 -0
- package/dist/core/internal.d.ts +103 -0
- package/dist/core/internal.js +43 -0
- package/dist/core/internal.js.map +7 -0
- package/dist/core/resource-hints.d.ts +7 -0
- package/dist/core/resource-hints.js +20 -0
- package/dist/core/resource-hints.js.map +7 -0
- package/dist/core/types.d.ts +23 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +7 -0
- package/dist/core/unitless-style.d.ts +1 -0
- package/dist/core/unitless-style.js +5 -0
- package/dist/core/unitless-style.js.map +7 -0
- package/dist/dom/_all.d.ts +27 -0
- package/dist/dom/_all.js +51 -0
- package/dist/dom/_all.js.map +7 -0
- package/dist/dom/client.d.ts +9 -0
- package/dist/dom/client.js +13 -0
- package/dist/dom/client.js.map +7 -0
- package/dist/dom/commit.d.ts +27 -0
- package/dist/dom/commit.js +237 -0
- package/dist/dom/commit.js.map +7 -0
- package/dist/dom/devtools-effects.d.ts +8 -0
- package/dist/dom/devtools-effects.js +80 -0
- package/dist/dom/devtools-effects.js.map +7 -0
- package/dist/dom/devtools.d.ts +33 -0
- package/dist/dom/devtools.js +635 -0
- package/dist/dom/devtools.js.map +7 -0
- package/dist/dom/dispatcher.d.ts +4 -0
- package/dist/dom/dispatcher.js +437 -0
- package/dist/dom/dispatcher.js.map +7 -0
- package/dist/dom/document-metadata.d.ts +7 -0
- package/dist/dom/document-metadata.js +44 -0
- package/dist/dom/document-metadata.js.map +7 -0
- package/dist/dom/dom.d.ts +11 -0
- package/dist/dom/dom.js +165 -0
- package/dist/dom/dom.js.map +7 -0
- package/dist/dom/error-info.d.ts +2 -0
- package/dist/dom/error-info.js +19 -0
- package/dist/dom/error-info.js.map +7 -0
- package/dist/dom/event-replay.d.ts +13 -0
- package/dist/dom/event-replay.js +24 -0
- package/dist/dom/event-replay.js.map +7 -0
- package/dist/dom/features/activity/full.d.ts +1 -0
- package/dist/dom/features/activity/full.js +140 -0
- package/dist/dom/features/activity/full.js.map +7 -0
- package/dist/dom/features/activity/index.d.ts +1 -0
- package/dist/dom/features/activity/index.js +2 -0
- package/dist/dom/features/activity/index.js.map +7 -0
- package/dist/dom/features/activity/stub.d.ts +1 -0
- package/dist/dom/features/activity/stub.js +10 -0
- package/dist/dom/features/activity/stub.js.map +7 -0
- package/dist/dom/features/class/full.d.ts +1 -0
- package/dist/dom/features/class/full.js +208 -0
- package/dist/dom/features/class/full.js.map +7 -0
- package/dist/dom/features/class/index.d.ts +1 -0
- package/dist/dom/features/class/index.js +2 -0
- package/dist/dom/features/class/index.js.map +7 -0
- package/dist/dom/features/class/stub.d.ts +1 -0
- package/dist/dom/features/class/stub.js +46 -0
- package/dist/dom/features/class/stub.js.map +7 -0
- package/dist/dom/features/context/full.d.ts +4 -0
- package/dist/dom/features/context/full.js +103 -0
- package/dist/dom/features/context/full.js.map +7 -0
- package/dist/dom/features/context/index.d.ts +1 -0
- package/dist/dom/features/context/index.js +2 -0
- package/dist/dom/features/context/index.js.map +7 -0
- package/dist/dom/features/context/stub.d.ts +4 -0
- package/dist/dom/features/context/stub.js +21 -0
- package/dist/dom/features/context/stub.js.map +7 -0
- package/dist/dom/features/forward-ref/full.d.ts +1 -0
- package/dist/dom/features/forward-ref/full.js +9 -0
- package/dist/dom/features/forward-ref/full.js.map +7 -0
- package/dist/dom/features/forward-ref/index.d.ts +1 -0
- package/dist/dom/features/forward-ref/index.js +2 -0
- package/dist/dom/features/forward-ref/index.js.map +7 -0
- package/dist/dom/features/forward-ref/stub.d.ts +1 -0
- package/dist/dom/features/forward-ref/stub.js +9 -0
- package/dist/dom/features/forward-ref/stub.js.map +7 -0
- package/dist/dom/features/fragment-refs/index.d.ts +1 -0
- package/dist/dom/features/fragment-refs/index.js +9 -0
- package/dist/dom/features/fragment-refs/index.js.map +7 -0
- package/dist/dom/features/fragment-refs/stub.d.ts +5 -0
- package/dist/dom/features/fragment-refs/stub.js +17 -0
- package/dist/dom/features/fragment-refs/stub.js.map +7 -0
- package/dist/dom/features/hydration/full.d.ts +68 -0
- package/dist/dom/features/hydration/full.js +493 -0
- package/dist/dom/features/hydration/full.js.map +7 -0
- package/dist/dom/features/hydration/index.d.ts +1 -0
- package/dist/dom/features/hydration/index.js +2 -0
- package/dist/dom/features/hydration/index.js.map +7 -0
- package/dist/dom/features/hydration/stub.d.ts +36 -0
- package/dist/dom/features/hydration/stub.js +80 -0
- package/dist/dom/features/hydration/stub.js.map +7 -0
- package/dist/dom/features/index.d.ts +8 -0
- package/dist/dom/features/index.js +9 -0
- package/dist/dom/features/index.js.map +7 -0
- package/dist/dom/features/lazy/full.d.ts +1 -0
- package/dist/dom/features/lazy/full.js +23 -0
- package/dist/dom/features/lazy/full.js.map +7 -0
- package/dist/dom/features/lazy/index.d.ts +1 -0
- package/dist/dom/features/lazy/index.js +2 -0
- package/dist/dom/features/lazy/index.js.map +7 -0
- package/dist/dom/features/lazy/stub.d.ts +1 -0
- package/dist/dom/features/lazy/stub.js +19 -0
- package/dist/dom/features/lazy/stub.js.map +7 -0
- package/dist/dom/features/memo/full.d.ts +1 -0
- package/dist/dom/features/memo/full.js +34 -0
- package/dist/dom/features/memo/full.js.map +7 -0
- package/dist/dom/features/memo/index.d.ts +1 -0
- package/dist/dom/features/memo/index.js +2 -0
- package/dist/dom/features/memo/index.js.map +7 -0
- package/dist/dom/features/memo/stub.d.ts +1 -0
- package/dist/dom/features/memo/stub.js +9 -0
- package/dist/dom/features/memo/stub.js.map +7 -0
- package/dist/dom/features/portal/full.d.ts +1 -0
- package/dist/dom/features/portal/full.js +11 -0
- package/dist/dom/features/portal/full.js.map +7 -0
- package/dist/dom/features/portal/index.d.ts +1 -0
- package/dist/dom/features/portal/index.js +2 -0
- package/dist/dom/features/portal/index.js.map +7 -0
- package/dist/dom/features/portal/stub.d.ts +1 -0
- package/dist/dom/features/portal/stub.js +5 -0
- package/dist/dom/features/portal/stub.js.map +7 -0
- package/dist/dom/features/suspense/full.d.ts +1 -0
- package/dist/dom/features/suspense/full.js +389 -0
- package/dist/dom/features/suspense/full.js.map +7 -0
- package/dist/dom/features/suspense/index.d.ts +1 -0
- package/dist/dom/features/suspense/index.js +2 -0
- package/dist/dom/features/suspense/index.js.map +7 -0
- package/dist/dom/features/suspense/stub.d.ts +1 -0
- package/dist/dom/features/suspense/stub.js +4 -0
- package/dist/dom/features/suspense/stub.js.map +7 -0
- package/dist/dom/features/suspense-runtime/index.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/index.js +2 -0
- package/dist/dom/features/suspense-runtime/index.js.map +7 -0
- package/dist/dom/features/suspense-runtime/stub.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/stub.js +11 -0
- package/dist/dom/features/suspense-runtime/stub.js.map +7 -0
- package/dist/dom/features/view-transition/full.d.ts +7 -0
- package/dist/dom/features/view-transition/full.js +324 -0
- package/dist/dom/features/view-transition/full.js.map +7 -0
- package/dist/dom/features/view-transition/index.d.ts +1 -0
- package/dist/dom/features/view-transition/index.js +2 -0
- package/dist/dom/features/view-transition/index.js.map +7 -0
- package/dist/dom/features/view-transition/resources.d.ts +11 -0
- package/dist/dom/features/view-transition/resources.js +117 -0
- package/dist/dom/features/view-transition/resources.js.map +7 -0
- package/dist/dom/features/view-transition/stub.d.ts +7 -0
- package/dist/dom/features/view-transition/stub.js +21 -0
- package/dist/dom/features/view-transition/stub.js.map +7 -0
- package/dist/dom/features/view-transition/visual.d.ts +14 -0
- package/dist/dom/features/view-transition/visual.js +404 -0
- package/dist/dom/features/view-transition/visual.js.map +7 -0
- package/dist/dom/form-actions.d.ts +4 -0
- package/dist/dom/form-actions.js +74 -0
- package/dist/dom/form-actions.js.map +7 -0
- package/dist/dom/form-controls.d.ts +3 -0
- package/dist/dom/form-controls.js +91 -0
- package/dist/dom/form-controls.js.map +7 -0
- package/dist/dom/fragment-instance.d.ts +33 -0
- package/dist/dom/fragment-instance.js +449 -0
- package/dist/dom/fragment-instance.js.map +7 -0
- package/dist/dom/index.d.ts +61 -0
- package/dist/dom/index.js +71 -0
- package/dist/dom/index.js.map +7 -0
- package/dist/dom/portal.d.ts +2 -0
- package/dist/dom/portal.js +14 -0
- package/dist/dom/portal.js.map +7 -0
- package/dist/dom/react-ids.d.ts +6 -0
- package/dist/dom/react-ids.js +38 -0
- package/dist/dom/react-ids.js.map +7 -0
- package/dist/dom/reconcile.d.ts +86 -0
- package/dist/dom/reconcile.js +1305 -0
- package/dist/dom/reconcile.js.map +7 -0
- package/dist/dom/refresh.d.ts +12 -0
- package/dist/dom/refresh.js +174 -0
- package/dist/dom/refresh.js.map +7 -0
- package/dist/dom/resource-hints.d.ts +6 -0
- package/dist/dom/resource-hints.js +107 -0
- package/dist/dom/resource-hints.js.map +7 -0
- package/dist/dom/resource-store.d.ts +13 -0
- package/dist/dom/resource-store.js +47 -0
- package/dist/dom/resource-store.js.map +7 -0
- package/dist/dom/resources.d.ts +1 -0
- package/dist/dom/resources.js +46 -0
- package/dist/dom/resources.js.map +7 -0
- package/dist/dom/retained-effects.d.ts +6 -0
- package/dist/dom/retained-effects.js +67 -0
- package/dist/dom/retained-effects.js.map +7 -0
- package/dist/dom/root-internal.d.ts +11 -0
- package/dist/dom/root-internal.js +35 -0
- package/dist/dom/root-internal.js.map +7 -0
- package/dist/dom/root.d.ts +17 -0
- package/dist/dom/root.js +38 -0
- package/dist/dom/root.js.map +7 -0
- package/dist/dom/synthetic-event.d.ts +1 -0
- package/dist/dom/synthetic-event.js +35 -0
- package/dist/dom/synthetic-event.js.map +7 -0
- package/dist/dom/test-utils.d.ts +1 -0
- package/dist/dom/test-utils.js +5 -0
- package/dist/dom/test-utils.js.map +7 -0
- package/dist/dom/transitions.d.ts +9 -0
- package/dist/dom/transitions.js +147 -0
- package/dist/dom/transitions.js.map +7 -0
- package/dist/dom/tree.d.ts +5 -0
- package/dist/dom/tree.js +62 -0
- package/dist/dom/tree.js.map +7 -0
- package/dist/dom/walk.d.ts +2 -0
- package/dist/dom/walk.js +14 -0
- package/dist/dom/walk.js.map +7 -0
- package/dist/next/client.d.ts +9 -0
- package/dist/next/client.js +14 -0
- package/dist/next/client.js.map +7 -0
- package/dist/next/dev-cache-loader.cjs +13 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +97 -0
- package/dist/next/index.js.map +7 -0
- package/dist/next/loader.cjs +10 -0
- package/dist/next/react.d.ts +71 -0
- package/dist/next/react.js +9 -0
- package/dist/next/react.js.map +7 -0
- package/dist/react/act.d.ts +3 -0
- package/dist/react/act.js +124 -0
- package/dist/react/act.js.map +7 -0
- package/dist/react/action-scope.d.ts +17 -0
- package/dist/react/action-scope.js +60 -0
- package/dist/react/action-scope.js.map +7 -0
- package/dist/react/activity.d.ts +7 -0
- package/dist/react/activity.js +7 -0
- package/dist/react/activity.js.map +7 -0
- package/dist/react/children.d.ts +8 -0
- package/dist/react/children.js +76 -0
- package/dist/react/children.js.map +7 -0
- package/dist/react/class.d.ts +36 -0
- package/dist/react/class.js +39 -0
- package/dist/react/class.js.map +7 -0
- package/dist/react/compiler-runtime.d.ts +1 -0
- package/dist/react/compiler-runtime.js +9 -0
- package/dist/react/compiler-runtime.js.map +7 -0
- package/dist/react/context.d.ts +32 -0
- package/dist/react/context.js +25 -0
- package/dist/react/context.js.map +7 -0
- package/dist/react/element.d.ts +13 -0
- package/dist/react/element.js +70 -0
- package/dist/react/element.js.map +7 -0
- package/dist/react/form-state.d.ts +26 -0
- package/dist/react/form-state.js +30 -0
- package/dist/react/form-state.js.map +7 -0
- package/dist/react/hooks.d.ts +67 -0
- package/dist/react/hooks.js +165 -0
- package/dist/react/hooks.js.map +7 -0
- package/dist/react/index.d.ts +99 -0
- package/dist/react/index.js +143 -0
- package/dist/react/index.js.map +7 -0
- package/dist/react/jsx-runtime.d.ts +24 -0
- package/dist/react/jsx-runtime.js +37 -0
- package/dist/react/jsx-runtime.js.map +7 -0
- package/dist/react/memo.d.ts +20 -0
- package/dist/react/memo.js +27 -0
- package/dist/react/memo.js.map +7 -0
- package/dist/react/portal.d.ts +1 -0
- package/dist/react/portal.js +5 -0
- package/dist/react/portal.js.map +7 -0
- package/dist/react/shared-internals.d.ts +52 -0
- package/dist/react/shared-internals.js +22 -0
- package/dist/react/shared-internals.js.map +7 -0
- package/dist/react/suspense.d.ts +15 -0
- package/dist/react/suspense.js +15 -0
- package/dist/react/suspense.js.map +7 -0
- package/dist/react/thenable.d.ts +1 -0
- package/dist/react/thenable.js +25 -0
- package/dist/react/thenable.js.map +7 -0
- package/dist/react/view-transition.d.ts +32 -0
- package/dist/react/view-transition.js +12 -0
- package/dist/react/view-transition.js.map +7 -0
- package/dist/scheduler/index.d.ts +44 -0
- package/dist/scheduler/index.js +109 -0
- package/dist/scheduler/index.js.map +7 -0
- package/dist/server/bootstrap-script.d.ts +3 -0
- package/dist/server/bootstrap-script.js +17 -0
- package/dist/server/bootstrap-script.js.map +7 -0
- package/dist/server/dispatcher.d.ts +57 -0
- package/dist/server/dispatcher.js +157 -0
- package/dist/server/dispatcher.js.map +7 -0
- package/dist/server/escape.d.ts +6 -0
- package/dist/server/escape.js +75 -0
- package/dist/server/escape.js.map +7 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +25 -0
- package/dist/server/index.js.map +7 -0
- package/dist/server/insertion-context.d.ts +3 -0
- package/dist/server/insertion-context.js +32 -0
- package/dist/server/renderToString.d.ts +7 -0
- package/dist/server/renderToString.js +33 -0
- package/dist/server/renderToString.js.map +7 -0
- package/dist/server/resource-hints.d.ts +22 -0
- package/dist/server/resource-hints.js +168 -0
- package/dist/server/resource-hints.js.map +7 -0
- package/dist/server/stream-ids.d.ts +3 -0
- package/dist/server/stream-ids.js +8 -0
- package/dist/server/stream.d.ts +61 -0
- package/dist/server/stream.js +418 -0
- package/dist/server/stream.js.map +7 -0
- package/dist/server/walk.d.ts +58 -0
- package/dist/server/walk.js +378 -0
- package/dist/server/walk.js.map +7 -0
- package/dist/vinext/compatibility.d.ts +23 -0
- package/dist/vinext/compatibility.js +127 -0
- package/dist/vinext/compatibility.js.map +7 -0
- package/dist/vinext/flight-timing.d.ts +1 -0
- package/dist/vinext/flight-timing.js +46 -0
- package/dist/vinext/flight-timing.js.map +7 -0
- package/dist/vinext/index.d.ts +5 -0
- package/dist/vinext/index.js +50 -0
- package/dist/vinext/index.js.map +7 -0
- package/dist/vite/index.d.ts +102 -0
- package/dist/vite/index.js +291 -0
- package/dist/vite/index.js.map +7 -0
- package/dist/vite/react18.d.ts +4 -0
- package/dist/vite/react18.js +74 -0
- package/dist/vite/react18.js.map +7 -0
- package/package.json +121 -4
- package/src/cloudflare/index.ts +44 -0
- package/src/core/attributes.ts +20 -0
- package/src/core/browser.ts +34 -0
- package/src/core/class-props.ts +12 -0
- package/src/core/devtools.ts +69 -0
- package/src/core/functions.ts +11 -0
- package/src/core/index.ts +2 -0
- package/src/core/internal.ts +123 -0
- package/src/core/resource-hints.ts +39 -0
- package/src/core/types.ts +39 -0
- package/src/core/unitless-style.ts +1 -0
- package/src/dom/_all.ts +46 -0
- package/src/dom/client.ts +17 -0
- package/src/dom/commit.ts +223 -0
- package/src/dom/devtools-effects.ts +78 -0
- package/src/dom/devtools.ts +527 -0
- package/src/dom/dispatcher.ts +476 -0
- package/src/dom/document-metadata.ts +41 -0
- package/src/dom/dom.ts +181 -0
- package/src/dom/error-info.ts +20 -0
- package/src/dom/event-replay.ts +39 -0
- package/src/dom/features/activity/full.ts +150 -0
- package/src/dom/features/activity/index.ts +1 -0
- package/src/dom/features/activity/stub.ts +12 -0
- package/src/dom/features/class/full.ts +202 -0
- package/src/dom/features/class/index.ts +1 -0
- package/src/dom/features/class/stub.ts +58 -0
- package/src/dom/features/context/full.ts +107 -0
- package/src/dom/features/context/index.ts +1 -0
- package/src/dom/features/context/stub.ts +26 -0
- package/src/dom/features/forward-ref/full.ts +9 -0
- package/src/dom/features/forward-ref/index.ts +1 -0
- package/src/dom/features/forward-ref/stub.ts +15 -0
- package/src/dom/features/fragment-refs/index.ts +1 -0
- package/src/dom/features/fragment-refs/stub.ts +6 -0
- package/src/dom/features/hydration/full.ts +563 -0
- package/src/dom/features/hydration/index.ts +1 -0
- package/src/dom/features/hydration/stub.ts +86 -0
- package/src/dom/features/index.ts +12 -0
- package/src/dom/features/lazy/full.ts +27 -0
- package/src/dom/features/lazy/index.ts +1 -0
- package/src/dom/features/lazy/stub.ts +24 -0
- package/src/dom/features/memo/full.ts +39 -0
- package/src/dom/features/memo/index.ts +1 -0
- package/src/dom/features/memo/stub.ts +13 -0
- package/src/dom/features/portal/full.ts +14 -0
- package/src/dom/features/portal/index.ts +1 -0
- package/src/dom/features/portal/stub.ts +11 -0
- package/src/dom/features/suspense/full.ts +469 -0
- package/src/dom/features/suspense/index.ts +1 -0
- package/src/dom/features/suspense/stub.ts +13 -0
- package/src/dom/features/suspense-runtime/index.ts +1 -0
- package/src/dom/features/suspense-runtime/stub.ts +1 -0
- package/src/dom/features/view-transition/full.ts +292 -0
- package/src/dom/features/view-transition/index.ts +1 -0
- package/src/dom/features/view-transition/resources.ts +123 -0
- package/src/dom/features/view-transition/stub.ts +8 -0
- package/src/dom/features/view-transition/visual.ts +454 -0
- package/src/dom/form-actions.ts +69 -0
- package/src/dom/form-controls.ts +91 -0
- package/src/dom/fragment-instance.ts +462 -0
- package/src/dom/index.ts +49 -0
- package/src/dom/portal.ts +16 -0
- package/src/dom/react-ids.ts +36 -0
- package/src/dom/reconcile.ts +1423 -0
- package/src/dom/refresh.ts +171 -0
- package/src/dom/resource-hints.ts +104 -0
- package/src/dom/resource-store.ts +50 -0
- package/src/dom/resources.ts +47 -0
- package/src/dom/retained-effects.ts +57 -0
- package/src/dom/root-internal.ts +37 -0
- package/src/dom/root.ts +59 -0
- package/src/dom/synthetic-event.ts +22 -0
- package/src/dom/test-utils.ts +1 -0
- package/src/dom/transitions.ts +141 -0
- package/src/dom/tree.ts +56 -0
- package/src/dom/walk.ts +8 -0
- package/src/next/client.ts +10 -0
- package/src/next/dev-cache-loader.cjs +13 -0
- package/src/next/index.ts +95 -0
- package/src/next/loader.cjs +10 -0
- package/src/next/react.ts +7 -0
- package/src/react/act.ts +105 -0
- package/src/react/action-scope.ts +57 -0
- package/src/react/activity.ts +10 -0
- package/src/react/children.ts +86 -0
- package/src/react/class.ts +66 -0
- package/src/react/compiler-runtime.ts +8 -0
- package/src/react/context.ts +46 -0
- package/src/react/element.ts +82 -0
- package/src/react/form-state.ts +35 -0
- package/src/react/hooks.ts +214 -0
- package/src/react/index.ts +91 -0
- package/src/react/jsx-runtime.ts +50 -0
- package/src/react/memo.ts +42 -0
- package/src/react/portal.ts +1 -0
- package/src/react/shared-internals.ts +80 -0
- package/src/react/suspense.ts +18 -0
- package/src/react/thenable.ts +21 -0
- package/src/react/view-transition.ts +41 -0
- package/src/scheduler/index.ts +124 -0
- package/src/server/bootstrap-script.ts +92 -0
- package/src/server/dispatcher.ts +168 -0
- package/src/server/escape.ts +102 -0
- package/src/server/index.ts +26 -0
- package/src/server/insertion-context.ts +28 -0
- package/src/server/renderToString.ts +35 -0
- package/src/server/resource-hints.ts +166 -0
- package/src/server/stream-ids.ts +5 -0
- package/src/server/stream.ts +525 -0
- package/src/server/walk.ts +555 -0
- package/src/vinext/compatibility.ts +122 -0
- package/src/vinext/flight-timing.ts +37 -0
- package/src/vinext/index.ts +47 -0
- package/src/vite/index.ts +476 -0
- package/src/vite/react18.ts +74 -0
- package/vendor/cloudflare-vite-plugin/LICENSE +25 -0
- package/vendor/cloudflare-vite-plugin/README.md +9 -0
- package/vendor/cloudflare-vite-plugin/dist/chunk-U6NEESU5-BmLHqeIt.mjs +43 -0
- package/vendor/cloudflare-vite-plugin/dist/index.d.mts +155 -0
- package/vendor/cloudflare-vite-plugin/dist/index.mjs +94700 -0
- package/vendor/cloudflare-vite-plugin/dist/open-PCXX3ZDZ-DYH87NhH.mjs +530 -0
- package/vendor/cloudflare-vite-plugin/dist/package-4cnqy5mM.mjs +84 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/asset-worker/index.js +5996 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/router-worker/index.js +6414 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/index.js +457 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner-legacy.js +1129 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner.js +1259 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/vite-proxy-worker/index.js +31 -0
- package/vendor/cloudflare-vite-plugin/package.json +90 -0
- package/vendor/cloudflare-vite-plugin/provenance.json +26 -0
- package/README.md +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react/view-transition.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactNode } from '../core'\nimport { ReactSharedInternals } from './shared-internals'\n\nexport const REACT_VIEW_TRANSITION_TYPE = Symbol.for('react.view_transition')\n\nexport type ViewTransitionClass = string | Record<string, string>\nexport interface ViewTransitionPseudoElement {\n animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation\n getAnimations(): Animation[]\n getComputedStyle(): CSSStyleDeclaration\n}\n\nexport interface ViewTransitionInstance {\n name: string\n group: ViewTransitionPseudoElement\n imagePair: ViewTransitionPseudoElement\n old: ViewTransitionPseudoElement\n new: ViewTransitionPseudoElement\n}\n\ntype ViewTransitionEvent = (instance: ViewTransitionInstance, types: string[]) => void | (() => void)\nexport interface ViewTransitionProps {\n children?: ReactNode\n name?: string | Record<string, string> | undefined\n default?: ViewTransitionClass | undefined\n enter?: ViewTransitionClass | undefined\n exit?: ViewTransitionClass | undefined\n update?: ViewTransitionClass | undefined\n share?: ViewTransitionClass | undefined\n onEnter?: ViewTransitionEvent | undefined\n onExit?: ViewTransitionEvent | undefined\n onUpdate?: ViewTransitionEvent | undefined\n onShare?: ViewTransitionEvent | undefined\n}\n\n// Animation support belongs to the optional DOM feature, not this public entry.\nexport const ViewTransition = REACT_VIEW_TRANSITION_TYPE as unknown as (props: ViewTransitionProps) => any\n\nexport function addTransitionType(type: string): void {\n ReactSharedInternals.T?.add(type)\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,4BAA4B;AAE9B,MAAM,6BAA6B,uBAAO,IAAI,uBAAuB;AAiCrE,MAAM,iBAAiB;AAExB,SAAU,kBAAkB,MAAY;AAC5C,uBAAqB,GAAG,IAAI,IAAI;AAClC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type Callback = () => unknown;
|
|
2
|
+
interface Task {
|
|
3
|
+
id: number;
|
|
4
|
+
callback: Callback | null;
|
|
5
|
+
priority: number;
|
|
6
|
+
cancelled: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function unstable_scheduleCallback(priority: number, cb: Callback): Task;
|
|
9
|
+
export declare function unstable_cancelCallback(task: Task): void;
|
|
10
|
+
export declare function unstable_shouldYield(): boolean;
|
|
11
|
+
export declare function unstable_requestPaint(): void;
|
|
12
|
+
export declare function unstable_now(): number;
|
|
13
|
+
export declare function unstable_getCurrentPriorityLevel(): number;
|
|
14
|
+
export declare function unstable_runWithPriority<T>(_priority: number, fn: () => T): T;
|
|
15
|
+
export declare function unstable_next<T>(fn: () => T): T;
|
|
16
|
+
export declare function unstable_wrapCallback<T extends (...args: any[]) => any>(fn: T): T;
|
|
17
|
+
export declare function unstable_continueExecution(): void;
|
|
18
|
+
export declare function unstable_pauseExecution(): void;
|
|
19
|
+
export declare function unstable_getFirstCallbackNode(): Task | null;
|
|
20
|
+
export declare const unstable_IdlePriority = 5;
|
|
21
|
+
export declare const unstable_ImmediatePriority = 1;
|
|
22
|
+
export declare const unstable_LowPriority = 4;
|
|
23
|
+
export declare const unstable_NormalPriority = 3;
|
|
24
|
+
export declare const unstable_UserBlockingPriority = 2;
|
|
25
|
+
declare const _default: {
|
|
26
|
+
unstable_scheduleCallback: typeof unstable_scheduleCallback;
|
|
27
|
+
unstable_cancelCallback: typeof unstable_cancelCallback;
|
|
28
|
+
unstable_shouldYield: typeof unstable_shouldYield;
|
|
29
|
+
unstable_requestPaint: typeof unstable_requestPaint;
|
|
30
|
+
unstable_now: typeof unstable_now;
|
|
31
|
+
unstable_getCurrentPriorityLevel: typeof unstable_getCurrentPriorityLevel;
|
|
32
|
+
unstable_runWithPriority: typeof unstable_runWithPriority;
|
|
33
|
+
unstable_next: typeof unstable_next;
|
|
34
|
+
unstable_wrapCallback: typeof unstable_wrapCallback;
|
|
35
|
+
unstable_continueExecution: typeof unstable_continueExecution;
|
|
36
|
+
unstable_pauseExecution: typeof unstable_pauseExecution;
|
|
37
|
+
unstable_getFirstCallbackNode: typeof unstable_getFirstCallbackNode;
|
|
38
|
+
unstable_IdlePriority: number;
|
|
39
|
+
unstable_ImmediatePriority: number;
|
|
40
|
+
unstable_LowPriority: number;
|
|
41
|
+
unstable_NormalPriority: number;
|
|
42
|
+
unstable_UserBlockingPriority: number;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const PRIORITY_IMMEDIATE = 1;
|
|
2
|
+
const PRIORITY_USER_BLOCKING = 2;
|
|
3
|
+
const PRIORITY_NORMAL = 3;
|
|
4
|
+
const PRIORITY_LOW = 4;
|
|
5
|
+
const PRIORITY_IDLE = 5;
|
|
6
|
+
let nextId = 0;
|
|
7
|
+
function unstable_scheduleCallback(priority, cb) {
|
|
8
|
+
const task = {
|
|
9
|
+
id: ++nextId,
|
|
10
|
+
callback: cb,
|
|
11
|
+
priority,
|
|
12
|
+
cancelled: false
|
|
13
|
+
};
|
|
14
|
+
const run = () => {
|
|
15
|
+
if (task.cancelled || !task.callback)
|
|
16
|
+
return;
|
|
17
|
+
const fn = task.callback;
|
|
18
|
+
task.callback = null;
|
|
19
|
+
try {
|
|
20
|
+
fn();
|
|
21
|
+
} catch (e) {
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
throw e;
|
|
24
|
+
}, 0);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
if (priority <= PRIORITY_IMMEDIATE) {
|
|
28
|
+
queueMicrotask(run);
|
|
29
|
+
} else {
|
|
30
|
+
setTimeout(run, 0);
|
|
31
|
+
}
|
|
32
|
+
return task;
|
|
33
|
+
}
|
|
34
|
+
function unstable_cancelCallback(task) {
|
|
35
|
+
task.cancelled = true;
|
|
36
|
+
task.callback = null;
|
|
37
|
+
}
|
|
38
|
+
function unstable_shouldYield() {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
function unstable_requestPaint() {
|
|
42
|
+
}
|
|
43
|
+
function unstable_now() {
|
|
44
|
+
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
45
|
+
}
|
|
46
|
+
function unstable_getCurrentPriorityLevel() {
|
|
47
|
+
return PRIORITY_NORMAL;
|
|
48
|
+
}
|
|
49
|
+
function unstable_runWithPriority(_priority, fn) {
|
|
50
|
+
return fn();
|
|
51
|
+
}
|
|
52
|
+
function unstable_next(fn) {
|
|
53
|
+
return fn();
|
|
54
|
+
}
|
|
55
|
+
function unstable_wrapCallback(fn) {
|
|
56
|
+
return fn;
|
|
57
|
+
}
|
|
58
|
+
function unstable_continueExecution() {
|
|
59
|
+
}
|
|
60
|
+
function unstable_pauseExecution() {
|
|
61
|
+
}
|
|
62
|
+
function unstable_getFirstCallbackNode() {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const unstable_IdlePriority = PRIORITY_IDLE;
|
|
66
|
+
const unstable_ImmediatePriority = PRIORITY_IMMEDIATE;
|
|
67
|
+
const unstable_LowPriority = PRIORITY_LOW;
|
|
68
|
+
const unstable_NormalPriority = PRIORITY_NORMAL;
|
|
69
|
+
const unstable_UserBlockingPriority = PRIORITY_USER_BLOCKING;
|
|
70
|
+
var scheduler_default = {
|
|
71
|
+
unstable_scheduleCallback,
|
|
72
|
+
unstable_cancelCallback,
|
|
73
|
+
unstable_shouldYield,
|
|
74
|
+
unstable_requestPaint,
|
|
75
|
+
unstable_now,
|
|
76
|
+
unstable_getCurrentPriorityLevel,
|
|
77
|
+
unstable_runWithPriority,
|
|
78
|
+
unstable_next,
|
|
79
|
+
unstable_wrapCallback,
|
|
80
|
+
unstable_continueExecution,
|
|
81
|
+
unstable_pauseExecution,
|
|
82
|
+
unstable_getFirstCallbackNode,
|
|
83
|
+
unstable_IdlePriority,
|
|
84
|
+
unstable_ImmediatePriority,
|
|
85
|
+
unstable_LowPriority,
|
|
86
|
+
unstable_NormalPriority,
|
|
87
|
+
unstable_UserBlockingPriority
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
scheduler_default as default,
|
|
91
|
+
unstable_IdlePriority,
|
|
92
|
+
unstable_ImmediatePriority,
|
|
93
|
+
unstable_LowPriority,
|
|
94
|
+
unstable_NormalPriority,
|
|
95
|
+
unstable_UserBlockingPriority,
|
|
96
|
+
unstable_cancelCallback,
|
|
97
|
+
unstable_continueExecution,
|
|
98
|
+
unstable_getCurrentPriorityLevel,
|
|
99
|
+
unstable_getFirstCallbackNode,
|
|
100
|
+
unstable_next,
|
|
101
|
+
unstable_now,
|
|
102
|
+
unstable_pauseExecution,
|
|
103
|
+
unstable_requestPaint,
|
|
104
|
+
unstable_runWithPriority,
|
|
105
|
+
unstable_scheduleCallback,
|
|
106
|
+
unstable_shouldYield,
|
|
107
|
+
unstable_wrapCallback
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/scheduler/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Minimal `scheduler` package surface — enough for React-ecosystem libraries\n// (react-three/fiber, react-query's older scheduler calls, some devtools) to\n// resolve the import without crashing. We don't implement priority lanes or\n// interruptible work; everything runs on microtask or the next task.\n\nconst PRIORITY_IMMEDIATE = 1\nconst PRIORITY_USER_BLOCKING = 2\nconst PRIORITY_NORMAL = 3\nconst PRIORITY_LOW = 4\nconst PRIORITY_IDLE = 5\n\ntype Callback = () => unknown\n\ninterface Task {\n id: number\n callback: Callback | null\n priority: number\n cancelled: boolean\n}\n\nlet nextId = 0\n\nexport function unstable_scheduleCallback(priority: number, cb: Callback): Task {\n const task: Task = {\n id: ++nextId,\n callback: cb,\n priority,\n cancelled: false,\n }\n const run = () => {\n if (task.cancelled || !task.callback) return\n const fn = task.callback\n task.callback = null\n try {\n fn()\n } catch (e) {\n // Re-throw on next task so the host sees it\n setTimeout(() => {\n throw e\n }, 0)\n }\n }\n // Immediate → microtask so ordering is predictable; everything else → next task.\n if (priority <= PRIORITY_IMMEDIATE) {\n queueMicrotask(run)\n } else {\n setTimeout(run, 0)\n }\n return task\n}\n\nexport function unstable_cancelCallback(task: Task): void {\n task.cancelled = true\n task.callback = null\n}\n\nexport function unstable_shouldYield(): boolean {\n // We never yield — work runs to completion on whichever task schedules it.\n return false\n}\n\nexport function unstable_requestPaint(): void {\n // no-op\n}\n\nexport function unstable_now(): number {\n return typeof performance !== 'undefined' ? performance.now() : Date.now()\n}\n\nexport function unstable_getCurrentPriorityLevel(): number {\n return PRIORITY_NORMAL\n}\n\nexport function unstable_runWithPriority<T>(_priority: number, fn: () => T): T {\n return fn()\n}\n\nexport function unstable_next<T>(fn: () => T): T {\n return fn()\n}\n\nexport function unstable_wrapCallback<T extends (...args: any[]) => any>(fn: T): T {\n return fn\n}\n\nexport function unstable_continueExecution(): void {\n // no-op\n}\n\nexport function unstable_pauseExecution(): void {\n // no-op\n}\n\nexport function unstable_getFirstCallbackNode(): Task | null {\n return null\n}\n\nexport const unstable_IdlePriority = PRIORITY_IDLE\nexport const unstable_ImmediatePriority = PRIORITY_IMMEDIATE\nexport const unstable_LowPriority = PRIORITY_LOW\nexport const unstable_NormalPriority = PRIORITY_NORMAL\nexport const unstable_UserBlockingPriority = PRIORITY_USER_BLOCKING\n\n// Some libraries (e.g. @react-three/fiber) import `scheduler` with a default\n// binding expecting the namespace object. Provide one.\nexport default {\n unstable_scheduleCallback,\n unstable_cancelCallback,\n unstable_shouldYield,\n unstable_requestPaint,\n unstable_now,\n unstable_getCurrentPriorityLevel,\n unstable_runWithPriority,\n unstable_next,\n unstable_wrapCallback,\n unstable_continueExecution,\n unstable_pauseExecution,\n unstable_getFirstCallbackNode,\n unstable_IdlePriority,\n unstable_ImmediatePriority,\n unstable_LowPriority,\n unstable_NormalPriority,\n unstable_UserBlockingPriority,\n}\n"],
|
|
5
|
+
"mappings": "AAKA,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAC/B,MAAM,kBAAkB;AACxB,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAWtB,IAAI,SAAS;AAEP,SAAU,0BAA0B,UAAkB,IAAY;AACtE,QAAM,OAAa;IACjB,IAAI,EAAE;IACN,UAAU;IACV;IACA,WAAW;;AAEb,QAAM,MAAM,MAAK;AACf,QAAI,KAAK,aAAa,CAAC,KAAK;AAAU;AACtC,UAAM,KAAK,KAAK;AAChB,SAAK,WAAW;AAChB,QAAI;AACF,SAAE;IACJ,SAAS,GAAG;AAEV,iBAAW,MAAK;AACd,cAAM;MACR,GAAG,CAAC;IACN;EACF;AAEA,MAAI,YAAY,oBAAoB;AAClC,mBAAe,GAAG;EACpB,OAAO;AACL,eAAW,KAAK,CAAC;EACnB;AACA,SAAO;AACT;AAEM,SAAU,wBAAwB,MAAU;AAChD,OAAK,YAAY;AACjB,OAAK,WAAW;AAClB;AAEM,SAAU,uBAAoB;AAElC,SAAO;AACT;AAEM,SAAU,wBAAqB;AAErC;AAEM,SAAU,eAAY;AAC1B,SAAO,OAAO,gBAAgB,cAAc,YAAY,IAAG,IAAK,KAAK,IAAG;AAC1E;AAEM,SAAU,mCAAgC;AAC9C,SAAO;AACT;AAEM,SAAU,yBAA4B,WAAmB,IAAW;AACxE,SAAO,GAAE;AACX;AAEM,SAAU,cAAiB,IAAW;AAC1C,SAAO,GAAE;AACX;AAEM,SAAU,sBAAyD,IAAK;AAC5E,SAAO;AACT;AAEM,SAAU,6BAA0B;AAE1C;AAEM,SAAU,0BAAuB;AAEvC;AAEM,SAAU,gCAA6B;AAC3C,SAAO;AACT;AAEO,MAAM,wBAAwB;AAC9B,MAAM,6BAA6B;AACnC,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,gCAAgC;AAI7C,IAAA,oBAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { boundaryId, segmentId, scriptId } from "./stream-ids.js";
|
|
2
|
+
import { escapeAttr } from "./escape.js";
|
|
3
|
+
const BOUNDARY_REVEAL_RUNTIME = `(function(){if(!window.$RH){var c={},r=new Map;function place(n,v){var a=document.head.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),t=a.length?a[a.length-1]:null,p=t;for(var k=0;k<a.length;k++){if(a[k].getAttribute("data-precedence")===v)p=a[k];else if(p!==t)break}document.head.insertBefore(n,p?p.nextSibling:document.head.firstChild);}function drop(s){var w=/^(TBODY|TR|COLGROUP|mtext)$/.test(s.nodeName)?s.closest("table,math"):s;w.remove()}function load(n,e){return new Promise(function(y,x){n.onload=function(){e.p=null;y()};n.onerror=function(){e.p=null;x()}})}window.$RH=function(i,f){if(!document.getElementById(i))f();else{c[i]=f;return function(){if(c[i]===f)delete c[i]}}};window.$RC=function(i,j){var s=document.getElementById(j),b=document.getElementById(i);if(!b){delete c[i];if(s)drop(s);return}if(!s)return;var a=document.querySelectorAll('body link[rel="stylesheet"][data-precedence],body style[data-precedence]');for(var j=0;j<a.length;j++){var n=a[j];if(n.getAttribute("media")==="not all")n.removeAttribute("media");place(n,n.getAttribute("data-precedence"));}var p=b.parentNode,m=b.previousSibling;var n=b.nextSibling,d=0;while(n){var t=n.nextSibling;if(n.nodeType===8){if(n.data==="/$"){if(d===0)break;d--}else if(/^\\$(?:[?!E~])?\\d*$/.test(n.data))d++}p.removeChild(n);n=t}while(s.firstChild)p.insertBefore(s.firstChild,b);drop(s);p.removeChild(b);if(m&&m.nodeType===8)m.data=m.data.replace("$?","$");if(c[i]){var f=c[i];delete c[i];f()}};window.$RR=function(i,s,d){var w=[];for(var j=0;j<d.length;j++){var a=d[j],e=r.get(a[0]);if(!e){var n=null,l=document.querySelectorAll('link[rel="stylesheet"]');for(var k=0;k<l.length;k++)if(l[k].getAttribute("href")===a[0]){n=l[k];break}e={n:n,p:null};r.set(a[0],e);if(!n){n=e.n=document.createElement("link");n.rel="stylesheet";n.href=a[0];n.setAttribute("data-precedence",a[1]);for(var k=2;k<a.length;k+=2)n.setAttribute(a[k],a[k+1]);e.p=load(n,e);place(n,a[1]);}}var m=e.n.getAttribute("media");if(e.p&&(!m||matchMedia(m).matches))w.push(e.p);}Promise.all(w).then(function(){$RC(i,s)},function(){$RB(i,1,s)});};window.$RB=function(i,e,j){var s=j&&document.getElementById(j);if(s)drop(s);var b=document.getElementById(i);if(!b){delete c[i];return}var m=b.previousSibling;if(m&&m.nodeType===8)m.data=(e?"$E":"$!")+m.data.replace(/^\\$[?~!E]?/,"");b.removeAttribute("id");if(c[i]){var f=c[i];delete c[i];f()}};}var q=[];window.$RE_q=q;var evs=["click","submit","input","change","keydown"];function h(e){q.push([e.type,e.target,e.timeStamp])}for(var j=0;j<evs.length;j++)document.addEventListener(evs[j],h,true);window.$RE_stop=function(){for(var j=0;j<evs.length;j++)document.removeEventListener(evs[j],h,true)};})();`;
|
|
4
|
+
function injectBootstrapScript(nonce) {
|
|
5
|
+
const n = nonce ? ` nonce="${escapeAttr(nonce)}"` : "";
|
|
6
|
+
return `<script${n}>${BOUNDARY_REVEAL_RUNTIME}<\/script>`;
|
|
7
|
+
}
|
|
8
|
+
function revealScript(id, nonce, styles, identifierPrefix = "") {
|
|
9
|
+
const n = nonce ? ` nonce="${escapeAttr(nonce)}"` : "";
|
|
10
|
+
const b = scriptId(boundaryId(id, identifierPrefix)), s = scriptId(segmentId(id, identifierPrefix));
|
|
11
|
+
return `<script${n}>${styles?.length ? `$RR(${b},${s},${JSON.stringify(styles).replace(/</g, "\\u003c")})` : `$RC(${b},${s})`}<\/script>`;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
BOUNDARY_REVEAL_RUNTIME,
|
|
15
|
+
injectBootstrapScript,
|
|
16
|
+
revealScript
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/bootstrap-script.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Inline client runtime injected into the streamed HTML. Two jobs:\n *\n * 1. Reveal suspense boundaries as their resolved chunks arrive ($RC).\n * 2. Capture interaction events from the moment the shell is visible so the\n * main bundle can replay them against un-hydrated subtrees ($RE_q buffer).\n *\n * Wire format:\n * Fallback: <!--$?ID--><div id=\"B:ID\">fallback</div><!--/$-->\n * Resolved: emits <div hidden id=\"S:ID\">real</div><script>$RC(ID)</script>\n * which splices real into place and rewrites the comment to <!--$ID-->.\n * The fallback div is visible (it's the user-visible loading\n * state); only the resolved-content staging div is `hidden`\n * before $RC moves its children inline.\n *\n * Client hydration calls $RH(ID, cb) to register a callback invoked once the\n * boundary has been revealed (or immediately, if it was already revealed).\n *\n * Early-event buffering: before the main bundle is parsed, we attach capture\n * listeners for a small set of interactive events and push them into a buffer.\n * The bundle drains and replays them via the replay code in @tanstack/redact/dom.\n */\nimport { escapeAttr } from './escape'\n\nexport const BOUNDARY_REVEAL_RUNTIME =\n `(function(){` +\n `var c={},r=new Map;` +\n `function place(n,v){` +\n `var a=document.head.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),t=a.length?a[a.length-1]:null,p=t;` +\n `for(var k=0;k<a.length;k++){if(a[k].getAttribute(\"data-precedence\")===v)p=a[k];else if(p!==t)break}` +\n `document.head.insertBefore(n,p?p.nextSibling:document.head.firstChild);` +\n `}` +\n `function load(n,e){return new Promise(function(y,x){n.onload=function(){e.p=null;y()};n.onerror=function(){e.p=null;x()}})}` +\n `window.$RH=function(i,f){` +\n `if(!document.getElementById(\"B:\"+i))f();` +\n `else c[i]=f;` +\n `};` +\n `window.$RC=function(i){` +\n `var s=document.getElementById(\"S:\"+i),b=document.getElementById(\"B:\"+i);` +\n `if(!s||!b)return;` +\n `var a=document.querySelectorAll('body link[rel=\"stylesheet\"][data-precedence],body style[data-precedence]');` +\n `for(var j=0;j<a.length;j++){` +\n `var n=a[j];if(n.getAttribute(\"media\")===\"not all\")n.removeAttribute(\"media\");place(n,n.getAttribute(\"data-precedence\"));` +\n `}` +\n `var p=b.parentNode,m=b.previousSibling;` +\n `while(s.firstChild)p.insertBefore(s.firstChild,b);` +\n `s.parentNode.removeChild(s);` +\n `p.removeChild(b);` +\n `if(m&&m.nodeType===8)m.data=\"$\"+i;` +\n `if(c[i]){var f=c[i];delete c[i];f()}` +\n `};` +\n `window.$RL=function(i,d){` +\n `var w=[];for(var j=0;j<d.length;j++){` +\n `var a=d[j],e=r.get(a[0]);if(!e){` +\n `var n=null,l=document.querySelectorAll('link[rel=\"stylesheet\"]');for(var k=0;k<l.length;k++)if(l[k].getAttribute(\"href\")===a[0]){n=l[k];break}` +\n `e={n:n,p:null};r.set(a[0],e);if(!n){` +\n `n=e.n=document.createElement(\"link\");n.rel=\"stylesheet\";n.href=a[0];n.setAttribute(\"data-precedence\",a[1]);` +\n `for(var k=2;k<a.length;k+=2)n.setAttribute(a[k],a[k+1]);` +\n `e.p=load(n,e);place(n,a[1]);` +\n `}` +\n `}` +\n `var m=e.n.getAttribute(\"media\");if(e.p&&(!m||matchMedia(m).matches))w.push(e.p);` +\n `}` +\n `Promise.all(w).then(function(){$RC(i)},function(){$RB(i,1)});` +\n `};` +\n `window.$RB=function(i,e){` +\n `var b=document.getElementById(\"B:\"+i);if(!b)return;` +\n `var m=b.previousSibling;if(m&&m.nodeType===8)m.data=(e?\"$E\":\"$!\")+i;` +\n `b.removeAttribute(\"id\");if(c[i]){var f=c[i];delete c[i];f()}` +\n `};` +\n `var q=[];window.$RE_q=q;` +\n `var evs=[\"click\",\"submit\",\"input\",\"change\",\"keydown\"];` +\n `function h(e){q.push([e.type,e.target,e.timeStamp])}` +\n `for(var j=0;j<evs.length;j++)document.addEventListener(evs[j],h,true);` +\n `window.$RE_stop=function(){for(var j=0;j<evs.length;j++)document.removeEventListener(evs[j],h,true)};` +\n `})();`\n\nexport function injectBootstrapScript(nonce?: string): string {\n const n = nonce ? ` nonce=\"${escapeAttr(nonce)}\"` : ''\n return `<script${n}>${BOUNDARY_REVEAL_RUNTIME}</script>`\n}\n\nexport function revealScript(id: number, nonce?: string, styles?: string[][]): string {\n const n = nonce ? ` nonce=\"${escapeAttr(nonce)}\"` : ''\n return `<script${n}>${styles?.length ? `$RL(${id},${JSON.stringify(styles).replace(/</g, '\\\\u003c')})` : `$RC(${id})`}</script>`\n}\n"],
|
|
5
|
+
"mappings": "AAsBA,SAAS,kBAAkB;AAEpB,MAAM,0BACX;AAoDI,SAAU,sBAAsB,OAAc;AAClD,QAAM,IAAI,QAAQ,WAAW,WAAW,KAAK,CAAC,MAAM;AACpD,SAAO,UAAU,CAAC,IAAI,uBAAuB;AAC/C;AAEM,SAAU,aAAa,IAAY,OAAgB,QAAmB;AAC1E,QAAM,IAAI,QAAQ,WAAW,WAAW,KAAK,CAAC,MAAM;AACpD,SAAO,UAAU,CAAC,IAAI,QAAQ,SAAS,OAAO,EAAE,IAAI,KAAK,UAAU,MAAM,EAAE,QAAQ,MAAM,SAAS,CAAC,MAAM,OAAO,EAAE,GAAG;AACvH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createResourceHints, type ResourceScope } from './resource-hints.js';
|
|
2
|
+
export interface SSRFrame {
|
|
3
|
+
treeId: bigint;
|
|
4
|
+
localId: number;
|
|
5
|
+
identifierPrefix: string;
|
|
6
|
+
contextStack: Array<{
|
|
7
|
+
context: any;
|
|
8
|
+
prev: any;
|
|
9
|
+
}>;
|
|
10
|
+
resources?: ReturnType<typeof createResourceHints>;
|
|
11
|
+
shellFlushed?: boolean;
|
|
12
|
+
styleNonce?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function beginSSR(identifierPrefix?: string, nextFrame?: SSRFrame): {
|
|
15
|
+
frame: SSRFrame;
|
|
16
|
+
dispatcher: import("../react/shared-internals.js").Dispatcher;
|
|
17
|
+
};
|
|
18
|
+
export declare function currentSSRFrame(): SSRFrame;
|
|
19
|
+
export declare function recordHostResource(type: string, props: any, scope?: ResourceScope): boolean;
|
|
20
|
+
export declare function endSSR(previous?: ReturnType<typeof beginSSR>): void;
|
|
21
|
+
export declare function pushContext(context: any, value: any): void;
|
|
22
|
+
export declare function popContext(context: any): void;
|
|
23
|
+
export type ContextSnapshot = Array<{
|
|
24
|
+
context: any;
|
|
25
|
+
value: any;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function snapshotContexts(): ContextSnapshot;
|
|
28
|
+
/**
|
|
29
|
+
* Push snapshot values and return a function that pops them.
|
|
30
|
+
* Called when we re-render a suspended boundary so it sees the same provider
|
|
31
|
+
* values that were active at suspension time.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyContextSnapshot(snapshot: ContextSnapshot): () => void;
|
|
34
|
+
export declare const ssrDispatcher: {
|
|
35
|
+
useCacheRefresh(): () => never;
|
|
36
|
+
useState<S>(initial: S | (() => S)): [S, any];
|
|
37
|
+
useReducer<S, A>(_reducer: (s: S, a: A) => S, initialArg: any, init?: (a: any) => S): any[];
|
|
38
|
+
useEffect(): void;
|
|
39
|
+
useLayoutEffect(): void;
|
|
40
|
+
useInsertionEffect(): void;
|
|
41
|
+
useRef<T>(initial: T): {
|
|
42
|
+
current: T;
|
|
43
|
+
};
|
|
44
|
+
useMemo<T>(factory: () => T): T;
|
|
45
|
+
useCallback<T extends Function>(fn: T): T;
|
|
46
|
+
useContext<T>(ctx: any): T;
|
|
47
|
+
useImperativeHandle(): void;
|
|
48
|
+
useDebugValue(): void;
|
|
49
|
+
useId(): string;
|
|
50
|
+
useTransition(): [boolean, (fn: () => void) => void];
|
|
51
|
+
useActionState<S, P>(_action: (state: Awaited<S>, payload: P) => S | Promise<S>, initial: Awaited<S>): [Awaited<S>, (payload: P) => void, boolean];
|
|
52
|
+
useOptimistic<S, A>(state: S): [S, (action: A) => void];
|
|
53
|
+
useFormStatus(): import("../react/form-state.js").FormStatus;
|
|
54
|
+
useDeferredValue<T>(v: T): T;
|
|
55
|
+
useSyncExternalStore<T>(_subscribe: (cb: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;
|
|
56
|
+
use<T>(resource: any): T;
|
|
57
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { leadingBit } from "../dom/react-ids.js";
|
|
2
|
+
import { isFunction } from "../core/functions.js";
|
|
3
|
+
import { readThenable } from "../react/thenable.js";
|
|
4
|
+
import { idleFormStatus } from "../react/form-state.js";
|
|
5
|
+
import { ReactSharedInternals, REACT_CONTEXT_TYPE } from "../react/index.js";
|
|
6
|
+
import { isBrowserToken, browserError } from "../core/browser.js";
|
|
7
|
+
import { resourceHintDispatcher } from "../core/resource-hints.js";
|
|
8
|
+
import { createResourceHints } from "./resource-hints.js";
|
|
9
|
+
let frame = null;
|
|
10
|
+
resourceHintDispatcher.emit = (kind, href, options) => {
|
|
11
|
+
if (!frame)
|
|
12
|
+
return false;
|
|
13
|
+
(frame.resources ||= createResourceHints(!!frame.shellFlushed, frame.styleNonce)).add(kind, href, options);
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
function beginSSR(identifierPrefix = "", nextFrame) {
|
|
17
|
+
const previous = { frame, dispatcher: ReactSharedInternals.H };
|
|
18
|
+
frame = nextFrame ?? { treeId: 1n, localId: 0, identifierPrefix, contextStack: [] };
|
|
19
|
+
ReactSharedInternals.H = ssrDispatcher;
|
|
20
|
+
return previous;
|
|
21
|
+
}
|
|
22
|
+
function currentSSRFrame() {
|
|
23
|
+
return frame;
|
|
24
|
+
}
|
|
25
|
+
function recordHostResource(type, props, scope) {
|
|
26
|
+
return !!frame && (frame.resources ||= createResourceHints(!!frame.shellFlushed, frame.styleNonce)).addHost(type, props, scope);
|
|
27
|
+
}
|
|
28
|
+
function endSSR(previous) {
|
|
29
|
+
if (frame) {
|
|
30
|
+
for (let i = frame.contextStack.length - 1; i >= 0; i--) {
|
|
31
|
+
const { context, prev } = frame.contextStack[i];
|
|
32
|
+
context._currentValue = prev;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
ReactSharedInternals.H = previous?.dispatcher ?? null;
|
|
36
|
+
frame = previous?.frame ?? null;
|
|
37
|
+
}
|
|
38
|
+
function pushContext(context, value) {
|
|
39
|
+
if (!frame)
|
|
40
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "pushContext called outside SSR" : "");
|
|
41
|
+
frame.contextStack.push({ context, prev: context._currentValue });
|
|
42
|
+
context._currentValue = value;
|
|
43
|
+
}
|
|
44
|
+
function popContext(context) {
|
|
45
|
+
if (!frame)
|
|
46
|
+
return;
|
|
47
|
+
const top = frame.contextStack.pop();
|
|
48
|
+
if (top && top.context === context)
|
|
49
|
+
context._currentValue = top.prev;
|
|
50
|
+
}
|
|
51
|
+
function snapshotContexts() {
|
|
52
|
+
if (!frame)
|
|
53
|
+
return [];
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const entry of frame.contextStack) {
|
|
56
|
+
out.push({ context: entry.context, value: entry.context._currentValue });
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
function applyContextSnapshot(snapshot) {
|
|
61
|
+
for (const { context, value } of snapshot)
|
|
62
|
+
pushContext(context, value);
|
|
63
|
+
return () => {
|
|
64
|
+
for (let i = snapshot.length - 1; i >= 0; i--)
|
|
65
|
+
popContext(snapshot[i].context);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const ssrDispatcher = {
|
|
69
|
+
useCacheRefresh() {
|
|
70
|
+
return () => {
|
|
71
|
+
throw new Error("Refreshing the cache is not supported during server rendering.");
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
useState(initial) {
|
|
75
|
+
const v = isFunction(initial) ? initial() : initial;
|
|
76
|
+
return [v, (() => {
|
|
77
|
+
})];
|
|
78
|
+
},
|
|
79
|
+
useReducer(_reducer, initialArg, init) {
|
|
80
|
+
const v = init ? init(initialArg) : initialArg;
|
|
81
|
+
return [v, (() => {
|
|
82
|
+
})];
|
|
83
|
+
},
|
|
84
|
+
useEffect() {
|
|
85
|
+
},
|
|
86
|
+
useLayoutEffect() {
|
|
87
|
+
},
|
|
88
|
+
useInsertionEffect() {
|
|
89
|
+
},
|
|
90
|
+
useRef(initial) {
|
|
91
|
+
return { current: initial };
|
|
92
|
+
},
|
|
93
|
+
useMemo(factory) {
|
|
94
|
+
return factory();
|
|
95
|
+
},
|
|
96
|
+
useCallback(fn) {
|
|
97
|
+
return fn;
|
|
98
|
+
},
|
|
99
|
+
useContext(ctx) {
|
|
100
|
+
return ctx._currentValue;
|
|
101
|
+
},
|
|
102
|
+
useImperativeHandle() {
|
|
103
|
+
},
|
|
104
|
+
useDebugValue() {
|
|
105
|
+
},
|
|
106
|
+
useId() {
|
|
107
|
+
if (!frame)
|
|
108
|
+
return ":r0:";
|
|
109
|
+
const local = frame.localId++;
|
|
110
|
+
const tree = frame.treeId;
|
|
111
|
+
return "_" + frame.identifierPrefix + "R_" + (tree ^ leadingBit(tree)).toString(32) + (local ? "H" + local.toString(32) : "") + "_";
|
|
112
|
+
},
|
|
113
|
+
useTransition() {
|
|
114
|
+
return [false, (fn) => fn()];
|
|
115
|
+
},
|
|
116
|
+
useActionState(_action, initial) {
|
|
117
|
+
return [initial, () => {
|
|
118
|
+
}, false];
|
|
119
|
+
},
|
|
120
|
+
useOptimistic(state) {
|
|
121
|
+
return [state, () => {
|
|
122
|
+
}];
|
|
123
|
+
},
|
|
124
|
+
useFormStatus() {
|
|
125
|
+
return idleFormStatus;
|
|
126
|
+
},
|
|
127
|
+
useDeferredValue(v) {
|
|
128
|
+
return v;
|
|
129
|
+
},
|
|
130
|
+
useSyncExternalStore(_subscribe, getSnapshot, getServerSnapshot) {
|
|
131
|
+
return getServerSnapshot ? getServerSnapshot() : getSnapshot();
|
|
132
|
+
},
|
|
133
|
+
use(resource) {
|
|
134
|
+
if (resource == null)
|
|
135
|
+
throw new Error("use() received null or undefined");
|
|
136
|
+
if (isBrowserToken(resource))
|
|
137
|
+
throw browserError(resource);
|
|
138
|
+
if (resource.$$typeof === REACT_CONTEXT_TYPE) {
|
|
139
|
+
return resource._currentValue;
|
|
140
|
+
}
|
|
141
|
+
if (isFunction(resource.then)) {
|
|
142
|
+
return readThenable(resource);
|
|
143
|
+
}
|
|
144
|
+
throw new Error("use() expected a Promise or Context");
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
export {
|
|
148
|
+
applyContextSnapshot,
|
|
149
|
+
beginSSR,
|
|
150
|
+
currentSSRFrame,
|
|
151
|
+
endSSR,
|
|
152
|
+
popContext,
|
|
153
|
+
pushContext,
|
|
154
|
+
recordHostResource,
|
|
155
|
+
snapshotContexts,
|
|
156
|
+
ssrDispatcher
|
|
157
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/dispatcher.ts"],
|
|
4
|
+
"sourcesContent": ["import { isFunction } from '../core/functions'\nimport { readThenable } from '../react/thenable'\nimport { idleFormStatus } from '../react/form-state'\nimport { ReactSharedInternals, REACT_CONTEXT_TYPE } from '../react'\nimport { isBrowserToken, browserError } from '../core/browser'\nimport { resourceHintDispatcher } from '../core/resource-hints'\nimport { createResourceHints, type ResourceScope } from './resource-hints'\n\nexport interface SSRFrame {\n idCounter: number\n identifierPrefix: string\n contextStack: Array<{ context: any; prev: any }>\n resources?: ReturnType<typeof createResourceHints>\n shellFlushed?: boolean\n styleNonce?: string | undefined\n}\n\nlet frame: SSRFrame | null = null\n\nresourceHintDispatcher.emit = (kind, href, options) => {\n if (!frame) return false\n ;(frame.resources ||= createResourceHints(!!frame.shellFlushed, frame.styleNonce)).add(kind, href, options)\n return true\n}\n\nexport function beginSSR(identifierPrefix = ':R', nextFrame?: SSRFrame) {\n const previous = { frame, dispatcher: ReactSharedInternals.H }\n frame = nextFrame ?? { idCounter: 0, identifierPrefix, contextStack: [] }\n ReactSharedInternals.H = ssrDispatcher as any\n return previous\n}\n\nexport function currentSSRFrame(): SSRFrame {\n return frame!\n}\n\nexport function recordHostResource(type: string, props: any, scope?: ResourceScope): boolean {\n return !!frame && (frame.resources ||= createResourceHints(!!frame.shellFlushed, frame.styleNonce)).addHost(type, props, scope)\n}\n\nexport function endSSR(previous?: ReturnType<typeof beginSSR>): void {\n // Restore any remaining pushed contexts (defensive)\n if (frame) {\n for (let i = frame.contextStack.length - 1; i >= 0; i--) {\n const { context, prev } = frame.contextStack[i]!\n context._currentValue = prev\n }\n }\n // Only synchronous renders restore their caller. A stream can finish\n // after its caller has returned, so it must not reinstall that dispatcher.\n ReactSharedInternals.H = previous?.dispatcher ?? null\n frame = previous?.frame ?? null\n}\n\nexport function pushContext(context: any, value: any): void {\n if (!frame) throw new Error(process.env.NODE_ENV !== 'production' ? 'pushContext called outside SSR' : '')\n frame.contextStack.push({ context, prev: context._currentValue })\n context._currentValue = value\n}\n\nexport function popContext(context: any): void {\n if (!frame) return\n const top = frame.contextStack.pop()\n if (top && top.context === context) context._currentValue = top.prev\n}\n\nexport type ContextSnapshot = Array<{ context: any; value: any }>\n\nexport function snapshotContexts(): ContextSnapshot {\n if (!frame) return []\n const out: ContextSnapshot = []\n for (const entry of frame.contextStack) {\n out.push({ context: entry.context, value: entry.context._currentValue })\n }\n return out\n}\n\n/**\n * Push snapshot values and return a function that pops them.\n * Called when we re-render a suspended boundary so it sees the same provider\n * values that were active at suspension time.\n */\nexport function applyContextSnapshot(snapshot: ContextSnapshot): () => void {\n for (const { context, value } of snapshot) pushContext(context, value)\n return () => {\n for (let i = snapshot.length - 1; i >= 0; i--) popContext(snapshot[i]!.context)\n }\n}\n\nexport const ssrDispatcher = {\n useCacheRefresh() {\n return () => { throw new Error('Refreshing the cache is not supported during server rendering.') }\n },\n useState<S>(initial: S | (() => S)) {\n const v = isFunction(initial) ? (initial as () => S)() : initial\n return [v, (() => {}) as any] as [S, any]\n },\n useReducer<S, A>(_reducer: (s: S, a: A) => S, initialArg: any, init?: (a: any) => S) {\n const v = init ? init(initialArg) : initialArg\n return [v, (() => {}) as any]\n },\n useEffect() {\n // noop on server\n },\n useLayoutEffect() {\n // noop on server\n },\n useInsertionEffect() {\n // noop on server\n },\n useRef<T>(initial: T) {\n return { current: initial }\n },\n useMemo<T>(factory: () => T) {\n return factory()\n },\n useCallback<T extends Function>(fn: T) {\n return fn\n },\n useContext<T>(ctx: any): T {\n return ctx._currentValue\n },\n useImperativeHandle() {\n // noop on server\n },\n useDebugValue() {\n // noop\n },\n useId(): string {\n if (!frame) return ':r0:'\n return `${frame.identifierPrefix}${(frame.idCounter++).toString(36)}`\n },\n useTransition(): [boolean, (fn: () => void) => void] {\n return [false, (fn) => fn()]\n },\n useActionState<S, P>(_action: (state: Awaited<S>, payload: P) => S | Promise<S>, initial: Awaited<S>): [Awaited<S>, (payload: P) => void, boolean] {\n return [initial, () => {}, false]\n },\n useOptimistic<S, A>(state: S): [S, (action: A) => void] {\n return [state, () => {}]\n },\n useFormStatus() { return idleFormStatus },\n useDeferredValue<T>(v: T): T {\n return v\n },\n useSyncExternalStore<T>(\n _subscribe: (cb: () => void) => () => void,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n ): T {\n return getServerSnapshot ? getServerSnapshot() : getSnapshot()\n },\n use<T>(resource: any): T {\n if (resource == null) throw new Error('use() received null or undefined')\n if (isBrowserToken(resource)) throw browserError(resource)\n if (resource.$$typeof === REACT_CONTEXT_TYPE) {\n return resource._currentValue\n }\n if (isFunction(resource.then)) {\n return readThenable(resource) as T\n }\n throw new Error('use() expected a Promise or Context')\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,8BAA8B;AACvC,SAAS,2BAA+C;AAWxD,IAAI,QAAyB;AAE7B,uBAAuB,OAAO,CAAC,MAAM,MAAM,YAAW;AACpD,MAAI,CAAC;AAAO,WAAO;AAClB,GAAC,MAAM,cAAc,oBAAoB,CAAC,CAAC,MAAM,cAAc,MAAM,UAAU,GAAG,IAAI,MAAM,MAAM,OAAO;AAC1G,SAAO;AACT;AAEM,SAAU,SAAS,mBAAmB,MAAM,WAAoB;AACpE,QAAM,WAAW,EAAE,OAAO,YAAY,qBAAqB,EAAC;AAC5D,UAAQ,aAAa,EAAE,WAAW,GAAG,kBAAkB,cAAc,CAAA,EAAE;AACvE,uBAAqB,IAAI;AACzB,SAAO;AACT;AAEM,SAAU,kBAAe;AAC7B,SAAO;AACT;AAEM,SAAU,mBAAmB,MAAc,OAAY,OAAqB;AAChF,SAAO,CAAC,CAAC,UAAU,MAAM,cAAc,oBAAoB,CAAC,CAAC,MAAM,cAAc,MAAM,UAAU,GAAG,QAAQ,MAAM,OAAO,KAAK;AAChI;AAEM,SAAU,OAAO,UAAsC;AAE3D,MAAI,OAAO;AACT,aAAS,IAAI,MAAM,aAAa,SAAS,GAAG,KAAK,GAAG,KAAK;AACvD,YAAM,EAAE,SAAS,KAAI,IAAK,MAAM,aAAa,CAAC;AAC9C,cAAQ,gBAAgB;IAC1B;EACF;AAGA,uBAAqB,IAAI,UAAU,cAAc;AACjD,UAAQ,UAAU,SAAS;AAC7B;AAEM,SAAU,YAAY,SAAc,OAAU;AAClD,MAAI,CAAC;AAAO,UAAM,IAAI,MAAM,yBAAyB,eAAe,mCAAmC,EAAE;AACzG,QAAM,aAAa,KAAK,EAAE,SAAS,MAAM,QAAQ,cAAa,CAAE;AAChE,UAAQ,gBAAgB;AAC1B;AAEM,SAAU,WAAW,SAAY;AACrC,MAAI,CAAC;AAAO;AACZ,QAAM,MAAM,MAAM,aAAa,IAAG;AAClC,MAAI,OAAO,IAAI,YAAY;AAAS,YAAQ,gBAAgB,IAAI;AAClE;AAIM,SAAU,mBAAgB;AAC9B,MAAI,CAAC;AAAO,WAAO,CAAA;AACnB,QAAM,MAAuB,CAAA;AAC7B,aAAW,SAAS,MAAM,cAAc;AACtC,QAAI,KAAK,EAAE,SAAS,MAAM,SAAS,OAAO,MAAM,QAAQ,cAAa,CAAE;EACzE;AACA,SAAO;AACT;AAOM,SAAU,qBAAqB,UAAyB;AAC5D,aAAW,EAAE,SAAS,MAAK,KAAM;AAAU,gBAAY,SAAS,KAAK;AACrE,SAAO,MAAK;AACV,aAAS,IAAI,SAAS,SAAS,GAAG,KAAK,GAAG;AAAK,iBAAW,SAAS,CAAC,EAAG,OAAO;EAChF;AACF;AAEO,MAAM,gBAAgB;EAC3B,kBAAe;AACb,WAAO,MAAK;AAAG,YAAM,IAAI,MAAM,gEAAgE;IAAE;EACnG;EACA,SAAY,SAAsB;AAChC,UAAM,IAAI,WAAW,OAAO,IAAK,QAAmB,IAAK;AACzD,WAAO,CAAC,IAAI,MAAK;IAAE,EAAS;EAC9B;EACA,WAAiB,UAA6B,YAAiB,MAAoB;AACjF,UAAM,IAAI,OAAO,KAAK,UAAU,IAAI;AACpC,WAAO,CAAC,IAAI,MAAK;IAAE,EAAS;EAC9B;EACA,YAAS;EAET;EACA,kBAAe;EAEf;EACA,qBAAkB;EAElB;EACA,OAAU,SAAU;AAClB,WAAO,EAAE,SAAS,QAAO;EAC3B;EACA,QAAW,SAAgB;AACzB,WAAO,QAAO;EAChB;EACA,YAAgC,IAAK;AACnC,WAAO;EACT;EACA,WAAc,KAAQ;AACpB,WAAO,IAAI;EACb;EACA,sBAAmB;EAEnB;EACA,gBAAa;EAEb;EACA,QAAK;AACH,QAAI,CAAC;AAAO,aAAO;AACnB,WAAO,GAAG,MAAM,gBAAgB,IAAI,MAAM,aAAa,SAAS,EAAE,CAAC;EACrE;EACA,gBAAa;AACX,WAAO,CAAC,OAAO,CAAC,OAAO,GAAE,CAAE;EAC7B;EACA,eAAqB,SAA4D,SAAmB;AAClG,WAAO,CAAC,SAAS,MAAK;IAAE,GAAG,KAAK;EAClC;EACA,cAAoB,OAAQ;AAC1B,WAAO,CAAC,OAAO,MAAK;IAAE,CAAC;EACzB;EACA,gBAAa;AAAK,WAAO;EAAe;EACxC,iBAAoB,GAAI;AACtB,WAAO;EACT;EACA,qBACE,YACA,aACA,mBAA2B;AAE3B,WAAO,oBAAoB,kBAAiB,IAAK,YAAW;EAC9D;EACA,IAAO,UAAa;AAClB,QAAI,YAAY;AAAM,YAAM,IAAI,MAAM,kCAAkC;AACxE,QAAI,eAAe,QAAQ;AAAG,YAAM,aAAa,QAAQ;AACzD,QAAI,SAAS,aAAa,oBAAoB;AAC5C,aAAO,SAAS;IAClB;AACA,QAAI,WAAW,SAAS,IAAI,GAAG;AAC7B,aAAO,aAAa,QAAQ;IAC9B;AACA,UAAM,IAAI,MAAM,qCAAqC;EACvD;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function escapeAttr(value: string): string;
|
|
2
|
+
export declare function escapeText(value: string): string;
|
|
3
|
+
export declare function escapeScript(value: string): string;
|
|
4
|
+
export declare const VOID_ELEMENTS: Set<string>;
|
|
5
|
+
export declare const RAW_TEXT_ELEMENTS: Set<string>;
|
|
6
|
+
export declare function attrToHtml(name: string, value: unknown, isSvg?: boolean): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UNITLESS_STYLE } from "../core/unitless-style.js";
|
|
2
|
+
import { isFunction } from "../core/functions.js";
|
|
3
|
+
import { attributeName, STRING_BOOLEAN_ATTRS, BOOLEAN_ATTRS } from "../core/attributes.js";
|
|
4
|
+
function escape(value, pattern) {
|
|
5
|
+
return value.replace(pattern, (char) => char === "&" ? "&" : char === "<" ? "<" : char === ">" ? ">" : """);
|
|
6
|
+
}
|
|
7
|
+
function escapeAttr(value) {
|
|
8
|
+
return /[&"<>]/.test(value) ? escape(value, /[&"<>]/g) : value;
|
|
9
|
+
}
|
|
10
|
+
function escapeText(value) {
|
|
11
|
+
return /[&<>]/.test(value) ? escape(value, /[&<>]/g) : value;
|
|
12
|
+
}
|
|
13
|
+
function escapeScript(value) {
|
|
14
|
+
return value.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<!--/g, "<\\!--");
|
|
15
|
+
}
|
|
16
|
+
const VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
17
|
+
"area",
|
|
18
|
+
"base",
|
|
19
|
+
"br",
|
|
20
|
+
"col",
|
|
21
|
+
"embed",
|
|
22
|
+
"hr",
|
|
23
|
+
"img",
|
|
24
|
+
"input",
|
|
25
|
+
"link",
|
|
26
|
+
"meta",
|
|
27
|
+
"param",
|
|
28
|
+
"source",
|
|
29
|
+
"track",
|
|
30
|
+
"wbr"
|
|
31
|
+
]);
|
|
32
|
+
const RAW_TEXT_ELEMENTS = /* @__PURE__ */ new Set(["script", "style"]);
|
|
33
|
+
function attrToHtml(name, value, isSvg = false) {
|
|
34
|
+
if (name === "children" || name === "key" || name === "ref" || name === "dangerouslySetInnerHTML" || name === "defaultValue" || name === "defaultChecked" || name === "suppressHydrationWarning" || name === "suppressContentEditableWarning") {
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
if (name[0] === "o" && name[1] === "n" && isFunction(value))
|
|
38
|
+
return "";
|
|
39
|
+
if (value == null)
|
|
40
|
+
return "";
|
|
41
|
+
const htmlName = attributeName(name, isSvg);
|
|
42
|
+
if (STRING_BOOLEAN_ATTRS.test(htmlName) || name.startsWith("aria-") || name.startsWith("data-")) {
|
|
43
|
+
return ` ${htmlName}="${escapeAttr(String(value))}"`;
|
|
44
|
+
}
|
|
45
|
+
if (value === false)
|
|
46
|
+
return "";
|
|
47
|
+
if (value === true || BOOLEAN_ATTRS.test(htmlName)) {
|
|
48
|
+
return value ? ` ${htmlName}=""` : "";
|
|
49
|
+
}
|
|
50
|
+
if (name === "style" && typeof value === "object" && value !== null) {
|
|
51
|
+
return ` style="${escapeAttr(styleToString(value))}"`;
|
|
52
|
+
}
|
|
53
|
+
return ` ${htmlName}="${escapeAttr(String(value))}"`;
|
|
54
|
+
}
|
|
55
|
+
function styleToString(style) {
|
|
56
|
+
let out = "";
|
|
57
|
+
for (const key in style) {
|
|
58
|
+
const v = style[key];
|
|
59
|
+
if (v == null || v === false)
|
|
60
|
+
continue;
|
|
61
|
+
const kebab = key.startsWith("--") ? key : key.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase()).replace(/^ms-/, "-ms-");
|
|
62
|
+
const value = typeof v === "number" && !UNITLESS_STYLE.test(key) && v !== 0 ? v + "px" : v;
|
|
63
|
+
out += `${kebab}:${value};`;
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
RAW_TEXT_ELEMENTS,
|
|
69
|
+
VOID_ELEMENTS,
|
|
70
|
+
attrToHtml,
|
|
71
|
+
escapeAttr,
|
|
72
|
+
escapeScript,
|
|
73
|
+
escapeText
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=escape.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/escape.ts"],
|
|
4
|
+
"sourcesContent": ["import { UNITLESS_STYLE } from '../core/unitless-style'\nimport { isFunction } from '../core/functions'\nimport { attributeName, STRING_BOOLEAN_ATTRS, BOOLEAN_ATTRS } from '../core/attributes'\n\nfunction escape(value: string, pattern: RegExp): string {\n return value.replace(pattern, char => char === '&' ? '&' : char === '<' ? '<' : char === '>' ? '>' : '"')\n}\n\nexport function escapeAttr(value: string): string {\n return /[&\"<>]/.test(value) ? escape(value, /[&\"<>]/g) : value\n}\n\nexport function escapeText(value: string): string {\n return /[&<>]/.test(value) ? escape(value, /[&<>]/g) : value\n}\n\n// Raw-text element body escaping: prevent any closing tag for the raw-text\n// elements (<script>, <style>) from terminating the element early, plus\n// `<!--` (which would start an HTML comment that survives even inside\n// raw-text bodies and can be exploited to alter following script content).\n// React's serializer follows the same approach.\nexport function escapeScript(value: string): string {\n return value\n .replace(/<\\/(script|style)/gi, '<\\\\/$1')\n .replace(/<!--/g, '<\\\\!--')\n}\n\nexport const VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\nexport const RAW_TEXT_ELEMENTS = new Set(['script', 'style'])\n\nexport function attrToHtml(name: string, value: unknown, isSvg = false): string {\n if (\n name === 'children' ||\n name === 'key' ||\n name === 'ref' ||\n name === 'dangerouslySetInnerHTML' ||\n name === 'defaultValue' ||\n name === 'defaultChecked' ||\n name === 'suppressHydrationWarning' ||\n name === 'suppressContentEditableWarning'\n ) {\n return ''\n }\n if (name[0] === 'o' && name[1] === 'n' && isFunction(value)) return ''\n if (value == null) return ''\n\n const htmlName = attributeName(name, isSvg)\n\n // These attributes need explicit \"false\", not boolean-attribute absence.\n if (\n STRING_BOOLEAN_ATTRS.test(htmlName) ||\n name.startsWith('aria-') ||\n name.startsWith('data-')\n ) {\n return ` ${htmlName}=\"${escapeAttr(String(value))}\"`\n }\n\n if (value === false) return ''\n\n if (value === true || BOOLEAN_ATTRS.test(htmlName)) {\n return value ? ` ${htmlName}=\"\"` : ''\n }\n\n if (name === 'style' && typeof value === 'object' && value !== null) {\n return ` style=\"${escapeAttr(styleToString(value as Record<string, unknown>))}\"`\n }\n\n return ` ${htmlName}=\"${escapeAttr(String(value))}\"`\n}\n\n\n\nfunction styleToString(style: Record<string, unknown>): string {\n let out = ''\n for (const key in style) {\n const v = style[key]\n if (v == null || v === false) continue\n const kebab = key.startsWith('--')\n ? key\n : key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase()).replace(/^ms-/, '-ms-')\n const value =\n typeof v === 'number' && !UNITLESS_STYLE.test(key) && v !== 0 ? v + 'px' : v\n out += `${kebab}:${value};`\n }\n return out\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,eAAe,sBAAsB,qBAAqB;AAEnE,SAAS,OAAO,OAAe,SAAe;AAC5C,SAAO,MAAM,QAAQ,SAAS,UAAQ,SAAS,MAAM,UAAU,SAAS,MAAM,SAAS,SAAS,MAAM,SAAS,QAAQ;AACzH;AAEM,SAAU,WAAW,OAAa;AACtC,SAAO,SAAS,KAAK,KAAK,IAAI,OAAO,OAAO,SAAS,IAAI;AAC3D;AAEM,SAAU,WAAW,OAAa;AACtC,SAAO,QAAQ,KAAK,KAAK,IAAI,OAAO,OAAO,QAAQ,IAAI;AACzD;AAOM,SAAU,aAAa,OAAa;AACxC,SAAO,MACJ,QAAQ,uBAAuB,QAAQ,EACvC,QAAQ,SAAS,QAAQ;AAC9B;AAEO,MAAM,gBAAgB,oBAAI,IAAI;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AAEM,MAAM,oBAAoB,oBAAI,IAAI,CAAC,UAAU,OAAO,CAAC;AAEtD,SAAU,WAAW,MAAc,OAAgB,QAAQ,OAAK;AACpE,MACE,SAAS,cACT,SAAS,SACT,SAAS,SACT,SAAS,6BACT,SAAS,kBACT,SAAS,oBACT,SAAS,8BACT,SAAS,kCACT;AACA,WAAO;EACT;AACA,MAAI,KAAK,CAAC,MAAM,OAAO,KAAK,CAAC,MAAM,OAAO,WAAW,KAAK;AAAG,WAAO;AACpE,MAAI,SAAS;AAAM,WAAO;AAE1B,QAAM,WAAW,cAAc,MAAM,KAAK;AAG1C,MACE,qBAAqB,KAAK,QAAQ,KAClC,KAAK,WAAW,OAAO,KACvB,KAAK,WAAW,OAAO,GACvB;AACA,WAAO,IAAI,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,CAAC;EACnD;AAEA,MAAI,UAAU;AAAO,WAAO;AAE5B,MAAI,UAAU,QAAQ,cAAc,KAAK,QAAQ,GAAG;AAClD,WAAO,QAAQ,IAAI,QAAQ,QAAQ;EACrC;AAEA,MAAI,SAAS,WAAW,OAAO,UAAU,YAAY,UAAU,MAAM;AACnE,WAAO,WAAW,WAAW,cAAc,KAAgC,CAAC,CAAC;EAC/E;AAEA,SAAO,IAAI,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,CAAC;AACnD;AAIA,SAAS,cAAc,OAA8B;AACnD,MAAI,MAAM;AACV,aAAW,OAAO,OAAO;AACvB,UAAM,IAAI,MAAM,GAAG;AACnB,QAAI,KAAK,QAAQ,MAAM;AAAO;AAC9B,UAAM,QAAQ,IAAI,WAAW,IAAI,IAC7B,MACA,IAAI,QAAQ,UAAU,CAAC,MAAM,MAAM,EAAE,YAAW,CAAE,EAAE,QAAQ,QAAQ,MAAM;AAC9E,UAAM,QACJ,OAAO,MAAM,YAAY,CAAC,eAAe,KAAK,GAAG,KAAK,MAAM,IAAI,IAAI,OAAO;AAC7E,WAAO,GAAG,KAAK,IAAI,KAAK;EAC1B;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { renderToString, renderToStaticMarkup } from "./renderToString.js";
|
|
2
|
+
export { renderToReadableStream, renderToPipeableStream } from "./stream.js";
|
|
3
|
+
export type { StreamOptions, PipeableOptions, PipeableHandle, ReadableStreamResult, } from "./stream.js";
|
|
4
|
+
export { BOUNDARY_REVEAL_RUNTIME } from "./bootstrap-script.js";
|
|
5
|
+
export declare const version = "19.2.3";
|
|
6
|
+
import { renderToString, renderToStaticMarkup } from "./renderToString.js";
|
|
7
|
+
import { renderToReadableStream, renderToPipeableStream } from "./stream.js";
|
|
8
|
+
declare const _default: {
|
|
9
|
+
renderToString: typeof renderToString;
|
|
10
|
+
renderToStaticMarkup: typeof renderToStaticMarkup;
|
|
11
|
+
renderToReadableStream: typeof renderToReadableStream;
|
|
12
|
+
renderToPipeableStream: typeof renderToPipeableStream;
|
|
13
|
+
BOUNDARY_REVEAL_RUNTIME: string;
|
|
14
|
+
version: string;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { renderToString, renderToStaticMarkup } from "./renderToString.js";
|
|
2
|
+
import { renderToReadableStream, renderToPipeableStream } from "./stream.js";
|
|
3
|
+
import { BOUNDARY_REVEAL_RUNTIME } from "./bootstrap-script.js";
|
|
4
|
+
const version = "19.2.3";
|
|
5
|
+
import { renderToString as renderToString2, renderToStaticMarkup as renderToStaticMarkup2 } from "./renderToString.js";
|
|
6
|
+
import { renderToReadableStream as renderToReadableStream2, renderToPipeableStream as renderToPipeableStream2 } from "./stream.js";
|
|
7
|
+
import { BOUNDARY_REVEAL_RUNTIME as BOUNDARY_REVEAL_RUNTIME2 } from "./bootstrap-script.js";
|
|
8
|
+
var server_default = {
|
|
9
|
+
renderToString: renderToString2,
|
|
10
|
+
renderToStaticMarkup: renderToStaticMarkup2,
|
|
11
|
+
renderToReadableStream: renderToReadableStream2,
|
|
12
|
+
renderToPipeableStream: renderToPipeableStream2,
|
|
13
|
+
BOUNDARY_REVEAL_RUNTIME: BOUNDARY_REVEAL_RUNTIME2,
|
|
14
|
+
version: "19.2.3"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
BOUNDARY_REVEAL_RUNTIME,
|
|
18
|
+
server_default as default,
|
|
19
|
+
renderToPipeableStream,
|
|
20
|
+
renderToReadableStream,
|
|
21
|
+
renderToStaticMarkup,
|
|
22
|
+
renderToString,
|
|
23
|
+
version
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { renderToString, renderToStaticMarkup } from './renderToString'\nexport { renderToReadableStream, renderToPipeableStream } from './stream'\nexport type {\n StreamOptions,\n PipeableOptions,\n PipeableHandle,\n ReadableStreamResult,\n} from './stream'\nexport { BOUNDARY_REVEAL_RUNTIME } from './bootstrap-script'\n\nexport const version = '19.2.3'\n\n// Default export — React's real `react-dom/server` ships one, and TanStack\n// Router's SSR code does `import ReactDOMServer from 'react-dom/server'` and\n// reads `.renderToReadableStream` off the default.\nimport { renderToString, renderToStaticMarkup } from './renderToString'\nimport { renderToReadableStream, renderToPipeableStream } from './stream'\nimport { BOUNDARY_REVEAL_RUNTIME } from './bootstrap-script'\nexport default {\n renderToString,\n renderToStaticMarkup,\n renderToReadableStream,\n renderToPipeableStream,\n BOUNDARY_REVEAL_RUNTIME,\n version: '19.2.3',\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,wBAAwB,8BAA8B;AAO/D,SAAS,+BAA+B;AAEjC,MAAM,UAAU;AAKvB,SAAS,kBAAAA,iBAAgB,wBAAAC,6BAA4B;AACrD,SAAS,0BAAAC,yBAAwB,0BAAAC,+BAA8B;AAC/D,SAAS,2BAAAC,gCAA+B;AACxC,IAAA,iBAAe;EACb,gBAAAJ;EACA,sBAAAC;EACA,wBAAAC;EACA,wBAAAC;EACA,yBAAAC;EACA,SAAS;;",
|
|
6
|
+
"names": ["renderToString", "renderToStaticMarkup", "renderToReadableStream", "renderToPipeableStream", "BOUNDARY_REVEAL_RUNTIME"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type InsertionContext = 'html' | 'svg' | 'math' | 'mtext' | 'table' | 'tbody' | 'tr' | 'colgroup';
|
|
2
|
+
export declare function childInsertionContext(tag: string, props: Record<string, any>, parent: InsertionContext): InsertionContext;
|
|
3
|
+
export declare function segmentHtml(content: string, id: string, context: InsertionContext): string;
|