@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.
- 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 +37 -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 +27 -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,32 @@
|
|
|
1
|
+
import { escapeAttr } from "./escape.js";
|
|
2
|
+
function childInsertionContext(tag, props, parent) {
|
|
3
|
+
if (tag === "svg")
|
|
4
|
+
return "svg";
|
|
5
|
+
if (tag === "math")
|
|
6
|
+
return "math";
|
|
7
|
+
if (parent === "svg" && (tag === "foreignObject" || tag === "desc" || tag === "title") || tag === "annotation-xml" && /^(text\/html|application\/xhtml\+xml)$/i.test(props.encoding ?? ""))
|
|
8
|
+
return "html";
|
|
9
|
+
if (parent === "math" && /^(mi|mo|mn|ms|mtext)$/.test(tag))
|
|
10
|
+
return "mtext";
|
|
11
|
+
if (parent === "mtext" && (tag === "mglyph" || tag === "malignmark"))
|
|
12
|
+
return "math";
|
|
13
|
+
if (parent === "svg" || parent === "math")
|
|
14
|
+
return parent;
|
|
15
|
+
if (tag === "table" || tag === "tr" || tag === "colgroup")
|
|
16
|
+
return tag;
|
|
17
|
+
if (tag === "tbody" || tag === "thead" || tag === "tfoot")
|
|
18
|
+
return "tbody";
|
|
19
|
+
return "html";
|
|
20
|
+
}
|
|
21
|
+
function segmentHtml(content, id, context) {
|
|
22
|
+
const mathText = context === "mtext";
|
|
23
|
+
const nested = mathText || context === "tbody" || context === "tr" || context === "colgroup";
|
|
24
|
+
const tag = context === "html" ? "div" : context;
|
|
25
|
+
const hidden = nested ? "" : context === "svg" || context === "math" ? ' aria-hidden="true" style="display:none"' : " hidden";
|
|
26
|
+
const wrapper = mathText ? '<math style="display:none">' : "<table hidden>";
|
|
27
|
+
return `${nested ? wrapper : ""}<${tag}${hidden} id="${escapeAttr(id)}">${content}</${tag}>${nested ? mathText ? "</math>" : "</table>" : ""}`;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
childInsertionContext,
|
|
31
|
+
segmentHtml
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "../core/index.js";
|
|
2
|
+
export declare function renderToString(children: ReactNode, options?: {
|
|
3
|
+
identifierPrefix?: string;
|
|
4
|
+
}): string;
|
|
5
|
+
export declare function renderToStaticMarkup(children: ReactNode, options?: {
|
|
6
|
+
identifierPrefix?: string;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { beginSSR, currentSSRFrame, endSSR } from "./dispatcher.js";
|
|
2
|
+
import { walk } from "./walk.js";
|
|
3
|
+
function renderToString(children, options = {}) {
|
|
4
|
+
const previous = beginSSR(options.identifierPrefix);
|
|
5
|
+
let output = "";
|
|
6
|
+
let id = 0;
|
|
7
|
+
let head = 0;
|
|
8
|
+
try {
|
|
9
|
+
walk(children, {
|
|
10
|
+
emit: (s) => {
|
|
11
|
+
output += s;
|
|
12
|
+
},
|
|
13
|
+
nextBoundaryId: () => id++,
|
|
14
|
+
onHead: () => {
|
|
15
|
+
head = output.length;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const hints = currentSSRFrame().resources?.drain();
|
|
19
|
+
if (hints)
|
|
20
|
+
output = output.slice(0, head) + hints + output.slice(head);
|
|
21
|
+
} finally {
|
|
22
|
+
endSSR(previous);
|
|
23
|
+
}
|
|
24
|
+
return output;
|
|
25
|
+
}
|
|
26
|
+
function renderToStaticMarkup(children, options = {}) {
|
|
27
|
+
return renderToString(children, options).replace(/<!--[^>]*-->/g, "");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
renderToStaticMarkup,
|
|
31
|
+
renderToString
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=renderToString.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/renderToString.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactNode } from '../core'\nimport { beginSSR, currentSSRFrame, endSSR } from './dispatcher'\nimport { walk } from './walk'\n\nexport function renderToString(\n children: ReactNode,\n options: { identifierPrefix?: string } = {},\n): string {\n const previous = beginSSR(options.identifierPrefix)\n let output = ''\n let id = 0\n let head = 0\n try {\n walk(children, {\n emit: (s) => {\n output += s\n },\n nextBoundaryId: () => id++,\n onHead: () => { head = output.length },\n })\n const hints = currentSSRFrame().resources?.drain()\n if (hints) output = output.slice(0, head) + hints + output.slice(head)\n } finally {\n endSSR(previous)\n }\n return output\n}\n\nexport function renderToStaticMarkup(\n children: ReactNode,\n options: { identifierPrefix?: string } = {},\n): string {\n // For our purposes identical to renderToString (no hydration markers in static output)\n return renderToString(children, options).replace(/<!--[^>]*-->/g, '')\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,UAAU,iBAAiB,cAAc;AAClD,SAAS,YAAY;AAEf,SAAU,eACd,UACA,UAAyC,CAAA,GAAE;AAE3C,QAAM,WAAW,SAAS,QAAQ,gBAAgB;AAClD,MAAI,SAAS;AACb,MAAI,KAAK;AACT,MAAI,OAAO;AACX,MAAI;AACF,SAAK,UAAU;MACb,MAAM,CAAC,MAAK;AACV,kBAAU;MACZ;MACA,gBAAgB,MAAM;MACtB,QAAQ,MAAK;AAAG,eAAO,OAAO;MAAO;KACtC;AACD,UAAM,QAAQ,gBAAe,EAAG,WAAW,MAAK;AAChD,QAAI;AAAO,eAAS,OAAO,MAAM,GAAG,IAAI,IAAI,QAAQ,OAAO,MAAM,IAAI;EACvE;AACE,WAAO,QAAQ;EACjB;AACA,SAAO;AACT;AAEM,SAAU,qBACd,UACA,UAAyC,CAAA,GAAE;AAG3C,SAAO,eAAe,UAAU,OAAO,EAAE,QAAQ,iBAAiB,EAAE;AACtE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ResourceHintKind, type ResourceHintOptions } from "../core/resource-hints.js";
|
|
2
|
+
interface Resource {
|
|
3
|
+
kind: ResourceHintKind | 'style';
|
|
4
|
+
href: string;
|
|
5
|
+
options: Record<string, any>;
|
|
6
|
+
sent?: boolean;
|
|
7
|
+
cancelled?: boolean;
|
|
8
|
+
preloaded?: boolean;
|
|
9
|
+
css?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ResourceScope {
|
|
12
|
+
stylesheets?: Map<string, string[]>;
|
|
13
|
+
inline?: Set<string>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createResourceHints(shellFlushed?: boolean, styleNonce?: string): {
|
|
16
|
+
add(kind: ResourceHintKind | "style", href: string, options: ResourceHintOptions): Resource;
|
|
17
|
+
addHost(type: string, props: any, scope?: ResourceScope): boolean;
|
|
18
|
+
mergeScope(scope: ResourceScope, parent?: ResourceScope): void;
|
|
19
|
+
takeStylesheets(): string[][];
|
|
20
|
+
drain(): string;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { isFunction } from "../core/functions.js";
|
|
2
|
+
import { resourceKind, resourceURL } from "../core/resource-hints.js";
|
|
3
|
+
import { attrToHtml, escapeAttr } from "./escape.js";
|
|
4
|
+
import { attributeName } from "../core/attributes.js";
|
|
5
|
+
function styleText(props) {
|
|
6
|
+
const html = props.dangerouslySetInnerHTML;
|
|
7
|
+
if (html != null) {
|
|
8
|
+
if (typeof html !== "object" || !("__html" in html))
|
|
9
|
+
throw new Error("dangerouslySetInnerHTML must be an object with an __html field.");
|
|
10
|
+
if (props.children != null)
|
|
11
|
+
throw new Error("Can only set one of children or dangerouslySetInnerHTML.");
|
|
12
|
+
return html.__html == null ? "" : "" + html.__html;
|
|
13
|
+
}
|
|
14
|
+
const child = Array.isArray(props.children) ? props.children.length < 2 ? props.children[0] : null : props.children;
|
|
15
|
+
return child == null || isFunction(child) || typeof child === "symbol" ? "" : ("" + child).replace(/(<\/?)(s)(tyle)/gi, (_, prefix, s, suffix) => prefix + "\\" + s.charCodeAt(0).toString(16) + " " + suffix);
|
|
16
|
+
}
|
|
17
|
+
function markup(resource, late) {
|
|
18
|
+
const { kind, href, options } = resource;
|
|
19
|
+
const script = kind === "script" || kind === "module-script";
|
|
20
|
+
const style = kind === "stylesheet";
|
|
21
|
+
const props = script ? { src: href, ...kind === "module-script" ? { type: "module" } : {}, async: true, ...options } : style ? late ? { rel: "preload", as: "style", href, crossOrigin: options.crossOrigin, fetchPriority: options.fetchPriority, integrity: options.integrity, media: options.media, hrefLang: options.hrefLang, referrerPolicy: options.referrerPolicy } : { rel: "stylesheet", href, "data-precedence": options.precedence, ...options } : { rel: kind, ...options.as === "image" && options.imageSrcSet ? {} : { href }, ...options };
|
|
22
|
+
let output = script ? "<script" : "<link";
|
|
23
|
+
for (const name in props) {
|
|
24
|
+
if (name === "precedence" || late && name === "data-precedence")
|
|
25
|
+
continue;
|
|
26
|
+
const value = name === "href" || name === "src" ? resourceURL(props[name]) : props[name];
|
|
27
|
+
output += attrToHtml(name, value).replace(/'/g, "'");
|
|
28
|
+
}
|
|
29
|
+
return output + (script ? "><\/script>" : "/>");
|
|
30
|
+
}
|
|
31
|
+
function createResourceHints(shellFlushed = false, styleNonce) {
|
|
32
|
+
const resources = /* @__PURE__ */ new Map();
|
|
33
|
+
const groups = [[], [], [], [], []];
|
|
34
|
+
const styles = /* @__PURE__ */ new Map();
|
|
35
|
+
const dependencies = /* @__PURE__ */ new Map();
|
|
36
|
+
const visibleInline = /* @__PURE__ */ new Set();
|
|
37
|
+
const collector = {
|
|
38
|
+
add(kind, href, options) {
|
|
39
|
+
let type = kind;
|
|
40
|
+
let source = href;
|
|
41
|
+
const init = kind === "style" || kind === "stylesheet" || kind === "script" || kind === "module-script";
|
|
42
|
+
if (kind === "preload") {
|
|
43
|
+
type = options.as;
|
|
44
|
+
if (type === "image" && options.imageSrcSet)
|
|
45
|
+
source = options.imageSrcSet + "\n" + (options.imageSizes || "");
|
|
46
|
+
} else if (kind === "modulepreload")
|
|
47
|
+
type = "module-" + (options.as || "script");
|
|
48
|
+
else if (kind === "stylesheet")
|
|
49
|
+
type = "style";
|
|
50
|
+
else if (kind === "preconnect")
|
|
51
|
+
type += ":" + (options.crossOrigin ?? "default");
|
|
52
|
+
const key = JSON.stringify([type, source]);
|
|
53
|
+
const prior = resources.get(key);
|
|
54
|
+
if (prior && (!init || prior.kind !== "preload" && prior.kind !== "modulepreload"))
|
|
55
|
+
return prior;
|
|
56
|
+
const resource = { kind, href, options: { ...options } };
|
|
57
|
+
if (kind === "style" && (!styleNonce || options.nonce === styleNonce))
|
|
58
|
+
resource.css = styleText(options);
|
|
59
|
+
if (prior) {
|
|
60
|
+
prior.cancelled = true;
|
|
61
|
+
resource.preloaded = !!prior.sent;
|
|
62
|
+
for (const name of ["crossOrigin", "integrity"]) {
|
|
63
|
+
if (resource.options[name] == null && prior.options[name] != null)
|
|
64
|
+
resource.options[name] = prior.options[name];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
resources.set(key, resource);
|
|
68
|
+
if (kind === "stylesheet" || kind === "style") {
|
|
69
|
+
const precedence = options.precedence;
|
|
70
|
+
let group = styles.get(precedence);
|
|
71
|
+
if (!group)
|
|
72
|
+
styles.set(precedence, group = []);
|
|
73
|
+
group.push(resource);
|
|
74
|
+
} else {
|
|
75
|
+
const group = kind === "dns-prefetch" || kind === "preconnect" ? 0 : kind === "preload" && options.as === "font" ? 1 : kind === "preload" && options.as === "image" && options.fetchPriority === "high" ? 2 : init ? 3 : 4;
|
|
76
|
+
groups[group].push(resource);
|
|
77
|
+
}
|
|
78
|
+
return resource;
|
|
79
|
+
},
|
|
80
|
+
addHost(type, props, scope) {
|
|
81
|
+
const kind = resourceKind(type, props);
|
|
82
|
+
if (!kind)
|
|
83
|
+
return false;
|
|
84
|
+
const resource = collector.add(kind === "script" && props.type === "module" ? "module-script" : kind, kind === "script" ? props.src : props.href, props);
|
|
85
|
+
if (shellFlushed && kind === "stylesheet") {
|
|
86
|
+
const descriptor = [resourceURL(resource.href), resource.options.precedence];
|
|
87
|
+
for (const name in resource.options) {
|
|
88
|
+
if (name === "href" || name === "rel" || name === "precedence" || name === "data-precedence" || name === "children" || name === "dangerouslySetInnerHTML" || name === "innerHTML" || name === "style" || name === "suppressHydrationWarning" || name === "suppressContentEditableWarning" || name === "ref" || name === "key" || /^on/i.test(name) || !/^[a-zA-Z_:][a-zA-Z0-9:_.-]*$/.test(name))
|
|
89
|
+
continue;
|
|
90
|
+
const value = resource.options[name];
|
|
91
|
+
if (value == null || isFunction(value) || typeof value === "symbol" || name === "hidden" && value === false)
|
|
92
|
+
continue;
|
|
93
|
+
descriptor.push(attributeName(name), name === "hidden" ? "" : name === "src" ? resourceURL("" + value) : "" + value);
|
|
94
|
+
}
|
|
95
|
+
;
|
|
96
|
+
(scope ? scope.stylesheets ||= /* @__PURE__ */ new Map() : dependencies).set(resource.href, descriptor);
|
|
97
|
+
} else if (shellFlushed && kind === "style") {
|
|
98
|
+
;
|
|
99
|
+
(scope ? scope.inline ||= /* @__PURE__ */ new Set() : visibleInline).add(resource.options.precedence);
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
},
|
|
103
|
+
mergeScope(scope, parent) {
|
|
104
|
+
if (scope.stylesheets)
|
|
105
|
+
for (const [href, descriptor] of scope.stylesheets) {
|
|
106
|
+
;
|
|
107
|
+
(parent ? parent.stylesheets ||= /* @__PURE__ */ new Map() : dependencies).set(href, descriptor);
|
|
108
|
+
}
|
|
109
|
+
if (scope.inline)
|
|
110
|
+
for (const precedence of scope.inline) {
|
|
111
|
+
;
|
|
112
|
+
(parent ? parent.inline ||= /* @__PURE__ */ new Set() : visibleInline).add(precedence);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
takeStylesheets() {
|
|
116
|
+
const result = Array.from(dependencies.values());
|
|
117
|
+
dependencies.clear();
|
|
118
|
+
return result;
|
|
119
|
+
},
|
|
120
|
+
drain() {
|
|
121
|
+
let output = "";
|
|
122
|
+
function flush(group, precedence) {
|
|
123
|
+
let remaining = 0;
|
|
124
|
+
let inline = false, hasStylesheets = false;
|
|
125
|
+
let hrefs = "", rules = "";
|
|
126
|
+
for (const resource of group) {
|
|
127
|
+
if (!resource.sent && !resource.cancelled) {
|
|
128
|
+
if (resource.kind === "style") {
|
|
129
|
+
if (shellFlushed && !visibleInline.has(precedence)) {
|
|
130
|
+
group[remaining++] = resource;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
inline = true;
|
|
134
|
+
if (resource.css !== void 0) {
|
|
135
|
+
hrefs += (hrefs ? " " : "") + resource.href;
|
|
136
|
+
rules += resource.css;
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
if (resource.kind === "stylesheet")
|
|
140
|
+
hasStylesheets = true;
|
|
141
|
+
if (!(shellFlushed && resource.kind === "stylesheet" && resource.preloaded))
|
|
142
|
+
output += markup(resource, shellFlushed);
|
|
143
|
+
}
|
|
144
|
+
resource.sent = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
group.length = remaining;
|
|
148
|
+
if (hrefs || inline && !shellFlushed && !hasStylesheets) {
|
|
149
|
+
output += `<style${styleNonce !== void 0 ? ` nonce="${escapeAttr(styleNonce)}"` : ""}${shellFlushed ? ' media="not all"' : ""} data-precedence="${escapeAttr(precedence)}"${hrefs ? ` data-href="${escapeAttr(hrefs)}"` : ""}>${rules}</style>`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
for (let index = 0; index < groups.length; index++) {
|
|
153
|
+
if (index === 3)
|
|
154
|
+
for (const [precedence, group] of styles)
|
|
155
|
+
flush(group, precedence);
|
|
156
|
+
flush(groups[index]);
|
|
157
|
+
}
|
|
158
|
+
shellFlushed = true;
|
|
159
|
+
visibleInline.clear();
|
|
160
|
+
return output;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return collector;
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
createResourceHints
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=resource-hints.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/server/resource-hints.ts"],
|
|
4
|
+
"sourcesContent": ["import { isFunction } from '../core/functions'\nimport { resourceKind, resourceURL, type ResourceHintKind, type ResourceHintOptions } from '../core/resource-hints'\nimport { attrToHtml, escapeAttr } from './escape'\nimport { attributeName } from '../core/attributes'\n\ninterface Resource {\n kind: ResourceHintKind | 'style'\n href: string\n options: Record<string, any>\n sent?: boolean\n cancelled?: boolean\n preloaded?: boolean\n css?: string\n}\n\nexport interface ResourceScope {\n stylesheets?: Map<string, string[]>\n inline?: Set<string>\n}\n\nfunction styleText(props: any): string {\n const html = props.dangerouslySetInnerHTML\n if (html != null) {\n if (typeof html !== 'object' || !('__html' in html)) throw new Error('dangerouslySetInnerHTML must be an object with an __html field.')\n if (props.children != null) throw new Error('Can only set one of children or dangerouslySetInnerHTML.')\n return html.__html == null ? '' : '' + html.__html\n }\n const child = Array.isArray(props.children) ? props.children.length < 2 ? props.children[0] : null : props.children\n return child == null || isFunction(child) || typeof child === 'symbol' ? ''\n : ('' + child).replace(/(<\\/?)(s)(tyle)/gi, (_, prefix: string, s: string, suffix: string) => prefix + '\\\\' + s.charCodeAt(0).toString(16) + ' ' + suffix)\n}\n\nfunction markup(resource: Resource, late: boolean): string {\n const { kind, href, options } = resource\n const script = kind === 'script' || kind === 'module-script'\n const style = kind === 'stylesheet'\n const props: Record<string, any> = script\n ? { src: href, ...(kind === 'module-script' ? { type: 'module' } : {}), async: true, ...options }\n : style\n ? late\n ? { rel: 'preload', as: 'style', href, crossOrigin: options.crossOrigin, fetchPriority: options.fetchPriority, integrity: options.integrity, media: options.media, hrefLang: options.hrefLang, referrerPolicy: options.referrerPolicy }\n : { rel: 'stylesheet', href, 'data-precedence': options.precedence!, ...options }\n : { rel: kind, ...(options.as === 'image' && options.imageSrcSet ? {} : { href }), ...options }\n let output = script ? '<script' : '<link'\n for (const name in props) {\n if (name === 'precedence' || late && name === 'data-precedence') continue\n const value = name === 'href' || name === 'src' ? resourceURL(props[name]!) : props[name]!\n output += attrToHtml(name, value).replace(/'/g, ''')\n }\n return output + (script ? '></script>' : '/>')\n}\n\nexport function createResourceHints(shellFlushed = false, styleNonce?: string) {\n const resources = new Map<string, Resource>()\n const groups: Resource[][] = [[], [], [], [], []]\n const styles = new Map<string, Resource[]>()\n const dependencies = new Map<string, string[]>()\n const visibleInline = new Set<string>()\n const collector = {\n add(kind: ResourceHintKind | 'style', href: string, options: ResourceHintOptions): Resource {\n let type: string = kind\n let source = href\n const init = kind === 'style' || kind === 'stylesheet' || kind === 'script' || kind === 'module-script'\n if (kind === 'preload') {\n type = options.as!\n if (type === 'image' && options.imageSrcSet) source = options.imageSrcSet + '\\n' + (options.imageSizes || '')\n } else if (kind === 'modulepreload') type = 'module-' + (options.as || 'script')\n else if (kind === 'stylesheet') type = 'style'\n else if (kind === 'preconnect') type += ':' + (options.crossOrigin ?? 'default')\n const key = JSON.stringify([type, source])\n const prior = resources.get(key)\n if (prior && (!init || prior.kind !== 'preload' && prior.kind !== 'modulepreload')) return prior\n\n const resource: Resource = { kind, href, options: { ...options } }\n if (kind === 'style' && (!styleNonce || options.nonce === styleNonce)) resource.css = styleText(options)\n if (prior) {\n prior.cancelled = true\n resource.preloaded = !!prior.sent\n for (const name of ['crossOrigin', 'integrity']) {\n if (resource.options[name] == null && prior.options[name] != null) resource.options[name] = prior.options[name]!\n }\n }\n resources.set(key, resource)\n if (kind === 'stylesheet' || kind === 'style') {\n const precedence = options.precedence!\n let group = styles.get(precedence)\n if (!group) styles.set(precedence, group = [])\n group.push(resource)\n } else {\n const group = kind === 'dns-prefetch' || kind === 'preconnect' ? 0\n : kind === 'preload' && options.as === 'font' ? 1\n : kind === 'preload' && options.as === 'image' && options.fetchPriority === 'high' ? 2\n : init ? 3 : 4\n groups[group]!.push(resource)\n }\n return resource\n },\n addHost(type: string, props: any, scope?: ResourceScope): boolean {\n const kind = resourceKind(type, props)\n if (!kind) return false\n const resource = collector.add(kind === 'script' && props.type === 'module' ? 'module-script' : kind, kind === 'script' ? props.src : props.href, props)\n if (shellFlushed && kind === 'stylesheet') {\n const descriptor = [resourceURL(resource.href), resource.options.precedence]\n for (const name in resource.options) {\n if (name === 'href' || name === 'rel' || name === 'precedence' || name === 'data-precedence' || name === 'children' || name === 'dangerouslySetInnerHTML' || name === 'innerHTML' || name === 'style' || name === 'suppressHydrationWarning' || name === 'suppressContentEditableWarning' || name === 'ref' || name === 'key' || /^on/i.test(name) || !/^[a-zA-Z_:][a-zA-Z0-9:_.-]*$/.test(name)) continue\n const value = resource.options[name]\n if (value == null || isFunction(value) || typeof value === 'symbol' || name === 'hidden' && value === false) continue\n descriptor.push(attributeName(name), name === 'hidden' ? '' : name === 'src' ? resourceURL('' + value) : '' + value)\n }\n ;(scope ? scope.stylesheets ||= new Map() : dependencies).set(resource.href, descriptor)\n } else if (shellFlushed && kind === 'style') {\n ;(scope ? scope.inline ||= new Set() : visibleInline).add(resource.options.precedence)\n }\n return true\n },\n mergeScope(scope: ResourceScope, parent?: ResourceScope): void {\n if (scope.stylesheets) for (const [href, descriptor] of scope.stylesheets) {\n ;(parent ? parent.stylesheets ||= new Map() : dependencies).set(href, descriptor)\n }\n if (scope.inline) for (const precedence of scope.inline) {\n ;(parent ? parent.inline ||= new Set() : visibleInline).add(precedence)\n }\n },\n takeStylesheets(): string[][] {\n const result = Array.from(dependencies.values())\n dependencies.clear()\n return result\n },\n drain(): string {\n let output = ''\n function flush(group: Resource[], precedence?: string) {\n let remaining = 0\n let inline = false, hasStylesheets = false\n let hrefs = '', rules = ''\n for (const resource of group) {\n if (!resource.sent && !resource.cancelled) {\n if (resource.kind === 'style') {\n if (shellFlushed && !visibleInline.has(precedence!)) { group[remaining++] = resource; continue }\n inline = true\n if (resource.css !== undefined) {\n hrefs += (hrefs ? ' ' : '') + resource.href\n rules += resource.css\n }\n } else {\n if (resource.kind === 'stylesheet') hasStylesheets = true\n if (!(shellFlushed && resource.kind === 'stylesheet' && resource.preloaded)) output += markup(resource, shellFlushed)\n }\n resource.sent = true\n }\n }\n group.length = remaining\n if (hrefs || inline && !shellFlushed && !hasStylesheets) {\n output += `<style${styleNonce !== undefined ? ` nonce=\"${escapeAttr(styleNonce)}\"` : ''}${shellFlushed ? ' media=\"not all\"' : ''} data-precedence=\"${escapeAttr(precedence!)}\"${hrefs ? ` data-href=\"${escapeAttr(hrefs)}\"` : ''}>${rules}</style>`\n }\n }\n for (let index = 0; index < groups.length; index++) {\n if (index === 3) for (const [precedence, group] of styles) flush(group, precedence)\n flush(groups[index]!)\n }\n shellFlushed = true\n visibleInline.clear()\n return output\n },\n }\n return collector\n}\n"],
|
|
5
|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,gBAAI,SAAS,SAAS,SAAS;AAC7B,kBAAI,gBAAgB,CAAC,cAAc,IAAI,UAAW,GAAG;AAAE,sBAAM,WAAW,IAAI;AAAU;cAAS;AAC/F,uBAAS;AACT,kBAAI,SAAS,QAAQ,QAAW;AAC9B,0BAAU,QAAQ,MAAM,MAAM,SAAS;AACvC,yBAAS,SAAS;cACpB;YACF,OAAO;AACL,kBAAI,SAAS,SAAS;AAAc,iCAAiB;AACrD,kBAAI,EAAE,gBAAgB,SAAS,SAAS,gBAAgB,SAAS;AAAY,0BAAU,OAAO,UAAU,YAAY;YACtH;AACA,qBAAS,OAAO;UAClB;QACF;AACA,cAAM,SAAS;AACf,YAAI,SAAS,UAAU,CAAC,gBAAgB,CAAC,gBAAgB;AACvD,oBAAU,SAAS,eAAe,SAAY,WAAW,WAAW,UAAU,CAAC,MAAM,EAAE,GAAG,eAAe,qBAAqB,EAAE,qBAAqB,WAAW,UAAW,CAAC,IAAI,QAAQ,eAAe,WAAW,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK;QAC3O;MACF;AACA,eAAS,QAAQ,GAAG,QAAQ,OAAO,QAAQ,SAAS;AAClD,YAAI,UAAU;AAAG,qBAAW,CAAC,YAAY,KAAK,KAAK;AAAQ,kBAAM,OAAO,UAAU;AAClF,cAAM,OAAO,KAAK,CAAE;MACtB;AACA,qBAAe;AACf,oBAAc,MAAK;AACnB,aAAO;IACT;;AAEF,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const boundaryId = (id, prefix = "") => prefix + "B:" + id.toString(16);
|
|
2
|
+
const segmentId = (id, prefix = "") => prefix + "S:" + id.toString(16);
|
|
3
|
+
const scriptId = (id) => JSON.stringify(id).replace(/</g, "\\u003c");
|
|
4
|
+
export {
|
|
5
|
+
boundaryId,
|
|
6
|
+
scriptId,
|
|
7
|
+
segmentId
|
|
8
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from '../core/index.js';
|
|
2
|
+
import { type SSRFrame } from './dispatcher.js';
|
|
3
|
+
import { type BrowserBailoutCallback } from './walk.js';
|
|
4
|
+
export interface StreamOptions {
|
|
5
|
+
identifierPrefix?: string;
|
|
6
|
+
nonce?: string | {
|
|
7
|
+
script?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
};
|
|
10
|
+
bootstrapScriptContent?: string | ReadonlyArray<string>;
|
|
11
|
+
bootstrapScripts?: ReadonlyArray<string | {
|
|
12
|
+
src: string;
|
|
13
|
+
async?: boolean;
|
|
14
|
+
nonce?: string;
|
|
15
|
+
}>;
|
|
16
|
+
bootstrapModules?: ReadonlyArray<string | {
|
|
17
|
+
src: string;
|
|
18
|
+
nonce?: string;
|
|
19
|
+
}>;
|
|
20
|
+
onError?: (error: unknown) => string | void;
|
|
21
|
+
onBrowserBailout?: BrowserBailoutCallback;
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
progressiveChunkSize?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ReadableStreamResult extends ReadableStream<Uint8Array> {
|
|
26
|
+
allReady: Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export interface PipeableWritable {
|
|
29
|
+
write(chunk: string): unknown;
|
|
30
|
+
end(): unknown;
|
|
31
|
+
destroy?(error?: unknown): unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface OrchestratorState {
|
|
34
|
+
nextId: number;
|
|
35
|
+
pending: Set<Promise<void>>;
|
|
36
|
+
closed: boolean;
|
|
37
|
+
errored: unknown | null;
|
|
38
|
+
aborted: boolean;
|
|
39
|
+
reason: unknown;
|
|
40
|
+
abort: (reason?: unknown) => void;
|
|
41
|
+
cancelled: Promise<void>;
|
|
42
|
+
onShellReady?: () => void;
|
|
43
|
+
frame?: SSRFrame;
|
|
44
|
+
flowing?: boolean;
|
|
45
|
+
flush?: () => void;
|
|
46
|
+
outlined?: boolean;
|
|
47
|
+
}
|
|
48
|
+
type Emit = (chunk: string) => void;
|
|
49
|
+
export declare function streamHtml(children: ReactNode, emit: Emit, options: StreamOptions, state: OrchestratorState): Promise<void>;
|
|
50
|
+
export declare function renderToReadableStream(children: ReactNode, options?: StreamOptions): Promise<ReadableStreamResult>;
|
|
51
|
+
export interface PipeableHandle {
|
|
52
|
+
pipe<T extends PipeableWritable>(dest: T): T;
|
|
53
|
+
abort(reason?: unknown): void;
|
|
54
|
+
}
|
|
55
|
+
export interface PipeableOptions extends StreamOptions {
|
|
56
|
+
onShellReady?: () => void;
|
|
57
|
+
onShellError?: (err: unknown) => void;
|
|
58
|
+
onAllReady?: () => void;
|
|
59
|
+
}
|
|
60
|
+
export declare function renderToPipeableStream(children: ReactNode, options?: PipeableOptions): PipeableHandle;
|
|
61
|
+
export {};
|