@bleedingdev/tanstack-redact 0.0.0-bootstrap → 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 +1 -1
- 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 +113 -8
- 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,74 @@
|
|
|
1
|
+
import MagicString from "magic-string";
|
|
2
|
+
const editsPerModule = {
|
|
3
|
+
"core/types": 1,
|
|
4
|
+
"react/context": 2,
|
|
5
|
+
"react/index": 2,
|
|
6
|
+
"dom/index": 2,
|
|
7
|
+
"dom/features/context/full": 1,
|
|
8
|
+
"dom/features/context/stub": 1,
|
|
9
|
+
"server/walk": 1
|
|
10
|
+
};
|
|
11
|
+
function adaptReact18(code, id, module, version, parse) {
|
|
12
|
+
const expected = editsPerModule[module];
|
|
13
|
+
if (!expected)
|
|
14
|
+
return null;
|
|
15
|
+
const output = new MagicString(code);
|
|
16
|
+
let edits = 0;
|
|
17
|
+
function visit(node) {
|
|
18
|
+
if (!node || typeof node !== "object")
|
|
19
|
+
return;
|
|
20
|
+
let replacement;
|
|
21
|
+
if (node.type === "Literal") {
|
|
22
|
+
if (module === "core/types" && node.value === "react.transitional.element")
|
|
23
|
+
replacement = JSON.stringify("react.element");
|
|
24
|
+
}
|
|
25
|
+
if ((module === "react/index" || module === "dom/index") && (node.type === "VariableDeclarator" && node.id?.name === "version" || node.type === "Property" && node.key?.name === "version")) {
|
|
26
|
+
const value = node.init ?? node.value;
|
|
27
|
+
if (value?.type === "Literal" && typeof value.value === "string") {
|
|
28
|
+
output.overwrite(value.start, value.end, JSON.stringify(version));
|
|
29
|
+
edits++;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (module === "react/context" && node.type === "CallExpression" && node.callee?.object?.name === "Symbol" && node.callee?.property?.name === "for" && node.arguments?.[0]?.value === "react.consumer")
|
|
34
|
+
replacement = "REACT_CONTEXT_TYPE";
|
|
35
|
+
if (module === "react/context" && node.type === "FunctionDeclaration" && node.id?.name === "createContext") {
|
|
36
|
+
if (node.params?.[0]?.name !== "defaultValue")
|
|
37
|
+
throw new Error("React 18 adaptation failed: createContext signature changed");
|
|
38
|
+
output.overwrite(node.body.start, node.body.end, `{
|
|
39
|
+
const context = { $$typeof: REACT_CONTEXT_TYPE, _currentValue: defaultValue };
|
|
40
|
+
context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context };
|
|
41
|
+
context.Consumer = context._context = context;
|
|
42
|
+
return context;
|
|
43
|
+
}`);
|
|
44
|
+
edits++;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if ((module.startsWith("dom/features/context/") || module === "server/walk") && node.type === "BinaryExpression" && node.operator === "===" && node.left?.name === "marker" && node.right?.name === "REACT_CONTEXT_TYPE") {
|
|
48
|
+
replacement = "false";
|
|
49
|
+
}
|
|
50
|
+
if (replacement !== void 0) {
|
|
51
|
+
for (const annotation of node._rollupAnnotations ?? []) {
|
|
52
|
+
if (annotation.type === "pure")
|
|
53
|
+
output.remove(annotation.start, annotation.end);
|
|
54
|
+
}
|
|
55
|
+
output.overwrite(node.start, node.end, replacement);
|
|
56
|
+
edits++;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (const value of Object.values(node)) {
|
|
60
|
+
if (Array.isArray(value))
|
|
61
|
+
value.forEach(visit);
|
|
62
|
+
else if (value && typeof value === "object")
|
|
63
|
+
visit(value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
visit(parse(code));
|
|
67
|
+
if (edits !== expected)
|
|
68
|
+
throw new Error(`React 18 adaptation failed for ${module}: expected ${expected} protocol edits, found ${edits}`);
|
|
69
|
+
return { code: output.toString(), map: output.generateMap({ source: id, includeContent: true, hires: true }) };
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
adaptReact18
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=react18.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/vite/react18.ts"],
|
|
4
|
+
"sourcesContent": ["import MagicString from 'magic-string'\n\n// Only these owned modules differ between React's public element protocols.\n// Run after Vite's TypeScript transform, before bundling and minification.\nconst editsPerModule: Record<string, number> = {\n 'core/types': 1,\n 'react/context': 2,\n 'react/index': 2,\n 'dom/index': 2,\n 'dom/features/context/full': 1,\n 'dom/features/context/stub': 1,\n 'server/walk': 1,\n}\n\nexport function adaptReact18(code: string, id: string, module: string, version: string, parse: (code: string) => any) {\n const expected = editsPerModule[module]\n if (!expected) return null\n const output = new MagicString(code)\n let edits = 0\n function visit(node: any): void {\n if (!node || typeof node !== 'object') return\n let replacement: string | undefined\n if (node.type === 'Literal') {\n if (module === 'core/types' && node.value === 'react.transitional.element') replacement = JSON.stringify('react.element')\n }\n if ((module === 'react/index' || module === 'dom/index')\n && ((node.type === 'VariableDeclarator' && node.id?.name === 'version')\n || (node.type === 'Property' && node.key?.name === 'version'))) {\n const value = node.init ?? node.value\n if (value?.type === 'Literal' && typeof value.value === 'string') {\n output.overwrite(value.start, value.end, JSON.stringify(version))\n edits++\n return\n }\n }\n if (module === 'react/context' && node.type === 'CallExpression'\n && node.callee?.object?.name === 'Symbol' && node.callee?.property?.name === 'for'\n && node.arguments?.[0]?.value === 'react.consumer') replacement = 'REACT_CONTEXT_TYPE'\n if (module === 'react/context' && node.type === 'FunctionDeclaration' && node.id?.name === 'createContext') {\n if (node.params?.[0]?.name !== 'defaultValue') throw new Error('React 18 adaptation failed: createContext signature changed')\n // React 18 consumers are context objects, not callable components.\n output.overwrite(node.body.start, node.body.end, `{\n const context = { $$typeof: REACT_CONTEXT_TYPE, _currentValue: defaultValue };\n context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context };\n context.Consumer = context._context = context;\n return context;\n }`)\n edits++\n return\n }\n // React 18 uses react.context for consumers, not providers.\n if ((module.startsWith('dom/features/context/') || module === 'server/walk')\n && node.type === 'BinaryExpression' && node.operator === '==='\n && node.left?.name === 'marker' && node.right?.name === 'REACT_CONTEXT_TYPE') {\n replacement = 'false'\n }\n if (replacement !== undefined) {\n // A pure-call annotation no longer applies when a call becomes a symbol.\n for (const annotation of node._rollupAnnotations ?? []) {\n if (annotation.type === 'pure') output.remove(annotation.start, annotation.end)\n }\n output.overwrite(node.start, node.end, replacement)\n edits++\n return\n }\n for (const value of Object.values(node)) {\n if (Array.isArray(value)) value.forEach(visit)\n else if (value && typeof value === 'object') visit(value)\n }\n }\n visit(parse(code))\n if (edits !== expected) throw new Error(`React 18 adaptation failed for ${module}: expected ${expected} protocol edits, found ${edits}`)\n return { code: output.toString(), map: output.generateMap({ source: id, includeContent: true, hires: true }) }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,iBAAiB;AAIxB,MAAM,iBAAyC;EAC7C,cAAc;EACd,iBAAiB;EACjB,eAAe;EACf,aAAa;EACb,6BAA6B;EAC7B,6BAA6B;EAC7B,eAAe;;AAGX,SAAU,aAAa,MAAc,IAAY,QAAgB,SAAiB,OAA4B;AAClH,QAAM,WAAW,eAAe,MAAM;AACtC,MAAI,CAAC;AAAU,WAAO;AACtB,QAAM,SAAS,IAAI,YAAY,IAAI;AACnC,MAAI,QAAQ;AACZ,WAAS,MAAM,MAAS;AACtB,QAAI,CAAC,QAAQ,OAAO,SAAS;AAAU;AACvC,QAAI;AACJ,QAAI,KAAK,SAAS,WAAW;AAC3B,UAAI,WAAW,gBAAgB,KAAK,UAAU;AAA8B,sBAAc,KAAK,UAAU,eAAe;IAC1H;AACA,SAAK,WAAW,iBAAiB,WAAW,iBACrC,KAAK,SAAS,wBAAwB,KAAK,IAAI,SAAS,aACvD,KAAK,SAAS,cAAc,KAAK,KAAK,SAAS,YAAa;AAClE,YAAM,QAAQ,KAAK,QAAQ,KAAK;AAChC,UAAI,OAAO,SAAS,aAAa,OAAO,MAAM,UAAU,UAAU;AAChE,eAAO,UAAU,MAAM,OAAO,MAAM,KAAK,KAAK,UAAU,OAAO,CAAC;AAChE;AACA;MACF;IACF;AACA,QAAI,WAAW,mBAAmB,KAAK,SAAS,oBAC3C,KAAK,QAAQ,QAAQ,SAAS,YAAY,KAAK,QAAQ,UAAU,SAAS,SAC1E,KAAK,YAAY,CAAC,GAAG,UAAU;AAAkB,oBAAc;AACpE,QAAI,WAAW,mBAAmB,KAAK,SAAS,yBAAyB,KAAK,IAAI,SAAS,iBAAiB;AAC1G,UAAI,KAAK,SAAS,CAAC,GAAG,SAAS;AAAgB,cAAM,IAAI,MAAM,6DAA6D;AAE5H,aAAO,UAAU,KAAK,KAAK,OAAO,KAAK,KAAK,KAAK;;;;;QAK/C;AACF;AACA;IACF;AAEA,SAAK,OAAO,WAAW,uBAAuB,KAAK,WAAW,kBACzD,KAAK,SAAS,sBAAsB,KAAK,aAAa,SACtD,KAAK,MAAM,SAAS,YAAY,KAAK,OAAO,SAAS,sBAAsB;AAC9E,oBAAc;IAChB;AACA,QAAI,gBAAgB,QAAW;AAE7B,iBAAW,cAAc,KAAK,sBAAsB,CAAA,GAAI;AACtD,YAAI,WAAW,SAAS;AAAQ,iBAAO,OAAO,WAAW,OAAO,WAAW,GAAG;MAChF;AACA,aAAO,UAAU,KAAK,OAAO,KAAK,KAAK,WAAW;AAClD;AACA;IACF;AACA,eAAW,SAAS,OAAO,OAAO,IAAI,GAAG;AACvC,UAAI,MAAM,QAAQ,KAAK;AAAG,cAAM,QAAQ,KAAK;eACpC,SAAS,OAAO,UAAU;AAAU,cAAM,KAAK;IAC1D;EACF;AACA,QAAM,MAAM,IAAI,CAAC;AACjB,MAAI,UAAU;AAAU,UAAM,IAAI,MAAM,kCAAkC,MAAM,cAAc,QAAQ,0BAA0B,KAAK,EAAE;AACvI,SAAO,EAAE,MAAM,OAAO,SAAQ,GAAI,KAAK,OAAO,YAAY,EAAE,QAAQ,IAAI,gBAAgB,MAAM,OAAO,KAAI,CAAE,EAAC;AAC9G;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,123 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bleedingdev/tanstack-redact",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "An alternative runtime for React apps, with a smaller footprint and synchronous rendering.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/react/index.js",
|
|
7
|
+
"module": "./dist/react/index.js",
|
|
8
|
+
"types": "./dist/react/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/react/index.d.ts",
|
|
12
|
+
"default": "./dist/react/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./jsx-runtime": {
|
|
15
|
+
"types": "./dist/react/jsx-runtime.d.ts",
|
|
16
|
+
"default": "./dist/react/jsx-runtime.js"
|
|
17
|
+
},
|
|
18
|
+
"./jsx-dev-runtime": {
|
|
19
|
+
"types": "./dist/react/jsx-runtime.d.ts",
|
|
20
|
+
"default": "./dist/react/jsx-runtime.js"
|
|
21
|
+
},
|
|
22
|
+
"./compiler-runtime": {
|
|
23
|
+
"types": "./dist/react/compiler-runtime.d.ts",
|
|
24
|
+
"default": "./dist/react/compiler-runtime.js"
|
|
25
|
+
},
|
|
26
|
+
"./dom": {
|
|
27
|
+
"types": "./dist/dom/index.d.ts",
|
|
28
|
+
"default": "./dist/dom/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./dom-client": {
|
|
31
|
+
"types": "./dist/dom/client.d.ts",
|
|
32
|
+
"default": "./dist/dom/client.js"
|
|
33
|
+
},
|
|
34
|
+
"./dom-test-utils": {
|
|
35
|
+
"types": "./dist/dom/test-utils.d.ts",
|
|
36
|
+
"default": "./dist/dom/test-utils.js"
|
|
37
|
+
},
|
|
38
|
+
"./server": {
|
|
39
|
+
"types": "./dist/server/index.d.ts",
|
|
40
|
+
"default": "./dist/server/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./scheduler": {
|
|
43
|
+
"types": "./dist/scheduler/index.d.ts",
|
|
44
|
+
"default": "./dist/scheduler/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./vite": {
|
|
47
|
+
"types": "./dist/vite/index.d.ts",
|
|
48
|
+
"default": "./dist/vite/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./features/*": {
|
|
51
|
+
"types": "./dist/dom/features/*.d.ts",
|
|
52
|
+
"default": "./dist/dom/features/*.js"
|
|
53
|
+
},
|
|
54
|
+
"./_all": {
|
|
55
|
+
"types": "./dist/dom/_all.d.ts",
|
|
56
|
+
"default": "./dist/dom/_all.js"
|
|
57
|
+
},
|
|
58
|
+
"./next": {
|
|
59
|
+
"types": "./dist/next/index.d.ts",
|
|
60
|
+
"default": "./dist/next/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./vinext": {
|
|
63
|
+
"types": "./dist/vinext/index.d.ts",
|
|
64
|
+
"default": "./dist/vinext/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./cloudflare": {
|
|
67
|
+
"types": "./dist/cloudflare/index.d.ts",
|
|
68
|
+
"default": "./dist/cloudflare/index.js"
|
|
69
|
+
}
|
|
9
70
|
},
|
|
10
71
|
"files": [
|
|
11
|
-
"
|
|
72
|
+
"dist",
|
|
73
|
+
"src",
|
|
74
|
+
"vendor",
|
|
12
75
|
"LICENSE"
|
|
13
76
|
],
|
|
77
|
+
"sideEffects": [
|
|
78
|
+
"./src/dom/features/**",
|
|
79
|
+
"./dist/dom/features/**",
|
|
80
|
+
"./src/dom/index.ts",
|
|
81
|
+
"./src/dom/client.ts",
|
|
82
|
+
"./src/dom/_all.ts",
|
|
83
|
+
"./dist/dom/index.js",
|
|
84
|
+
"./dist/dom/client.js",
|
|
85
|
+
"./dist/dom/_all.js"
|
|
86
|
+
],
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"magic-string": "^0.30.21"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"next": "~15.5.0 || ~16.0.0 || ~16.1.0 || ~16.2.0 || ~16.3.0 || ~16.4.0",
|
|
92
|
+
"vite": ">=5",
|
|
93
|
+
"vinext": "~1.3.0",
|
|
94
|
+
"@cloudflare/vite-plugin": "1.65.0"
|
|
95
|
+
},
|
|
96
|
+
"peerDependenciesMeta": {
|
|
97
|
+
"next": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"vite": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"vinext": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"@cloudflare/vite-plugin": {
|
|
107
|
+
"optional": true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
14
110
|
"publishConfig": {
|
|
111
|
+
"registry": "https://registry.npmjs.org/",
|
|
15
112
|
"access": "public"
|
|
16
113
|
},
|
|
17
|
-
"
|
|
114
|
+
"repository": {
|
|
115
|
+
"type": "git",
|
|
116
|
+
"url": "git+https://github.com/ultramodernjs/ultramodern.js.git",
|
|
117
|
+
"directory": "scripts/ultramodern-supply"
|
|
118
|
+
},
|
|
119
|
+
"license": "MIT",
|
|
120
|
+
"scripts": {
|
|
121
|
+
"build": "echo done-by-root-build"
|
|
122
|
+
}
|
|
18
123
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import * as module from 'node:module'
|
|
3
|
+
|
|
4
|
+
let loaded: Promise<any> | undefined
|
|
5
|
+
const vendorURL = new URL('../../vendor/cloudflare-vite-plugin/', import.meta.url)
|
|
6
|
+
|
|
7
|
+
async function load() {
|
|
8
|
+
if (typeof module.registerHooks !== 'function') {
|
|
9
|
+
throw new Error('Redact Cloudflare integration requires Node.js 22.15 or newer. The release matrix uses Node.js 24.22.')
|
|
10
|
+
}
|
|
11
|
+
// This optional entry uses the installed peer's dependency graph, including
|
|
12
|
+
// the application's security overrides.
|
|
13
|
+
const peerURL = import.meta.resolve('@cloudflare/vite-plugin')
|
|
14
|
+
const peer = JSON.parse(readFileSync(new URL('../package.json', peerURL), 'utf8'))
|
|
15
|
+
if (peer.name !== '@cloudflare/vite-plugin' || peer.version !== '1.65.0') {
|
|
16
|
+
throw new Error(`Redact Cloudflare integration supports @cloudflare/vite-plugin 1.65.0; found ${peer.version}.`)
|
|
17
|
+
}
|
|
18
|
+
const hook = module.registerHooks({
|
|
19
|
+
resolve(specifier: string, context: any, nextResolve: any) {
|
|
20
|
+
if (context.parentURL?.startsWith(vendorURL.href) &&
|
|
21
|
+
!specifier.startsWith('.') && !specifier.startsWith('/') &&
|
|
22
|
+
!/^[a-z][a-z+.-]*:/i.test(specifier)) {
|
|
23
|
+
return nextResolve(specifier, { ...context, parentURL: peerURL })
|
|
24
|
+
}
|
|
25
|
+
return nextResolve(specifier, context)
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
try {
|
|
29
|
+
return await import(new URL('dist/index.mjs', vendorURL).href)
|
|
30
|
+
} catch (error) {
|
|
31
|
+
hook.deregister()
|
|
32
|
+
throw error
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Cloudflare's Vite plugin with Redact's maintained development evaluator fix.
|
|
38
|
+
* Accepts the same options as @cloudflare/vite-plugin 1.65.0. Await this factory
|
|
39
|
+
* in the Vite config so framework plugins receive the resolved plugin array.
|
|
40
|
+
*/
|
|
41
|
+
export async function cloudflare(options?: object): Promise<any[]> {
|
|
42
|
+
const plugin = await (loaded ||= load().catch(error => { loaded = undefined; throw error }))
|
|
43
|
+
return plugin.cloudflare(options)
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const BOOLEAN_ATTRS = /^(allowfullscreen|async|autofocus|autoplay|checked|controls|credentialless|default|defer|disabled|formnovalidate|hidden|inert|ismap|itemscope|loop|multiple|muted|nomodule|novalidate|open|playsinline|readonly|required|reversed|selected)$/;
|
|
2
|
+
export const STRING_BOOLEAN_ATTRS = /^(contenteditable|draggable|spellcheck)$/
|
|
3
|
+
|
|
4
|
+
export function attributeName(name: string, isSvg?: boolean): string {
|
|
5
|
+
if (name === 'className') return 'class'
|
|
6
|
+
if (name === 'htmlFor') return 'for'
|
|
7
|
+
if ((isSvg && /^(clip|fill|stroke)/.test(name)) || /^(httpEquiv|acceptCharset|maskType)$/.test(name)) {
|
|
8
|
+
return name.replace(/[A-Z]/g, m => '-' + m.toLowerCase())
|
|
9
|
+
}
|
|
10
|
+
if (name === 'tabIndex' || name === 'crossOrigin') return name.toLowerCase()
|
|
11
|
+
return isSvg || /^(aria|data)-/.test(name) ? name : name.toLowerCase()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Share property coercion with hydration without creating resource-bearing probes.
|
|
15
|
+
export function attributeValue(name: string, value: any, attr: string): string | null {
|
|
16
|
+
if (/^on|^default(Value|Checked)$/.test(name)) return null
|
|
17
|
+
if (name === 'className' || name === 'class' || name === 'htmlFor' || STRING_BOOLEAN_ATTRS.test(attr)) return value == null ? null : '' + value
|
|
18
|
+
if (BOOLEAN_ATTRS.test(attr)) return value ? '' : null
|
|
19
|
+
return value == null || value === false ? null : value === true ? '' : `${value}`
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isFunction } from './functions'
|
|
2
|
+
export const REACT_RECOVERABLE_TYPE = Symbol.for('react.recoverable')
|
|
3
|
+
|
|
4
|
+
export interface BrowserToken {
|
|
5
|
+
readonly $$typeof: typeof REACT_RECOVERABLE_TYPE
|
|
6
|
+
readonly _reason: string | (() => unknown) | undefined
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function browser(reason?: string | (() => unknown)): BrowserToken {
|
|
10
|
+
return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isBrowserToken(value: any): value is BrowserToken {
|
|
14
|
+
return value?.$$typeof === REACT_RECOVERABLE_TYPE
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function browserError(token: BrowserToken): Error {
|
|
18
|
+
let cause: unknown = token._reason
|
|
19
|
+
if (isFunction(cause)) {
|
|
20
|
+
try {
|
|
21
|
+
cause = cause()
|
|
22
|
+
} catch {
|
|
23
|
+
cause = 'The reason for browser-only rendering could not be determined because its initializer threw.'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const error = new Error('Browser-only rendering was requested by `browser()`.',
|
|
27
|
+
token._reason === undefined ? undefined : { cause })
|
|
28
|
+
Object.defineProperty(error, REACT_RECOVERABLE_TYPE, { value: true })
|
|
29
|
+
return error
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isBrowserError(error: any): error is Error {
|
|
33
|
+
return error?.[REACT_RECOVERABLE_TYPE] === true
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Class defaults are resolved by both renderers, including elements made by an
|
|
2
|
+
// automatic JSX runtime. Never mutate props owned by the caller.
|
|
3
|
+
export function resolveClassProps(type: any, props: Record<string, any>) {
|
|
4
|
+
const defaults = type.defaultProps
|
|
5
|
+
if (defaults) {
|
|
6
|
+
props = { ...props }
|
|
7
|
+
for (const key in defaults) {
|
|
8
|
+
if (props[key] === undefined) props[key] = defaults[key]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return props
|
|
12
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Fiber, FiberRoot, ReactElement } from './index'
|
|
2
|
+
|
|
3
|
+
// Development metadata lives outside elements and fibers, so the production
|
|
4
|
+
// object layouts stay unchanged. Owner metadata also supports captureOwnerStack
|
|
5
|
+
// when no DevTools extension is attached.
|
|
6
|
+
export const devToolsMetadata = {
|
|
7
|
+
enabled: false,
|
|
8
|
+
owner: null as Fiber | null,
|
|
9
|
+
current: null as Fiber | null,
|
|
10
|
+
errorStack: undefined as string | null | undefined,
|
|
11
|
+
stackBudget: 10000,
|
|
12
|
+
stackResetTime: 0,
|
|
13
|
+
hosts: /* @__PURE__ */ new WeakMap<Node, Fiber>(),
|
|
14
|
+
hydratedRoots: /* @__PURE__ */ new WeakSet<FiberRoot>(),
|
|
15
|
+
elements: /* @__PURE__ */ new WeakMap<object, { owner: Fiber | null; stack: Error | null; source: any }>(),
|
|
16
|
+
fibers: /* @__PURE__ */ new WeakMap<Fiber, { owner: Fiber | null; stack: Error | null; source: any }>(),
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function rememberDevToolsElement(element: ReactElement, source?: any, original?: ReactElement): ReactElement {
|
|
20
|
+
const previous = original && devToolsMetadata.elements.get(original)
|
|
21
|
+
devToolsMetadata.elements.set(element, previous || {
|
|
22
|
+
owner: devToolsMetadata.owner,
|
|
23
|
+
// React also caps owner stack capture at 10,000 elements per second.
|
|
24
|
+
// Keep owner relationships, but don't invent a source once the budget ends.
|
|
25
|
+
stack: devToolsMetadata.stackBudget-- > 0 ? new Error('react-stack-top-frame') : null,
|
|
26
|
+
source: source || null,
|
|
27
|
+
})
|
|
28
|
+
return element
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function readOwnerStack(fiber: Fiber | null): string | null {
|
|
32
|
+
if (!fiber) return null
|
|
33
|
+
if (!fiber) return null
|
|
34
|
+
let stack = ''
|
|
35
|
+
const seen = new Set<typeof fiber>()
|
|
36
|
+
while (fiber && !seen.has(fiber)) {
|
|
37
|
+
seen.add(fiber)
|
|
38
|
+
const metadata = devToolsMetadata.fibers.get(fiber)
|
|
39
|
+
fiber = metadata?.owner || null
|
|
40
|
+
if (!fiber) break
|
|
41
|
+
let type = fiber.type
|
|
42
|
+
while (type && typeof type === 'object') type = type.type || type.render
|
|
43
|
+
const name = typeof type === 'function' ? type.displayName || type.name || 'Anonymous' : ''
|
|
44
|
+
if (!name) continue
|
|
45
|
+
const frame = metadata?.stack?.stack?.split('\n').find(line =>
|
|
46
|
+
line.includes('at ' + name + ' (') || line.startsWith(name + '@'))
|
|
47
|
+
stack += '\n' + (frame ? frame.startsWith(name + '@') ? ' at ' + name + ' (' + frame.slice(name.length + 1) + ')' : frame : ' at ' + name)
|
|
48
|
+
}
|
|
49
|
+
return stack
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function runWithOwnerStack<T>(stack: string | null, callback: () => T): T {
|
|
53
|
+
const previousCurrent = devToolsMetadata.current
|
|
54
|
+
const previousStack = devToolsMetadata.errorStack
|
|
55
|
+
devToolsMetadata.current = null
|
|
56
|
+
devToolsMetadata.errorStack = stack
|
|
57
|
+
try { return callback() } finally {
|
|
58
|
+
devToolsMetadata.current = previousCurrent
|
|
59
|
+
devToolsMetadata.errorStack = previousStack
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Development-only, like React's diagnostic export. */
|
|
64
|
+
export let captureOwnerStack: () => string | null
|
|
65
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
+
captureOwnerStack = () => devToolsMetadata.current
|
|
67
|
+
? readOwnerStack(devToolsMetadata.current)
|
|
68
|
+
: devToolsMetadata.errorStack ?? null
|
|
69
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const isFunction = (value: any): value is ((...args: any[]) => any) & Record<string, any> => (typeof value === 'function')
|
|
2
|
+
|
|
3
|
+
export const isReservedProp = (name: string): boolean => (name === 'children' || name === 'ref' || name === 'key')
|
|
4
|
+
|
|
5
|
+
export const isThenable = (x: any): x is Promise<any> => (x != null && isFunction(x.then))
|
|
6
|
+
|
|
7
|
+
export const isString = (value: any): value is string => typeof value === 'string'
|
|
8
|
+
|
|
9
|
+
export const isObject = (value: any): boolean => typeof value === 'object'
|
|
10
|
+
|
|
11
|
+
export const isTextContent = (value: unknown): value is string | number | bigint => typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint'
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, Ref } from './types';
|
|
2
|
+
export const enum FiberTag {
|
|
3
|
+
Host = 0,
|
|
4
|
+
Text = 1,
|
|
5
|
+
Function = 2,
|
|
6
|
+
Class = 3,
|
|
7
|
+
Fragment = 4,
|
|
8
|
+
Portal = 5,
|
|
9
|
+
Provider = 6,
|
|
10
|
+
Consumer = 7,
|
|
11
|
+
ForwardRef = 8,
|
|
12
|
+
Memo = 9,
|
|
13
|
+
Lazy = 10,
|
|
14
|
+
Suspense = 11,
|
|
15
|
+
Root = 12,
|
|
16
|
+
Activity = 13,
|
|
17
|
+
Resource = 14
|
|
18
|
+
}
|
|
19
|
+
export interface Hook {
|
|
20
|
+
t?: any[] | undefined;
|
|
21
|
+
s: any;
|
|
22
|
+
q: any;
|
|
23
|
+
d: any;
|
|
24
|
+
c: any;
|
|
25
|
+
}
|
|
26
|
+
export interface Effect {
|
|
27
|
+
t: 0 | 1 | 2;
|
|
28
|
+
c: () => any;
|
|
29
|
+
d?: () => void;
|
|
30
|
+
s?: boolean | undefined; // Store subscriptions run in layout but stay connected in Suspense.
|
|
31
|
+
}
|
|
32
|
+
export interface Fiber {
|
|
33
|
+
ix?: number; // Logical child position, including empty slots.
|
|
34
|
+
t: FiberTag; // Tag.
|
|
35
|
+
type: any;
|
|
36
|
+
key: string | null;
|
|
37
|
+
ref: Ref<any> | null;
|
|
38
|
+
v: any; // Pending props.
|
|
39
|
+
m: any; // Committed props.
|
|
40
|
+
b: any; // Renderer state.
|
|
41
|
+
i: any; // Class instance or resource node.
|
|
42
|
+
n: Node | null; // Host node.
|
|
43
|
+
p: Fiber | null; // Parent.
|
|
44
|
+
c: Fiber | null; // First child.
|
|
45
|
+
s: Fiber | null; // Next sibling.
|
|
46
|
+
h: Hook[] | null;
|
|
47
|
+
e: Array<() => void> | null; // Cleanups.
|
|
48
|
+
g: boolean; // Has pending work.
|
|
49
|
+
u: boolean; // Unmounted.
|
|
50
|
+
pd?: boolean;
|
|
51
|
+
su?: Fiber | null; // Retained Suspense primary update target.
|
|
52
|
+
bs?: boolean; // This component suspended without a boundary.
|
|
53
|
+
bt?: boolean; // Pending updates belong only to transitions.
|
|
54
|
+
ld?: boolean; // Layout effects and refs are disconnected, not passive effects.
|
|
55
|
+
r: FiberRoot | null;
|
|
56
|
+
ad?: boolean; // Activity has disconnected this fiber.
|
|
57
|
+
ah?: boolean; // Activity owns its hidden host DOM.
|
|
58
|
+
ef?: Map<Hook, Effect> | undefined; // Retained effect descriptions.
|
|
59
|
+
hc?: import('../dom/features/hydration/full').HydrationCursor | undefined;
|
|
60
|
+
it?: bigint; // React hydration tree ID.
|
|
61
|
+
il?: number; // Local useId calls in this render.
|
|
62
|
+
im?: boolean; // This fiber materialized a React tree ID.
|
|
63
|
+
d?: number; // Cached depth.
|
|
64
|
+
cx?: Map<any, any> | null;
|
|
65
|
+
cr?: Ref<any> | null;
|
|
66
|
+
rc?: (() => void) | null;
|
|
67
|
+
}
|
|
68
|
+
export type RecoverableErrorHandler = (error: unknown, info: {
|
|
69
|
+
componentStack: string | null;
|
|
70
|
+
errorBoundary?: unknown;
|
|
71
|
+
}) => void;
|
|
72
|
+
export interface FiberRoot {
|
|
73
|
+
tr?: Set<Fiber> & {
|
|
74
|
+
s: Set<import('../react/action-scope').ActionScope>;
|
|
75
|
+
w?: PromiseLike<unknown>;
|
|
76
|
+
u?: (() => void) | undefined;
|
|
77
|
+
};
|
|
78
|
+
hr?: Node | undefined; // Hydration recovery container.
|
|
79
|
+
ri?: boolean; // React-compatible hydration IDs.
|
|
80
|
+
c: Element | DocumentFragment;
|
|
81
|
+
r: Fiber;
|
|
82
|
+
p: Set<Fiber>;
|
|
83
|
+
s: boolean;
|
|
84
|
+
u?: (() => void) | undefined;
|
|
85
|
+
er?: Array<{
|
|
86
|
+
error: unknown;
|
|
87
|
+
stack: string;
|
|
88
|
+
ownerStack?: string | null;
|
|
89
|
+
}> | undefined;
|
|
90
|
+
eb?: boolean;
|
|
91
|
+
sp?: boolean;
|
|
92
|
+
re?: RecoverableErrorHandler | undefined;
|
|
93
|
+
ce?: RecoverableErrorHandler | undefined;
|
|
94
|
+
ue?: RecoverableErrorHandler | undefined;
|
|
95
|
+
i: string | undefined;
|
|
96
|
+
ic: number;
|
|
97
|
+
h: boolean;
|
|
98
|
+
a?: boolean;
|
|
99
|
+
fr?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export function createFiber(tag: FiberTag, type: any, key: string | null): Fiber {
|
|
102
|
+
return {
|
|
103
|
+
t: tag,
|
|
104
|
+
type,
|
|
105
|
+
key,
|
|
106
|
+
ref: null,
|
|
107
|
+
v: null,
|
|
108
|
+
m: null,
|
|
109
|
+
b: null,
|
|
110
|
+
i: null,
|
|
111
|
+
n: null,
|
|
112
|
+
p: null,
|
|
113
|
+
c: null,
|
|
114
|
+
s: null,
|
|
115
|
+
h: null,
|
|
116
|
+
e: null,
|
|
117
|
+
g: false,
|
|
118
|
+
u: false,
|
|
119
|
+
r: null,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export type ChildNode = ReactElement | string | number | boolean | null | undefined | ChildNode[];
|
|
123
|
+
export type { ReactElement, ReactNode };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isFunction } from './functions'
|
|
2
|
+
export type ResourceHintKind =
|
|
3
|
+
| 'dns-prefetch'
|
|
4
|
+
| 'preconnect'
|
|
5
|
+
| 'preload'
|
|
6
|
+
| 'modulepreload'
|
|
7
|
+
| 'stylesheet'
|
|
8
|
+
| 'script'
|
|
9
|
+
| 'module-script'
|
|
10
|
+
|
|
11
|
+
// Only supported string options reach the dispatcher, using the public camelCase
|
|
12
|
+
// names. Fonts have crossOrigin: ''. Stylesheet precedence defaults to 'default'.
|
|
13
|
+
// Module preloads omit as for the implicit script destination. href is non-empty.
|
|
14
|
+
// A server renderer returns true to consume a hint in its current request, even
|
|
15
|
+
// when deduplication means no new output. Returning false falls through to the DOM.
|
|
16
|
+
export type ResourceHintOptions = Record<string, string>
|
|
17
|
+
|
|
18
|
+
export const resourceHintDispatcher: {
|
|
19
|
+
emit?: (kind: ResourceHintKind, href: string, options: ResourceHintOptions) => boolean
|
|
20
|
+
} = {}
|
|
21
|
+
|
|
22
|
+
// The renderer excludes SVG before calling this. A ref does not opt a resource
|
|
23
|
+
// out of sharing, but event ownership, disabled sheets and itemProp do.
|
|
24
|
+
export function resourceKind(type: string, props: any): 'style' | 'stylesheet' | 'script' | undefined {
|
|
25
|
+
if (props.itemProp != null) return
|
|
26
|
+
if (type === 'style' || type === 'link') {
|
|
27
|
+
if (isString(props.precedence) && isString(props.href) && props.href &&
|
|
28
|
+
(type === 'style' || props.rel === 'stylesheet' && props.disabled == null && !props.onLoad && !props.onError)) {
|
|
29
|
+
return type === 'style' ? 'style' : 'stylesheet'
|
|
30
|
+
}
|
|
31
|
+
} else if (type === 'script' && props.async && !isFunction(props.async) && typeof props.async !== 'symbol' && isString(props.src) && props.src && !props.onLoad && !props.onError) return 'script'
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const resourceURL = (value: string): string => (/^[\u0000-\u0020]*javascript:/i.test(String(value).replace(/[\r\n\t]/g, ''))
|
|
36
|
+
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
|
|
37
|
+
: value)
|
|
38
|
+
|
|
39
|
+
import { isString } from "./functions"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// React 19+ uses the transitional element symbol. When our shim's elements
|
|
2
|
+
// are passed to react-dom (e.g. Start routing through real react-dom/server
|
|
3
|
+
// somewhere), they must carry the symbol that React's isValidElement checks.
|
|
4
|
+
export const REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element')
|
|
5
|
+
export const REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element')
|
|
6
|
+
export const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')
|
|
7
|
+
|
|
8
|
+
export type Key = string | number | null | undefined
|
|
9
|
+
|
|
10
|
+
export interface ReactElement<P = any, T = any> {
|
|
11
|
+
$$typeof: typeof REACT_ELEMENT_TYPE
|
|
12
|
+
type: T
|
|
13
|
+
key: string | null
|
|
14
|
+
ref: any
|
|
15
|
+
props: P
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ReactNodeValue =
|
|
19
|
+
| ReactElement
|
|
20
|
+
| string
|
|
21
|
+
| number
|
|
22
|
+
| bigint
|
|
23
|
+
| boolean
|
|
24
|
+
| null
|
|
25
|
+
| undefined
|
|
26
|
+
| Iterable<ReactNode>
|
|
27
|
+
|
|
28
|
+
export type ReactNode = ReactNodeValue | Promise<ReactNodeValue>
|
|
29
|
+
|
|
30
|
+
export type RefObject<T> = { current: T | null }
|
|
31
|
+
export type RefCallback<T> = (instance: T | null) => void | (() => void)
|
|
32
|
+
export type Ref<T> = RefObject<T> | RefCallback<T> | null
|
|
33
|
+
|
|
34
|
+
export type Dispatch<A> = (value: A) => void
|
|
35
|
+
export type SetStateAction<S> = S | ((prev: S) => S)
|
|
36
|
+
|
|
37
|
+
export type EffectCallback = () => void | (() => void)
|
|
38
|
+
export type DependencyList = ReadonlyArray<unknown>
|
|
39
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const UNITLESS_STYLE = /^(webkit|moz|ms|o)?(?:animationiterationcount|aspectratio|scale|borderimage(outset|slice|width)|box(flex(group)?|ordinalgroup)|column(count|s)|flex(grow|positive|shrink|negative|order)?|grid(area|(row|column)(end|span|start)?)|fontweight|line(clamp|height)|opacity|order|orphans|tabsize|widows|zindex|zoom|(fill|flood|stop|stroke)opacity|stroke(dasharray|dashoffset|miterlimit|width))$/i
|