@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,46 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from '../core'
|
|
2
|
+
import { useContext } from './hooks'
|
|
3
|
+
|
|
4
|
+
export const REACT_CONTEXT_TYPE = Symbol.for('react.context')
|
|
5
|
+
export const REACT_PROVIDER_TYPE = Symbol.for('react.provider')
|
|
6
|
+
export const REACT_CONSUMER_TYPE = Symbol.for('react.consumer')
|
|
7
|
+
|
|
8
|
+
export interface Context<T> {
|
|
9
|
+
$$typeof: typeof REACT_CONTEXT_TYPE
|
|
10
|
+
_context: Context<T>
|
|
11
|
+
_currentValue: T
|
|
12
|
+
Provider: ProviderExoticComponent<{ value: T; children?: ReactNode }>
|
|
13
|
+
Consumer: ConsumerExoticComponent<T>
|
|
14
|
+
displayName?: string
|
|
15
|
+
(props: { value: T; children?: ReactNode }): ReactElement
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProviderExoticComponent<P> {
|
|
19
|
+
$$typeof: typeof REACT_CONTEXT_TYPE | typeof REACT_PROVIDER_TYPE
|
|
20
|
+
_context: Context<any>
|
|
21
|
+
(props: P): ReactElement
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ConsumerExoticComponent<T> {
|
|
25
|
+
$$typeof: typeof REACT_CONSUMER_TYPE
|
|
26
|
+
_context: Context<T>
|
|
27
|
+
(props: { children: (value: T) => ReactNode }): ReactElement
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function createContext<T>(defaultValue: T): Context<T> {
|
|
31
|
+
const context: Context<T> = {
|
|
32
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
33
|
+
_currentValue: defaultValue,
|
|
34
|
+
} as Context<T>
|
|
35
|
+
|
|
36
|
+
const Consumer: any = function Consumer(props: { children: (v: T) => any }): any {
|
|
37
|
+
return props.children(useContext(context))
|
|
38
|
+
}
|
|
39
|
+
Consumer.$$typeof = REACT_CONSUMER_TYPE
|
|
40
|
+
Consumer._context = context
|
|
41
|
+
|
|
42
|
+
context.Provider = context._context = context
|
|
43
|
+
context.Consumer = Consumer
|
|
44
|
+
|
|
45
|
+
return context
|
|
46
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REACT_ELEMENT_TYPE,
|
|
3
|
+
REACT_LEGACY_ELEMENT_TYPE,
|
|
4
|
+
REACT_FRAGMENT_TYPE,
|
|
5
|
+
type ReactElement,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
type Ref,
|
|
8
|
+
} from '../core'
|
|
9
|
+
import type { FragmentInstance } from '../dom/fragment-instance'
|
|
10
|
+
import { rememberDevToolsElement } from '../core/devtools'
|
|
11
|
+
|
|
12
|
+
export const Fragment = REACT_FRAGMENT_TYPE as unknown as (props: {
|
|
13
|
+
children?: ReactNode
|
|
14
|
+
key?: string | number
|
|
15
|
+
ref?: Ref<FragmentInstance>
|
|
16
|
+
}) => ReactElement
|
|
17
|
+
|
|
18
|
+
export function createElement(
|
|
19
|
+
type: any,
|
|
20
|
+
config?: Record<string, any> | null,
|
|
21
|
+
...children: ReactNode[]
|
|
22
|
+
): ReactElement {
|
|
23
|
+
let key: string | null = null
|
|
24
|
+
const props: Record<string, any> = {}
|
|
25
|
+
|
|
26
|
+
if (config != null) {
|
|
27
|
+
if (config.key !== undefined && config.key !== null) key = '' + config.key
|
|
28
|
+
for (const k in config) {
|
|
29
|
+
if (k !== 'key' && k !== '__self' && k !== '__source' && Object.prototype.hasOwnProperty.call(config, k)) {
|
|
30
|
+
props[k] = config[k]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (children.length === 1) props.children = children[0]
|
|
36
|
+
else if (children.length > 1) props.children = children
|
|
37
|
+
|
|
38
|
+
if (type && type.defaultProps) {
|
|
39
|
+
const dp = type.defaultProps
|
|
40
|
+
for (const k in dp) {
|
|
41
|
+
if (props[k] === undefined) props[k] = dp[k]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (process.env.NODE_ENV !== 'production') return rememberDevToolsElement({ $$typeof: REACT_ELEMENT_TYPE, type, key, ref: props.ref ?? null, props }, config?.__source)
|
|
46
|
+
return { $$typeof: REACT_ELEMENT_TYPE, type, key, ref: props.ref ?? null, props }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function cloneElement(
|
|
50
|
+
element: ReactElement,
|
|
51
|
+
config?: Record<string, any> | null,
|
|
52
|
+
...children: ReactNode[]
|
|
53
|
+
): ReactElement {
|
|
54
|
+
let key = element.key
|
|
55
|
+
const props = { ...element.props }
|
|
56
|
+
|
|
57
|
+
if (config != null) {
|
|
58
|
+
if (config.key !== undefined) key = '' + config.key
|
|
59
|
+
const defaultProps = element.type?.defaultProps
|
|
60
|
+
for (const k in config) {
|
|
61
|
+
if (k === 'key' || k === '__self' || k === '__source' || !Object.prototype.hasOwnProperty.call(config, k)) continue
|
|
62
|
+
if (k === 'ref' && config.ref === undefined) continue
|
|
63
|
+
props[k] = config[k] === undefined && defaultProps ? defaultProps[k] : config[k]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (children.length === 1) props.children = children[0]
|
|
68
|
+
else if (children.length > 1) props.children = children
|
|
69
|
+
|
|
70
|
+
if (process.env.NODE_ENV !== 'production') return rememberDevToolsElement({ $$typeof: REACT_ELEMENT_TYPE, type: element.type, key, ref: props.ref === undefined ? element.ref : props.ref, props }, config?.__source, config?.ref === undefined ? element : undefined)
|
|
71
|
+
return { $$typeof: REACT_ELEMENT_TYPE, type: element.type, key, ref: props.ref === undefined ? element.ref : props.ref, props }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function isValidElement(obj: any): obj is ReactElement {
|
|
75
|
+
if (typeof obj !== 'object' || obj === null) return false
|
|
76
|
+
const t = obj.$$typeof
|
|
77
|
+
return t === REACT_ELEMENT_TYPE || t === REACT_LEGACY_ELEMENT_TYPE
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function createRef<T = any>() {
|
|
81
|
+
return { current: null as T | null }
|
|
82
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Fiber, FiberRoot } from '../core'
|
|
2
|
+
export type FormStatus = {
|
|
3
|
+
pending: false
|
|
4
|
+
data: null
|
|
5
|
+
method: null
|
|
6
|
+
action: null
|
|
7
|
+
} | {
|
|
8
|
+
pending: true
|
|
9
|
+
data: FormData
|
|
10
|
+
method: string
|
|
11
|
+
action: (data: FormData) => unknown
|
|
12
|
+
}
|
|
13
|
+
export const idleFormStatus: FormStatus = { pending: false, data: null, method: null, action: null }
|
|
14
|
+
export interface FormState {
|
|
15
|
+
s: FormStatus
|
|
16
|
+
l: Set<() => void>
|
|
17
|
+
g: number
|
|
18
|
+
}
|
|
19
|
+
export const formStates = new WeakMap<Fiber, FormState>()
|
|
20
|
+
export function formState(fiber: Fiber): FormState {
|
|
21
|
+
let state = formStates.get(fiber)
|
|
22
|
+
if (!state) { state = { s: idleFormStatus, l: new Set(), g: 0 }; formStates.set(fiber, state) }
|
|
23
|
+
return state
|
|
24
|
+
}
|
|
25
|
+
export function publishForm(state: FormState, status: FormStatus): void {
|
|
26
|
+
state.s = status
|
|
27
|
+
for (const listener of state.l) listener()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const hydratedFormStates = new WeakMap<FiberRoot, { value: unknown; consume: (fiber: Fiber) => boolean }>()
|
|
31
|
+
export function actionInitialState<T>(fiber: Fiber | null, initial: T): T {
|
|
32
|
+
const root = fiber?.r
|
|
33
|
+
const state = root?.h ? hydratedFormStates.get(root) : undefined
|
|
34
|
+
return state && state.consume(fiber!) ? state.value as T : initial
|
|
35
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { isThenable, isFunction } from '../core/functions'
|
|
2
|
+
import type {
|
|
3
|
+
Dispatch,
|
|
4
|
+
SetStateAction,
|
|
5
|
+
EffectCallback,
|
|
6
|
+
DependencyList,
|
|
7
|
+
} from '../core'
|
|
8
|
+
import type { Context } from './context'
|
|
9
|
+
import { getDispatcher, ReactSharedInternals } from './shared-internals'
|
|
10
|
+
|
|
11
|
+
import type { BrowserToken } from '../core/browser'
|
|
12
|
+
|
|
13
|
+
export function useState<S>(initial: S | (() => S)): [S, Dispatch<SetStateAction<S>>]
|
|
14
|
+
export function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>]
|
|
15
|
+
export function useState<S>(initial?: S | (() => S)): [S | undefined, Dispatch<SetStateAction<S | undefined>>] {
|
|
16
|
+
return getDispatcher().useState(initial)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useReducer<S, A>(
|
|
20
|
+
reducer: (s: S, a: A) => S,
|
|
21
|
+
initial: any,
|
|
22
|
+
init?: (a: any) => S,
|
|
23
|
+
): [S, Dispatch<A>] {
|
|
24
|
+
return getDispatcher().useReducer(reducer, initial, init)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function useEffect(create: EffectCallback, deps?: DependencyList): void {
|
|
28
|
+
getDispatcher().useEffect(create, deps)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function useLayoutEffect(create: EffectCallback, deps?: DependencyList): void {
|
|
32
|
+
getDispatcher().useLayoutEffect(create, deps)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function useInsertionEffect(create: EffectCallback, deps?: DependencyList): void {
|
|
36
|
+
getDispatcher().useInsertionEffect(create, deps)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function useRef<T>(initial: T): { current: T }
|
|
40
|
+
export function useRef<T>(initial: T | null): { current: T | null }
|
|
41
|
+
export function useRef<T = undefined>(): { current: T | undefined }
|
|
42
|
+
export function useRef(initial?: any): { current: any } {
|
|
43
|
+
return getDispatcher().useRef(initial)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function useMemo<T>(factory: () => T, deps?: DependencyList): T {
|
|
47
|
+
return getDispatcher().useMemo(factory, deps)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function useCallback<T extends Function>(fn: T, deps?: DependencyList): T {
|
|
51
|
+
return getDispatcher().useCallback(fn, deps)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function useContext<T>(ctx: Context<T>): T {
|
|
55
|
+
return getDispatcher().useContext(ctx)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function useImperativeHandle<T>(
|
|
59
|
+
ref: any,
|
|
60
|
+
factory: () => T,
|
|
61
|
+
deps?: DependencyList,
|
|
62
|
+
): void {
|
|
63
|
+
getDispatcher().useImperativeHandle(ref, factory, deps)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function useDebugValue<T>(value: T, formatter?: (v: T) => any): void {
|
|
67
|
+
getDispatcher().useDebugValue(value, formatter)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function useId(): string {
|
|
71
|
+
return getDispatcher().useId()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function useTransition(): [boolean, (fn: () => void) => void] {
|
|
75
|
+
return getDispatcher().useTransition()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function useDeferredValue<T>(v: T): T {
|
|
79
|
+
return getDispatcher().useDeferredValue(v)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function useSyncExternalStore<T>(
|
|
83
|
+
subscribe: (cb: () => void) => () => void,
|
|
84
|
+
getSnapshot: () => T,
|
|
85
|
+
getServerSnapshot?: () => T,
|
|
86
|
+
): T {
|
|
87
|
+
return getDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function use(resource: BrowserToken): undefined
|
|
91
|
+
export function use<T>(resource: PromiseLike<T> | { _currentValue: T } | { $$typeof: symbol; _currentValue: T }): T
|
|
92
|
+
export function use<T>(resource: BrowserToken | PromiseLike<T> | { _currentValue: T } | { $$typeof: symbol; _currentValue: T }): T {
|
|
93
|
+
return getDispatcher().use(resource)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function unstable_useCacheRefresh(): () => void {
|
|
97
|
+
return getDispatcher().useCacheRefresh()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function transitionScope<T>(fn: () => T): T {
|
|
101
|
+
const previous = ReactSharedInternals.T
|
|
102
|
+
ReactSharedInternals.T = previous || new Set()
|
|
103
|
+
try { return fn() } finally { ReactSharedInternals.T = previous }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function reportActionError(error: unknown): void {
|
|
107
|
+
if (isFunction(globalThis.reportError)) globalThis.reportError(error)
|
|
108
|
+
else setTimeout(() => { throw error })
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function startTransition(fn: () => void): void {
|
|
112
|
+
try {
|
|
113
|
+
const result = transitionScope(() => ReactSharedInternals.X ? ReactSharedInternals.X(fn) : fn())
|
|
114
|
+
if (isThenable(result)) result.then(undefined, reportActionError)
|
|
115
|
+
} catch (error) { reportActionError(error) }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function useActionState<S>(
|
|
119
|
+
action: (state: Awaited<S>) => S | Promise<S>,
|
|
120
|
+
initial: Awaited<S>,
|
|
121
|
+
permalink?: string,
|
|
122
|
+
): [Awaited<S>, () => void, boolean]
|
|
123
|
+
export function useActionState<S, P>(
|
|
124
|
+
action: (state: Awaited<S>, payload: P) => S | Promise<S>,
|
|
125
|
+
initial: Awaited<S>,
|
|
126
|
+
permalink?: string,
|
|
127
|
+
): [Awaited<S>, (payload: P) => void, boolean]
|
|
128
|
+
export function useActionState<S, P>(
|
|
129
|
+
action: (state: Awaited<S>, payload: P) => S | Promise<S>,
|
|
130
|
+
initial: Awaited<S>,
|
|
131
|
+
_permalink?: string,
|
|
132
|
+
): [Awaited<S>, (payload: P) => void, boolean] {
|
|
133
|
+
return getDispatcher().useActionState(action, initial, _permalink)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function useFormStatus() {
|
|
137
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
138
|
+
const debug = (ReactSharedInternals.H as any)?.useHostTransitionStatus
|
|
139
|
+
if (debug) return debug()
|
|
140
|
+
}
|
|
141
|
+
return getDispatcher().useFormStatus()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function useOptimistic<S, A = S>(
|
|
145
|
+
state: S,
|
|
146
|
+
updateFn?: (s: S, a: A) => S,
|
|
147
|
+
): [S, (action: A) => void] {
|
|
148
|
+
return getDispatcher().useOptimistic(state, updateFn)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Composed hook — returns a stable callback that always invokes the latest
|
|
152
|
+
// `fn`. The ref is updated in useInsertionEffect so any useLayoutEffect /
|
|
153
|
+
// useEffect reading ref.current in the next commit sees the fresh function.
|
|
154
|
+
export function useEffectEvent<Args extends unknown[], Return>(
|
|
155
|
+
fn: (...args: Args) => Return,
|
|
156
|
+
): (...args: Args) => Return {
|
|
157
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
158
|
+
const debug = (ReactSharedInternals.H as any)?.useEffectEvent
|
|
159
|
+
if (debug) return debug(fn)
|
|
160
|
+
}
|
|
161
|
+
const ref = useRef(fn)
|
|
162
|
+
useInsertionEffect(() => {
|
|
163
|
+
ref.current = fn
|
|
164
|
+
})
|
|
165
|
+
return useCallback(
|
|
166
|
+
((...args: Args) => ref.current(...args)) as (...args: Args) => Return,
|
|
167
|
+
[],
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// `useSyncExternalStoreWithSelector` — provided here so consumers (like
|
|
172
|
+
// @tanstack/react-store) that historically import from
|
|
173
|
+
// `use-sync-external-store/shim/with-selector` can be aliased to this
|
|
174
|
+
// package via the @tanstack/redact/vite plugin. The CJS shim is unsuitable
|
|
175
|
+
// for Cloudflare Workers (it does `var React = require('react')` which
|
|
176
|
+
// fails in workerd). Implementation matches React's reference impl —
|
|
177
|
+
// selector + isEqual gate to avoid re-renders when the selected slice is
|
|
178
|
+
// unchanged across snapshots.
|
|
179
|
+
export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
|
|
180
|
+
subscribe: (cb: () => void) => () => void,
|
|
181
|
+
getSnapshot: () => Snapshot,
|
|
182
|
+
getServerSnapshot: (() => Snapshot) | undefined,
|
|
183
|
+
selector: (snapshot: Snapshot) => Selection,
|
|
184
|
+
isEqual?: (a: Selection, b: Selection) => boolean,
|
|
185
|
+
): Selection {
|
|
186
|
+
const committed = useRef<{ value: Selection } | null>(null)
|
|
187
|
+
const [getSelection, getServerSelection] = useMemo(() => {
|
|
188
|
+
let ready = false
|
|
189
|
+
let snapshot: Snapshot
|
|
190
|
+
let selection: Selection
|
|
191
|
+
const select = (next: Snapshot): Selection => {
|
|
192
|
+
if (ready && Object.is(snapshot, next)) return selection
|
|
193
|
+
let value = selector(next)
|
|
194
|
+
if ((ready || committed.current) && isEqual?.(ready ? selection : committed.current!.value, value)) {
|
|
195
|
+
value = ready ? selection : committed.current!.value
|
|
196
|
+
}
|
|
197
|
+
ready = true
|
|
198
|
+
snapshot = next
|
|
199
|
+
return selection = value
|
|
200
|
+
}
|
|
201
|
+
return [
|
|
202
|
+
() => select(getSnapshot()),
|
|
203
|
+
getServerSnapshot && (() => select(getServerSnapshot())),
|
|
204
|
+
] as const
|
|
205
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual])
|
|
206
|
+
|
|
207
|
+
const value = useSyncExternalStore(subscribe, getSelection, getServerSelection)
|
|
208
|
+
useDebugValue(value)
|
|
209
|
+
useLayoutEffect(() => {
|
|
210
|
+
if (committed.current) committed.current.value = value
|
|
211
|
+
else committed.current = { value }
|
|
212
|
+
}, [value])
|
|
213
|
+
return value
|
|
214
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useState, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useRef, useMemo, useCallback, useContext, useImperativeHandle, useDebugValue, useId, useTransition, useDeferredValue, useSyncExternalStore, useSyncExternalStoreWithSelector, use, useActionState, useFormStatus, useOptimistic, useEffectEvent, startTransition, unstable_useCacheRefresh, } from './hooks';
|
|
2
|
+
export type { FragmentInstance } from '../dom/fragment-instance';
|
|
3
|
+
export { Children } from './children';
|
|
4
|
+
import { Suspense, StrictMode, Profiler } from './suspense';
|
|
5
|
+
export { Suspense, StrictMode, Profiler, REACT_SUSPENSE_TYPE, REACT_STRICT_MODE_TYPE, REACT_PROFILER_TYPE, } from './suspense';
|
|
6
|
+
export { createElement, cloneElement, isValidElement, createRef, Fragment } from './element';
|
|
7
|
+
import { act } from './act';
|
|
8
|
+
import { captureOwnerStack } from '../core/devtools';
|
|
9
|
+
export { captureOwnerStack } from '../core/devtools';
|
|
10
|
+
export type { ViewTransitionProps, ViewTransitionClass, ViewTransitionInstance, ViewTransitionPseudoElement } from './view-transition';
|
|
11
|
+
export { Component, PureComponent } from './class';
|
|
12
|
+
export { useState, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useRef, useMemo, useCallback, useContext, useImperativeHandle, useDebugValue, useId, useTransition, useDeferredValue, useSyncExternalStore, useSyncExternalStoreWithSelector, use, useActionState, useFormStatus, useOptimistic, useEffectEvent, startTransition, unstable_useCacheRefresh, } from './hooks';
|
|
13
|
+
export type { ActivityProps } from './activity';
|
|
14
|
+
import { Children } from './children';
|
|
15
|
+
import { ViewTransition, addTransitionType } from './view-transition';
|
|
16
|
+
export { createContext, REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE, type Context, type ProviderExoticComponent, type ConsumerExoticComponent, } from './context';
|
|
17
|
+
export { memo, forwardRef, lazy, REACT_MEMO_TYPE, REACT_FORWARD_REF_TYPE, REACT_LAZY_TYPE, } from './memo';
|
|
18
|
+
import { Activity } from './activity';
|
|
19
|
+
export { ReactSharedInternals } from './shared-internals';
|
|
20
|
+
export { ViewTransition, addTransitionType, REACT_VIEW_TRANSITION_TYPE } from './view-transition';
|
|
21
|
+
export type { ReactElement, ReactNode, Key, Ref, RefObject, RefCallback, Dispatch, SetStateAction, EffectCallback, DependencyList, } from '../core';
|
|
22
|
+
import { createContext } from './context';
|
|
23
|
+
import { Component, PureComponent } from './class';
|
|
24
|
+
export { Activity, REACT_ACTIVITY_TYPE } from './activity';
|
|
25
|
+
import { memo, forwardRef, lazy } from './memo';
|
|
26
|
+
export { REACT_PORTAL_TYPE } from './portal';
|
|
27
|
+
import { createElement, cloneElement, isValidElement, createRef, Fragment } from './element';
|
|
28
|
+
// Lightweight functional-component alias — matches React's FC shape closely
|
|
29
|
+
// enough for the common `const X: FC<P> = (props) => …` pattern used in
|
|
30
|
+
// tests and downstream consumer code.
|
|
31
|
+
export type FC<P = {}> = (props: P & {
|
|
32
|
+
children?: import('../core').ReactNode;
|
|
33
|
+
}) => import('../core').ReactElement | null;
|
|
34
|
+
// Stub exports
|
|
35
|
+
export const cache = <T extends Function>(fn: T): T => fn;
|
|
36
|
+
// The client/DOM-server entry has no RSC cache lifetime, matching React's
|
|
37
|
+
// client export. The upstream Flight renderer remains responsible for RSC.
|
|
38
|
+
export const cacheSignal = (): AbortSignal | null => null;
|
|
39
|
+
export { act };
|
|
40
|
+
export function taintUniqueValue(_msg: string, _lifetime: any, _value: any): void { }
|
|
41
|
+
export function taintObjectReference(_msg: string, _object: any): void { }
|
|
42
|
+
export const version = '19.2.3';
|
|
43
|
+
// Default export for `import React from 'react'` usage
|
|
44
|
+
export default {
|
|
45
|
+
createElement,
|
|
46
|
+
cloneElement,
|
|
47
|
+
isValidElement,
|
|
48
|
+
createRef,
|
|
49
|
+
Fragment,
|
|
50
|
+
useState,
|
|
51
|
+
useReducer,
|
|
52
|
+
useEffect,
|
|
53
|
+
useLayoutEffect,
|
|
54
|
+
useInsertionEffect,
|
|
55
|
+
useRef,
|
|
56
|
+
useMemo,
|
|
57
|
+
useCallback,
|
|
58
|
+
useContext,
|
|
59
|
+
useImperativeHandle,
|
|
60
|
+
useDebugValue,
|
|
61
|
+
useId,
|
|
62
|
+
useTransition,
|
|
63
|
+
useDeferredValue,
|
|
64
|
+
useSyncExternalStore,
|
|
65
|
+
useSyncExternalStoreWithSelector,
|
|
66
|
+
use,
|
|
67
|
+
useActionState,
|
|
68
|
+
useFormStatus,
|
|
69
|
+
useOptimistic,
|
|
70
|
+
useEffectEvent,
|
|
71
|
+
startTransition,
|
|
72
|
+
unstable_useCacheRefresh,
|
|
73
|
+
createContext,
|
|
74
|
+
Component,
|
|
75
|
+
PureComponent,
|
|
76
|
+
memo,
|
|
77
|
+
forwardRef,
|
|
78
|
+
lazy,
|
|
79
|
+
Suspense,
|
|
80
|
+
StrictMode,
|
|
81
|
+
Profiler,
|
|
82
|
+
Children,
|
|
83
|
+
ViewTransition,
|
|
84
|
+
Activity,
|
|
85
|
+
addTransitionType,
|
|
86
|
+
cache,
|
|
87
|
+
cacheSignal,
|
|
88
|
+
...(process.env.NODE_ENV !== 'production' ? { captureOwnerStack } : {}),
|
|
89
|
+
act,
|
|
90
|
+
version: '19.2.3',
|
|
91
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { REACT_ELEMENT_TYPE, type Key, type ReactElement, type Ref } from '../core'
|
|
2
|
+
import { rememberDevToolsElement } from '../core/devtools'
|
|
3
|
+
|
|
4
|
+
export { Fragment } from './element'
|
|
5
|
+
|
|
6
|
+
export function jsx(type: any, props: any, key?: any): ReactElement {
|
|
7
|
+
if (process.env.NODE_ENV !== 'production') return rememberDevToolsElement({
|
|
8
|
+
$$typeof: REACT_ELEMENT_TYPE, type, key: key == null ? null : '' + key,
|
|
9
|
+
ref: props?.ref ?? null, props,
|
|
10
|
+
})
|
|
11
|
+
return {
|
|
12
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
13
|
+
type,
|
|
14
|
+
key: key == null ? null : '' + key,
|
|
15
|
+
ref: props?.ref ?? null,
|
|
16
|
+
props,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const jsxs = jsx
|
|
21
|
+
export const jsxDEV = process.env.NODE_ENV !== 'production'
|
|
22
|
+
? (type: any, props: any, key?: any, _staticChildren?: boolean, source?: any) => {
|
|
23
|
+
return rememberDevToolsElement({
|
|
24
|
+
$$typeof: REACT_ELEMENT_TYPE, type, key: key == null ? null : '' + key,
|
|
25
|
+
ref: props?.ref ?? null, props,
|
|
26
|
+
}, source)
|
|
27
|
+
}
|
|
28
|
+
: jsx
|
|
29
|
+
|
|
30
|
+
// Permissive JSX namespace — picked up by TypeScript via the
|
|
31
|
+
// `jsxImportSource: "@tanstack/redact"` + `jsx: "react-jsx"` pair. The
|
|
32
|
+
// runtime accepts any element type and any props; matching that with strict
|
|
33
|
+
// element typings would require an entire React.dom.d.ts surface, which
|
|
34
|
+
// isn't a stated goal of redact (consumers who want strict JSX still alias
|
|
35
|
+
// `react`/`react-dom` types from the real packages).
|
|
36
|
+
export namespace JSX {
|
|
37
|
+
export type Element = ReactElement
|
|
38
|
+
export type ElementType = any
|
|
39
|
+
export interface IntrinsicAttributes { key?: Key }
|
|
40
|
+
export interface IntrinsicClassAttributes<T> { ref?: Ref<T> | undefined }
|
|
41
|
+
export interface IntrinsicElements {
|
|
42
|
+
[elemName: string]: any
|
|
43
|
+
}
|
|
44
|
+
export interface ElementChildrenAttribute {
|
|
45
|
+
children: {}
|
|
46
|
+
}
|
|
47
|
+
export interface ElementAttributesProperty {
|
|
48
|
+
props: {}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readThenable } from './thenable'
|
|
2
|
+
import type { ReactElement, ReactNode, Ref } from '../core'
|
|
3
|
+
|
|
4
|
+
export const REACT_MEMO_TYPE = Symbol.for('react.memo')
|
|
5
|
+
export const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
|
|
6
|
+
export const REACT_LAZY_TYPE = Symbol.for('react.lazy')
|
|
7
|
+
|
|
8
|
+
// Component-shaped return type so JSX usage of memo/forwardRef/lazy results
|
|
9
|
+
// type-checks. The runtime value is a `$$typeof`-tagged record that the
|
|
10
|
+
// reconciler recognizes via type-matchers; the cast lets TypeScript treat
|
|
11
|
+
// it as a callable component at JSX sites without changing what the runtime
|
|
12
|
+
// actually does. `children` is included for the common
|
|
13
|
+
// `<Comp>...</Comp>` form even when the inner P doesn't list it.
|
|
14
|
+
export type ExoticComponent<P> = ((
|
|
15
|
+
props: P & { children?: ReactNode; ref?: any; key?: any },
|
|
16
|
+
) => ReactElement | null) & {
|
|
17
|
+
readonly $$typeof: symbol
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function memo<P>(
|
|
21
|
+
type: (props: P) => any,
|
|
22
|
+
areEqual?: (prev: Readonly<P>, next: Readonly<P>) => boolean,
|
|
23
|
+
): ExoticComponent<P> {
|
|
24
|
+
return { $$typeof: REACT_MEMO_TYPE, type, compare: areEqual ?? null } as unknown as ExoticComponent<P>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function forwardRef<R, P = {}>(
|
|
28
|
+
render: (props: P, ref: { current: R | null } | ((r: R | null) => void) | null) => any,
|
|
29
|
+
): ExoticComponent<P & { ref?: Ref<R> }> {
|
|
30
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render } as unknown as ExoticComponent<P & { ref?: Ref<R> }>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function lazy<T extends { default: any }>(ctor: () => Promise<T>): ExoticComponent<
|
|
34
|
+
T['default'] extends (props: infer P) => any ? P : {}
|
|
35
|
+
> {
|
|
36
|
+
const payload: { p?: Promise<T> } = {}
|
|
37
|
+
return {
|
|
38
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
39
|
+
_payload: payload,
|
|
40
|
+
_init: (p: typeof payload): any => readThenable(p.p ||= ctor(), p).default,
|
|
41
|
+
} as unknown as ExoticComponent<T['default'] extends (props: infer P) => any ? P : {}>
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const REACT_PORTAL_TYPE = Symbol.for('react.portal')
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Fiber } from '../core'
|
|
2
|
+
|
|
3
|
+
export interface Dispatcher {
|
|
4
|
+
useState<S>(initial: S | (() => S)): [S, (s: S | ((p: S) => S)) => void]
|
|
5
|
+
useReducer<S, A>(
|
|
6
|
+
reducer: (s: S, a: A) => S,
|
|
7
|
+
initial: S | any,
|
|
8
|
+
init?: (a: any) => S,
|
|
9
|
+
): [S, (a: A) => void]
|
|
10
|
+
useEffect(create: () => any, deps?: ReadonlyArray<unknown>): void
|
|
11
|
+
useLayoutEffect(create: () => any, deps?: ReadonlyArray<unknown>): void
|
|
12
|
+
useInsertionEffect(create: () => any, deps?: ReadonlyArray<unknown>): void
|
|
13
|
+
useRef<T>(initial: T): { current: T }
|
|
14
|
+
useMemo<T>(factory: () => T, deps?: ReadonlyArray<unknown>): T
|
|
15
|
+
useCallback<T extends Function>(fn: T, deps?: ReadonlyArray<unknown>): T
|
|
16
|
+
useContext<T>(ctx: any): T
|
|
17
|
+
useImperativeHandle<T>(ref: any, factory: () => T, deps?: ReadonlyArray<unknown>): void
|
|
18
|
+
useDebugValue<T>(value: T, formatter?: (v: T) => any): void
|
|
19
|
+
useId(): string
|
|
20
|
+
useTransition(): [boolean, (fn: () => void) => void]
|
|
21
|
+
useActionState<S, P>(action: (state: Awaited<S>, payload: P) => S | Promise<S>, initial: Awaited<S>, permalink?: string): [Awaited<S>, (payload: P) => void, boolean]
|
|
22
|
+
useOptimistic<S, A = S>(state: S, updateFn?: (state: S, action: A) => S): [S, (action: A) => void]
|
|
23
|
+
useFormStatus(): import('./form-state').FormStatus
|
|
24
|
+
useDeferredValue<T>(v: T): T
|
|
25
|
+
useSyncExternalStore<T>(
|
|
26
|
+
subscribe: (cb: () => void) => () => void,
|
|
27
|
+
getSnapshot: () => T,
|
|
28
|
+
getServerSnapshot?: () => T,
|
|
29
|
+
): T
|
|
30
|
+
use<T>(promiseOrContext: any): T
|
|
31
|
+
useCacheRefresh(): () => void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface SharedInternals {
|
|
35
|
+
B?: import('./action-scope').ActionScope | null | undefined // Shared across renderer copies.
|
|
36
|
+
A?: Array<() => void> | null
|
|
37
|
+
|
|
38
|
+
H: Dispatcher | null
|
|
39
|
+
F: Fiber | null
|
|
40
|
+
I: number
|
|
41
|
+
T?: Set<string> | null | undefined
|
|
42
|
+
X?: (action: () => unknown) => PromiseLike<unknown> | void
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Stash the singleton on `globalThis` under a registered symbol. Module-scoped
|
|
46
|
+
// state goes wrong fast in environments that end up with multiple copies of
|
|
47
|
+
// `@tanstack/redact` in flight — most notably Cloudflare's `vite-plugin` dev
|
|
48
|
+
// mode, where the worker entry inlines `@tanstack/redact` once via `noExternal`
|
|
49
|
+
// while user code reaches a separate pre-bundled `deps_ssr/redact.js` copy.
|
|
50
|
+
// Each copy would otherwise have its own `ReactSharedInternals.H`, so the SSR
|
|
51
|
+
// dispatcher installed by one would be invisible to hooks called through the
|
|
52
|
+
// other and `useContext` would explode with "Hooks can only be called inside a
|
|
53
|
+
// function component". `Symbol.for` survives module re-evaluation and isolate
|
|
54
|
+
// boundaries, giving every copy the same backing object.
|
|
55
|
+
const KEY = Symbol.for('@tanstack/redact.ReactSharedInternals')
|
|
56
|
+
const g = globalThis as unknown as { [k: symbol]: SharedInternals | undefined }
|
|
57
|
+
|
|
58
|
+
export const ReactSharedInternals: SharedInternals =
|
|
59
|
+
g[KEY] ??
|
|
60
|
+
(g[KEY] = {
|
|
61
|
+
H: null,
|
|
62
|
+
F: null,
|
|
63
|
+
I: 0,
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
export function getDispatcher(): Dispatcher {
|
|
67
|
+
const d = ReactSharedInternals.H
|
|
68
|
+
if (!d) {
|
|
69
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
throw new Error(
|
|
71
|
+
'Hooks can only be called inside a function component. ' +
|
|
72
|
+
'If this fires during SSR/RSC, the most common cause is a component that uses client-only hooks ' +
|
|
73
|
+
'(useState, useContext, useRouter, etc.) being rendered in the RSC server environment without a ' +
|
|
74
|
+
'"use client" directive at the top of its file.',
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
throw new Error()
|
|
78
|
+
}
|
|
79
|
+
return d
|
|
80
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense')
|
|
2
|
+
export const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode')
|
|
3
|
+
export const REACT_PROFILER_TYPE = Symbol.for('react.profiler')
|
|
4
|
+
|
|
5
|
+
export const Suspense = REACT_SUSPENSE_TYPE as any as (props: {
|
|
6
|
+
children?: any
|
|
7
|
+
fallback?: any
|
|
8
|
+
}) => any
|
|
9
|
+
|
|
10
|
+
export const StrictMode = REACT_STRICT_MODE_TYPE as any as (props: {
|
|
11
|
+
children?: any
|
|
12
|
+
}) => any
|
|
13
|
+
|
|
14
|
+
export const Profiler = REACT_PROFILER_TYPE as any as (props: {
|
|
15
|
+
id: string
|
|
16
|
+
onRender?: any
|
|
17
|
+
children?: any
|
|
18
|
+
}) => any
|