@bleedingdev/tanstack-redact 0.0.0-stage → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cloudflare/index.d.ts +6 -0
- package/dist/cloudflare/index.js +39 -0
- package/dist/cloudflare/index.js.map +7 -0
- package/dist/core/attributes.d.ts +4 -0
- package/dist/core/attributes.js +30 -0
- package/dist/core/attributes.js.map +7 -0
- package/dist/core/browser.d.ts +9 -0
- package/dist/core/browser.js +32 -0
- package/dist/core/browser.js.map +7 -0
- package/dist/core/class-props.d.ts +1 -0
- package/dist/core/class-props.js +15 -0
- package/dist/core/class-props.js.map +7 -0
- package/dist/core/devtools.d.ts +26 -0
- package/dist/core/devtools.js +70 -0
- package/dist/core/devtools.js.map +7 -0
- package/dist/core/functions.d.ts +6 -0
- package/dist/core/functions.js +14 -0
- package/dist/core/functions.js.map +7 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +7 -0
- package/dist/core/internal.d.ts +103 -0
- package/dist/core/internal.js +43 -0
- package/dist/core/internal.js.map +7 -0
- package/dist/core/resource-hints.d.ts +7 -0
- package/dist/core/resource-hints.js +20 -0
- package/dist/core/resource-hints.js.map +7 -0
- package/dist/core/types.d.ts +23 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +7 -0
- package/dist/core/unitless-style.d.ts +1 -0
- package/dist/core/unitless-style.js +5 -0
- package/dist/core/unitless-style.js.map +7 -0
- package/dist/dom/_all.d.ts +27 -0
- package/dist/dom/_all.js +51 -0
- package/dist/dom/_all.js.map +7 -0
- package/dist/dom/client.d.ts +9 -0
- package/dist/dom/client.js +13 -0
- package/dist/dom/client.js.map +7 -0
- package/dist/dom/commit.d.ts +27 -0
- package/dist/dom/commit.js +237 -0
- package/dist/dom/commit.js.map +7 -0
- package/dist/dom/devtools-effects.d.ts +8 -0
- package/dist/dom/devtools-effects.js +80 -0
- package/dist/dom/devtools-effects.js.map +7 -0
- package/dist/dom/devtools.d.ts +33 -0
- package/dist/dom/devtools.js +635 -0
- package/dist/dom/devtools.js.map +7 -0
- package/dist/dom/dispatcher.d.ts +4 -0
- package/dist/dom/dispatcher.js +437 -0
- package/dist/dom/dispatcher.js.map +7 -0
- package/dist/dom/document-metadata.d.ts +7 -0
- package/dist/dom/document-metadata.js +44 -0
- package/dist/dom/document-metadata.js.map +7 -0
- package/dist/dom/dom.d.ts +11 -0
- package/dist/dom/dom.js +165 -0
- package/dist/dom/dom.js.map +7 -0
- package/dist/dom/error-info.d.ts +2 -0
- package/dist/dom/error-info.js +19 -0
- package/dist/dom/error-info.js.map +7 -0
- package/dist/dom/event-replay.d.ts +13 -0
- package/dist/dom/event-replay.js +24 -0
- package/dist/dom/event-replay.js.map +7 -0
- package/dist/dom/features/activity/full.d.ts +1 -0
- package/dist/dom/features/activity/full.js +140 -0
- package/dist/dom/features/activity/full.js.map +7 -0
- package/dist/dom/features/activity/index.d.ts +1 -0
- package/dist/dom/features/activity/index.js +2 -0
- package/dist/dom/features/activity/index.js.map +7 -0
- package/dist/dom/features/activity/stub.d.ts +1 -0
- package/dist/dom/features/activity/stub.js +10 -0
- package/dist/dom/features/activity/stub.js.map +7 -0
- package/dist/dom/features/class/full.d.ts +1 -0
- package/dist/dom/features/class/full.js +208 -0
- package/dist/dom/features/class/full.js.map +7 -0
- package/dist/dom/features/class/index.d.ts +1 -0
- package/dist/dom/features/class/index.js +2 -0
- package/dist/dom/features/class/index.js.map +7 -0
- package/dist/dom/features/class/stub.d.ts +1 -0
- package/dist/dom/features/class/stub.js +46 -0
- package/dist/dom/features/class/stub.js.map +7 -0
- package/dist/dom/features/context/full.d.ts +4 -0
- package/dist/dom/features/context/full.js +103 -0
- package/dist/dom/features/context/full.js.map +7 -0
- package/dist/dom/features/context/index.d.ts +1 -0
- package/dist/dom/features/context/index.js +2 -0
- package/dist/dom/features/context/index.js.map +7 -0
- package/dist/dom/features/context/stub.d.ts +4 -0
- package/dist/dom/features/context/stub.js +21 -0
- package/dist/dom/features/context/stub.js.map +7 -0
- package/dist/dom/features/forward-ref/full.d.ts +1 -0
- package/dist/dom/features/forward-ref/full.js +9 -0
- package/dist/dom/features/forward-ref/full.js.map +7 -0
- package/dist/dom/features/forward-ref/index.d.ts +1 -0
- package/dist/dom/features/forward-ref/index.js +2 -0
- package/dist/dom/features/forward-ref/index.js.map +7 -0
- package/dist/dom/features/forward-ref/stub.d.ts +1 -0
- package/dist/dom/features/forward-ref/stub.js +9 -0
- package/dist/dom/features/forward-ref/stub.js.map +7 -0
- package/dist/dom/features/fragment-refs/index.d.ts +1 -0
- package/dist/dom/features/fragment-refs/index.js +9 -0
- package/dist/dom/features/fragment-refs/index.js.map +7 -0
- package/dist/dom/features/fragment-refs/stub.d.ts +5 -0
- package/dist/dom/features/fragment-refs/stub.js +17 -0
- package/dist/dom/features/fragment-refs/stub.js.map +7 -0
- package/dist/dom/features/hydration/full.d.ts +68 -0
- package/dist/dom/features/hydration/full.js +493 -0
- package/dist/dom/features/hydration/full.js.map +7 -0
- package/dist/dom/features/hydration/index.d.ts +1 -0
- package/dist/dom/features/hydration/index.js +2 -0
- package/dist/dom/features/hydration/index.js.map +7 -0
- package/dist/dom/features/hydration/stub.d.ts +36 -0
- package/dist/dom/features/hydration/stub.js +80 -0
- package/dist/dom/features/hydration/stub.js.map +7 -0
- package/dist/dom/features/index.d.ts +8 -0
- package/dist/dom/features/index.js +9 -0
- package/dist/dom/features/index.js.map +7 -0
- package/dist/dom/features/lazy/full.d.ts +1 -0
- package/dist/dom/features/lazy/full.js +23 -0
- package/dist/dom/features/lazy/full.js.map +7 -0
- package/dist/dom/features/lazy/index.d.ts +1 -0
- package/dist/dom/features/lazy/index.js +2 -0
- package/dist/dom/features/lazy/index.js.map +7 -0
- package/dist/dom/features/lazy/stub.d.ts +1 -0
- package/dist/dom/features/lazy/stub.js +19 -0
- package/dist/dom/features/lazy/stub.js.map +7 -0
- package/dist/dom/features/memo/full.d.ts +1 -0
- package/dist/dom/features/memo/full.js +34 -0
- package/dist/dom/features/memo/full.js.map +7 -0
- package/dist/dom/features/memo/index.d.ts +1 -0
- package/dist/dom/features/memo/index.js +2 -0
- package/dist/dom/features/memo/index.js.map +7 -0
- package/dist/dom/features/memo/stub.d.ts +1 -0
- package/dist/dom/features/memo/stub.js +9 -0
- package/dist/dom/features/memo/stub.js.map +7 -0
- package/dist/dom/features/portal/full.d.ts +1 -0
- package/dist/dom/features/portal/full.js +11 -0
- package/dist/dom/features/portal/full.js.map +7 -0
- package/dist/dom/features/portal/index.d.ts +1 -0
- package/dist/dom/features/portal/index.js +2 -0
- package/dist/dom/features/portal/index.js.map +7 -0
- package/dist/dom/features/portal/stub.d.ts +1 -0
- package/dist/dom/features/portal/stub.js +5 -0
- package/dist/dom/features/portal/stub.js.map +7 -0
- package/dist/dom/features/suspense/full.d.ts +1 -0
- package/dist/dom/features/suspense/full.js +389 -0
- package/dist/dom/features/suspense/full.js.map +7 -0
- package/dist/dom/features/suspense/index.d.ts +1 -0
- package/dist/dom/features/suspense/index.js +2 -0
- package/dist/dom/features/suspense/index.js.map +7 -0
- package/dist/dom/features/suspense/stub.d.ts +1 -0
- package/dist/dom/features/suspense/stub.js +4 -0
- package/dist/dom/features/suspense/stub.js.map +7 -0
- package/dist/dom/features/suspense-runtime/index.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/index.js +2 -0
- package/dist/dom/features/suspense-runtime/index.js.map +7 -0
- package/dist/dom/features/suspense-runtime/stub.d.ts +1 -0
- package/dist/dom/features/suspense-runtime/stub.js +11 -0
- package/dist/dom/features/suspense-runtime/stub.js.map +7 -0
- package/dist/dom/features/view-transition/full.d.ts +7 -0
- package/dist/dom/features/view-transition/full.js +324 -0
- package/dist/dom/features/view-transition/full.js.map +7 -0
- package/dist/dom/features/view-transition/index.d.ts +1 -0
- package/dist/dom/features/view-transition/index.js +2 -0
- package/dist/dom/features/view-transition/index.js.map +7 -0
- package/dist/dom/features/view-transition/resources.d.ts +11 -0
- package/dist/dom/features/view-transition/resources.js +117 -0
- package/dist/dom/features/view-transition/resources.js.map +7 -0
- package/dist/dom/features/view-transition/stub.d.ts +7 -0
- package/dist/dom/features/view-transition/stub.js +21 -0
- package/dist/dom/features/view-transition/stub.js.map +7 -0
- package/dist/dom/features/view-transition/visual.d.ts +14 -0
- package/dist/dom/features/view-transition/visual.js +404 -0
- package/dist/dom/features/view-transition/visual.js.map +7 -0
- package/dist/dom/form-actions.d.ts +4 -0
- package/dist/dom/form-actions.js +74 -0
- package/dist/dom/form-actions.js.map +7 -0
- package/dist/dom/form-controls.d.ts +3 -0
- package/dist/dom/form-controls.js +91 -0
- package/dist/dom/form-controls.js.map +7 -0
- package/dist/dom/fragment-instance.d.ts +33 -0
- package/dist/dom/fragment-instance.js +449 -0
- package/dist/dom/fragment-instance.js.map +7 -0
- package/dist/dom/index.d.ts +61 -0
- package/dist/dom/index.js +71 -0
- package/dist/dom/index.js.map +7 -0
- package/dist/dom/portal.d.ts +2 -0
- package/dist/dom/portal.js +14 -0
- package/dist/dom/portal.js.map +7 -0
- package/dist/dom/react-ids.d.ts +6 -0
- package/dist/dom/react-ids.js +38 -0
- package/dist/dom/react-ids.js.map +7 -0
- package/dist/dom/reconcile.d.ts +86 -0
- package/dist/dom/reconcile.js +1305 -0
- package/dist/dom/reconcile.js.map +7 -0
- package/dist/dom/refresh.d.ts +12 -0
- package/dist/dom/refresh.js +174 -0
- package/dist/dom/refresh.js.map +7 -0
- package/dist/dom/resource-hints.d.ts +6 -0
- package/dist/dom/resource-hints.js +107 -0
- package/dist/dom/resource-hints.js.map +7 -0
- package/dist/dom/resource-store.d.ts +13 -0
- package/dist/dom/resource-store.js +47 -0
- package/dist/dom/resource-store.js.map +7 -0
- package/dist/dom/resources.d.ts +1 -0
- package/dist/dom/resources.js +46 -0
- package/dist/dom/resources.js.map +7 -0
- package/dist/dom/retained-effects.d.ts +6 -0
- package/dist/dom/retained-effects.js +67 -0
- package/dist/dom/retained-effects.js.map +7 -0
- package/dist/dom/root-internal.d.ts +11 -0
- package/dist/dom/root-internal.js +35 -0
- package/dist/dom/root-internal.js.map +7 -0
- package/dist/dom/root.d.ts +17 -0
- package/dist/dom/root.js +38 -0
- package/dist/dom/root.js.map +7 -0
- package/dist/dom/synthetic-event.d.ts +1 -0
- package/dist/dom/synthetic-event.js +37 -0
- package/dist/dom/synthetic-event.js.map +7 -0
- package/dist/dom/test-utils.d.ts +1 -0
- package/dist/dom/test-utils.js +5 -0
- package/dist/dom/test-utils.js.map +7 -0
- package/dist/dom/transitions.d.ts +9 -0
- package/dist/dom/transitions.js +147 -0
- package/dist/dom/transitions.js.map +7 -0
- package/dist/dom/tree.d.ts +5 -0
- package/dist/dom/tree.js +62 -0
- package/dist/dom/tree.js.map +7 -0
- package/dist/dom/walk.d.ts +2 -0
- package/dist/dom/walk.js +14 -0
- package/dist/dom/walk.js.map +7 -0
- package/dist/next/client.d.ts +9 -0
- package/dist/next/client.js +14 -0
- package/dist/next/client.js.map +7 -0
- package/dist/next/dev-cache-loader.cjs +13 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +97 -0
- package/dist/next/index.js.map +7 -0
- package/dist/next/loader.cjs +10 -0
- package/dist/next/react.d.ts +71 -0
- package/dist/next/react.js +9 -0
- package/dist/next/react.js.map +7 -0
- package/dist/react/act.d.ts +3 -0
- package/dist/react/act.js +124 -0
- package/dist/react/act.js.map +7 -0
- package/dist/react/action-scope.d.ts +17 -0
- package/dist/react/action-scope.js +60 -0
- package/dist/react/action-scope.js.map +7 -0
- package/dist/react/activity.d.ts +7 -0
- package/dist/react/activity.js +7 -0
- package/dist/react/activity.js.map +7 -0
- package/dist/react/children.d.ts +8 -0
- package/dist/react/children.js +76 -0
- package/dist/react/children.js.map +7 -0
- package/dist/react/class.d.ts +36 -0
- package/dist/react/class.js +39 -0
- package/dist/react/class.js.map +7 -0
- package/dist/react/compiler-runtime.d.ts +1 -0
- package/dist/react/compiler-runtime.js +9 -0
- package/dist/react/compiler-runtime.js.map +7 -0
- package/dist/react/context.d.ts +32 -0
- package/dist/react/context.js +25 -0
- package/dist/react/context.js.map +7 -0
- package/dist/react/element.d.ts +13 -0
- package/dist/react/element.js +70 -0
- package/dist/react/element.js.map +7 -0
- package/dist/react/form-state.d.ts +26 -0
- package/dist/react/form-state.js +30 -0
- package/dist/react/form-state.js.map +7 -0
- package/dist/react/hooks.d.ts +67 -0
- package/dist/react/hooks.js +165 -0
- package/dist/react/hooks.js.map +7 -0
- package/dist/react/index.d.ts +99 -0
- package/dist/react/index.js +143 -0
- package/dist/react/index.js.map +7 -0
- package/dist/react/jsx-runtime.d.ts +24 -0
- package/dist/react/jsx-runtime.js +37 -0
- package/dist/react/jsx-runtime.js.map +7 -0
- package/dist/react/memo.d.ts +20 -0
- package/dist/react/memo.js +27 -0
- package/dist/react/memo.js.map +7 -0
- package/dist/react/portal.d.ts +1 -0
- package/dist/react/portal.js +5 -0
- package/dist/react/portal.js.map +7 -0
- package/dist/react/shared-internals.d.ts +52 -0
- package/dist/react/shared-internals.js +22 -0
- package/dist/react/shared-internals.js.map +7 -0
- package/dist/react/suspense.d.ts +15 -0
- package/dist/react/suspense.js +15 -0
- package/dist/react/suspense.js.map +7 -0
- package/dist/react/thenable.d.ts +1 -0
- package/dist/react/thenable.js +25 -0
- package/dist/react/thenable.js.map +7 -0
- package/dist/react/view-transition.d.ts +32 -0
- package/dist/react/view-transition.js +12 -0
- package/dist/react/view-transition.js.map +7 -0
- package/dist/scheduler/index.d.ts +44 -0
- package/dist/scheduler/index.js +109 -0
- package/dist/scheduler/index.js.map +7 -0
- package/dist/server/bootstrap-script.d.ts +3 -0
- package/dist/server/bootstrap-script.js +17 -0
- package/dist/server/bootstrap-script.js.map +7 -0
- package/dist/server/dispatcher.d.ts +57 -0
- package/dist/server/dispatcher.js +157 -0
- package/dist/server/dispatcher.js.map +7 -0
- package/dist/server/escape.d.ts +6 -0
- package/dist/server/escape.js +75 -0
- package/dist/server/escape.js.map +7 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +25 -0
- package/dist/server/index.js.map +7 -0
- package/dist/server/insertion-context.d.ts +3 -0
- package/dist/server/insertion-context.js +32 -0
- package/dist/server/renderToString.d.ts +7 -0
- package/dist/server/renderToString.js +33 -0
- package/dist/server/renderToString.js.map +7 -0
- package/dist/server/resource-hints.d.ts +22 -0
- package/dist/server/resource-hints.js +168 -0
- package/dist/server/resource-hints.js.map +7 -0
- package/dist/server/stream-ids.d.ts +3 -0
- package/dist/server/stream-ids.js +8 -0
- package/dist/server/stream.d.ts +61 -0
- package/dist/server/stream.js +418 -0
- package/dist/server/stream.js.map +7 -0
- package/dist/server/walk.d.ts +58 -0
- package/dist/server/walk.js +378 -0
- package/dist/server/walk.js.map +7 -0
- package/dist/vinext/compatibility.d.ts +23 -0
- package/dist/vinext/compatibility.js +127 -0
- package/dist/vinext/compatibility.js.map +7 -0
- package/dist/vinext/flight-timing.d.ts +1 -0
- package/dist/vinext/flight-timing.js +46 -0
- package/dist/vinext/flight-timing.js.map +7 -0
- package/dist/vinext/index.d.ts +5 -0
- package/dist/vinext/index.js +50 -0
- package/dist/vinext/index.js.map +7 -0
- package/dist/vite/index.d.ts +102 -0
- package/dist/vite/index.js +291 -0
- package/dist/vite/index.js.map +7 -0
- package/dist/vite/react18.d.ts +4 -0
- package/dist/vite/react18.js +74 -0
- package/dist/vite/react18.js.map +7 -0
- package/package.json +121 -4
- package/src/cloudflare/index.ts +44 -0
- package/src/core/attributes.ts +20 -0
- package/src/core/browser.ts +34 -0
- package/src/core/class-props.ts +12 -0
- package/src/core/devtools.ts +69 -0
- package/src/core/functions.ts +11 -0
- package/src/core/index.ts +2 -0
- package/src/core/internal.ts +123 -0
- package/src/core/resource-hints.ts +39 -0
- package/src/core/types.ts +39 -0
- package/src/core/unitless-style.ts +1 -0
- package/src/dom/_all.ts +46 -0
- package/src/dom/client.ts +17 -0
- package/src/dom/commit.ts +223 -0
- package/src/dom/devtools-effects.ts +78 -0
- package/src/dom/devtools.ts +527 -0
- package/src/dom/dispatcher.ts +476 -0
- package/src/dom/document-metadata.ts +41 -0
- package/src/dom/dom.ts +181 -0
- package/src/dom/error-info.ts +20 -0
- package/src/dom/event-replay.ts +39 -0
- package/src/dom/features/activity/full.ts +150 -0
- package/src/dom/features/activity/index.ts +1 -0
- package/src/dom/features/activity/stub.ts +12 -0
- package/src/dom/features/class/full.ts +202 -0
- package/src/dom/features/class/index.ts +1 -0
- package/src/dom/features/class/stub.ts +58 -0
- package/src/dom/features/context/full.ts +107 -0
- package/src/dom/features/context/index.ts +1 -0
- package/src/dom/features/context/stub.ts +26 -0
- package/src/dom/features/forward-ref/full.ts +9 -0
- package/src/dom/features/forward-ref/index.ts +1 -0
- package/src/dom/features/forward-ref/stub.ts +15 -0
- package/src/dom/features/fragment-refs/index.ts +1 -0
- package/src/dom/features/fragment-refs/stub.ts +6 -0
- package/src/dom/features/hydration/full.ts +563 -0
- package/src/dom/features/hydration/index.ts +1 -0
- package/src/dom/features/hydration/stub.ts +86 -0
- package/src/dom/features/index.ts +12 -0
- package/src/dom/features/lazy/full.ts +27 -0
- package/src/dom/features/lazy/index.ts +1 -0
- package/src/dom/features/lazy/stub.ts +24 -0
- package/src/dom/features/memo/full.ts +39 -0
- package/src/dom/features/memo/index.ts +1 -0
- package/src/dom/features/memo/stub.ts +13 -0
- package/src/dom/features/portal/full.ts +14 -0
- package/src/dom/features/portal/index.ts +1 -0
- package/src/dom/features/portal/stub.ts +11 -0
- package/src/dom/features/suspense/full.ts +469 -0
- package/src/dom/features/suspense/index.ts +1 -0
- package/src/dom/features/suspense/stub.ts +13 -0
- package/src/dom/features/suspense-runtime/index.ts +1 -0
- package/src/dom/features/suspense-runtime/stub.ts +1 -0
- package/src/dom/features/view-transition/full.ts +292 -0
- package/src/dom/features/view-transition/index.ts +1 -0
- package/src/dom/features/view-transition/resources.ts +123 -0
- package/src/dom/features/view-transition/stub.ts +8 -0
- package/src/dom/features/view-transition/visual.ts +454 -0
- package/src/dom/form-actions.ts +69 -0
- package/src/dom/form-controls.ts +91 -0
- package/src/dom/fragment-instance.ts +462 -0
- package/src/dom/index.ts +49 -0
- package/src/dom/portal.ts +16 -0
- package/src/dom/react-ids.ts +36 -0
- package/src/dom/reconcile.ts +1423 -0
- package/src/dom/refresh.ts +171 -0
- package/src/dom/resource-hints.ts +104 -0
- package/src/dom/resource-store.ts +50 -0
- package/src/dom/resources.ts +47 -0
- package/src/dom/retained-effects.ts +57 -0
- package/src/dom/root-internal.ts +37 -0
- package/src/dom/root.ts +59 -0
- package/src/dom/synthetic-event.ts +27 -0
- package/src/dom/test-utils.ts +1 -0
- package/src/dom/transitions.ts +141 -0
- package/src/dom/tree.ts +56 -0
- package/src/dom/walk.ts +8 -0
- package/src/next/client.ts +10 -0
- package/src/next/dev-cache-loader.cjs +13 -0
- package/src/next/index.ts +95 -0
- package/src/next/loader.cjs +10 -0
- package/src/next/react.ts +7 -0
- package/src/react/act.ts +105 -0
- package/src/react/action-scope.ts +57 -0
- package/src/react/activity.ts +10 -0
- package/src/react/children.ts +86 -0
- package/src/react/class.ts +66 -0
- package/src/react/compiler-runtime.ts +8 -0
- package/src/react/context.ts +46 -0
- package/src/react/element.ts +82 -0
- package/src/react/form-state.ts +35 -0
- package/src/react/hooks.ts +214 -0
- package/src/react/index.ts +91 -0
- package/src/react/jsx-runtime.ts +50 -0
- package/src/react/memo.ts +42 -0
- package/src/react/portal.ts +1 -0
- package/src/react/shared-internals.ts +80 -0
- package/src/react/suspense.ts +18 -0
- package/src/react/thenable.ts +21 -0
- package/src/react/view-transition.ts +41 -0
- package/src/scheduler/index.ts +124 -0
- package/src/server/bootstrap-script.ts +92 -0
- package/src/server/dispatcher.ts +168 -0
- package/src/server/escape.ts +102 -0
- package/src/server/index.ts +26 -0
- package/src/server/insertion-context.ts +28 -0
- package/src/server/renderToString.ts +35 -0
- package/src/server/resource-hints.ts +166 -0
- package/src/server/stream-ids.ts +5 -0
- package/src/server/stream.ts +525 -0
- package/src/server/walk.ts +555 -0
- package/src/vinext/compatibility.ts +122 -0
- package/src/vinext/flight-timing.ts +37 -0
- package/src/vinext/index.ts +47 -0
- package/src/vite/index.ts +476 -0
- package/src/vite/react18.ts +74 -0
- package/vendor/cloudflare-vite-plugin/LICENSE +25 -0
- package/vendor/cloudflare-vite-plugin/README.md +9 -0
- package/vendor/cloudflare-vite-plugin/dist/chunk-U6NEESU5-BmLHqeIt.mjs +43 -0
- package/vendor/cloudflare-vite-plugin/dist/index.d.mts +155 -0
- package/vendor/cloudflare-vite-plugin/dist/index.mjs +94700 -0
- package/vendor/cloudflare-vite-plugin/dist/open-PCXX3ZDZ-DYH87NhH.mjs +530 -0
- package/vendor/cloudflare-vite-plugin/dist/package-4cnqy5mM.mjs +84 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/asset-worker/index.js +5996 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/router-worker/index.js +6414 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/index.js +457 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner-legacy.js +1129 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner.js +1259 -0
- package/vendor/cloudflare-vite-plugin/dist/workers/vite-proxy-worker/index.js +31 -0
- package/vendor/cloudflare-vite-plugin/package.json +90 -0
- package/vendor/cloudflare-vite-plugin/provenance.json +26 -0
- package/README.md +0 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isFunction } from '../core/functions'
|
|
2
|
+
import { FiberTag, type Fiber } from '../core'
|
|
3
|
+
|
|
4
|
+
export function componentStack(fiber: Fiber | null): string {
|
|
5
|
+
let stack = ''
|
|
6
|
+
for (; fiber; fiber = fiber.p) {
|
|
7
|
+
let type = fiber.type
|
|
8
|
+
while (type && isObject(type)) type = type.type || type.render
|
|
9
|
+
const name = isString(type) ? type
|
|
10
|
+
: isFunction(type) ? type.displayName || type.name || 'Anonymous'
|
|
11
|
+
: fiber.t === FiberTag.Suspense ? 'Suspense'
|
|
12
|
+
: fiber.t === FiberTag.Activity ? 'Activity' : ''
|
|
13
|
+
if (name) stack += '\n at ' + name
|
|
14
|
+
}
|
|
15
|
+
return stack
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
import { isString } from "../core/functions"
|
|
19
|
+
|
|
20
|
+
import { isObject } from '../core/functions'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drain the `window.$RE_q` event buffer that the inline runtime populated
|
|
3
|
+
* before the main bundle was parsed. For each buffered event, re-dispatch a
|
|
4
|
+
* synthesized event at the original target so handlers attached during
|
|
5
|
+
* hydration see it.
|
|
6
|
+
*
|
|
7
|
+
* Lossy by design: only the event type and target are preserved. Modifier
|
|
8
|
+
* keys, pointer positions, etc. are zeroed. This is acceptable because the
|
|
9
|
+
* replay window is a fraction of a second between shell render and full
|
|
10
|
+
* hydration of a streaming page; users who need pixel-accurate replay won't
|
|
11
|
+
* lose much beyond that.
|
|
12
|
+
*/
|
|
13
|
+
export function drainReplayQueue(): void {
|
|
14
|
+
const g = globalThis as any
|
|
15
|
+
const q = g.$RE_q as Array<[string, EventTarget, number]> | undefined
|
|
16
|
+
|
|
17
|
+
if (!q) return
|
|
18
|
+
// Stop capturing before replaying so we don't re-capture what we dispatch.
|
|
19
|
+
try {
|
|
20
|
+
g.$RE_stop?.()
|
|
21
|
+
} catch {}
|
|
22
|
+
|
|
23
|
+
for (const [type, target] of q.splice(0)) {
|
|
24
|
+
try {
|
|
25
|
+
target.dispatchEvent(createEvent(type))
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createEvent(type: string): Event {
|
|
31
|
+
const options = { bubbles: true, cancelable: true }
|
|
32
|
+
return type === 'click'
|
|
33
|
+
? new MouseEvent(type, options)
|
|
34
|
+
: type === 'keydown'
|
|
35
|
+
? new KeyboardEvent(type, options)
|
|
36
|
+
: type === 'input'
|
|
37
|
+
? new InputEvent(type, options)
|
|
38
|
+
: new Event(type, options)
|
|
39
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { onCommitRollback, queueMutation } from '../../commit';
|
|
2
|
+
import { REACT_ACTIVITY_TYPE } from '../../../react/activity';
|
|
3
|
+
import { attachRef, childrenToArray, detachRef, enqueueEffect, findRoot, flushFiberCommits, getCurrentRoot, invokeCommit, installCapability, reconcileRaw, installRenderer, registerTypeMatcher, scheduleLifecycle, scheduleUpdate, } from '../../reconcile';
|
|
4
|
+
import { disconnectClass, inSuspensePrimary, setRetainedFlag, walkRetained as walk } from '../../retained-effects';
|
|
5
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
6
|
+
function isHidden(fiber: Fiber): boolean {
|
|
7
|
+
if (!(fiber.r ?? findRoot(fiber))?.a)
|
|
8
|
+
return false;
|
|
9
|
+
for (let parent: Fiber | null = fiber; parent; parent = parent.p) {
|
|
10
|
+
if (parent.t === FiberTag.Activity && parent.v?.mode === 'hidden')
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
function renderActivity(fiber: Fiber): void {
|
|
16
|
+
const root = fiber.r ?? findRoot(fiber);
|
|
17
|
+
if (root)
|
|
18
|
+
root.a = true;
|
|
19
|
+
const props = fiber.v ?? {};
|
|
20
|
+
// Hidden content is absent from server HTML. Mount it after hydration so it
|
|
21
|
+
// cannot consume a following visible sibling's hydration cursor.
|
|
22
|
+
if (getCurrentRoot()?.h && props.mode === 'hidden' && !fiber.m) {
|
|
23
|
+
fiber.m = props;
|
|
24
|
+
queueMicrotask(() => scheduleUpdate(fiber));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (isHidden(fiber))
|
|
28
|
+
walk(fiber, prepare);
|
|
29
|
+
else
|
|
30
|
+
walk(fiber, syncDom);
|
|
31
|
+
reconcileRaw(fiber, props.children);
|
|
32
|
+
walk(fiber, reconnect, true);
|
|
33
|
+
fiber.m = props;
|
|
34
|
+
}
|
|
35
|
+
function needsHiddenDom(fiber: Fiber): boolean {
|
|
36
|
+
for (let parent = fiber.p; parent; parent = parent.p) {
|
|
37
|
+
if (parent.t === FiberTag.Activity && parent.v?.mode === 'hidden')
|
|
38
|
+
return true;
|
|
39
|
+
if (parent.t === FiberTag.Host)
|
|
40
|
+
return false;
|
|
41
|
+
// A portal starts a new DOM tree, but keeps the parent's Activity state.
|
|
42
|
+
if (parent.t === FiberTag.Portal)
|
|
43
|
+
return isHidden(parent);
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
function finish(fiber: Fiber): void {
|
|
48
|
+
if (fiber.t === FiberTag.Suspense && (fiber.r ?? findRoot(fiber))?.a)
|
|
49
|
+
walk(fiber, reconnect, true);
|
|
50
|
+
else
|
|
51
|
+
syncDom(fiber);
|
|
52
|
+
}
|
|
53
|
+
function prepare(fiber: Fiber): void {
|
|
54
|
+
if (!isHidden(fiber) || !!fiber.ad)
|
|
55
|
+
return;
|
|
56
|
+
if (fiber.m == null)
|
|
57
|
+
setRetainedFlag(fiber, 'ad', true);
|
|
58
|
+
else
|
|
59
|
+
disconnect(fiber);
|
|
60
|
+
}
|
|
61
|
+
function disconnect(fiber: Fiber): void {
|
|
62
|
+
if (!!fiber.ad)
|
|
63
|
+
return;
|
|
64
|
+
setRetainedFlag(fiber, 'ad', true);
|
|
65
|
+
queueMutation(() => {
|
|
66
|
+
// Insertion effects remain connected, just as they do in React.
|
|
67
|
+
const insertion = new Set<() => void>();
|
|
68
|
+
for (const [hook, effect] of fiber.ef ?? []) {
|
|
69
|
+
if (effect.t === 2 && hook.c)
|
|
70
|
+
insertion.add(hook.c);
|
|
71
|
+
}
|
|
72
|
+
if (fiber.e) {
|
|
73
|
+
const keep = fiber.e.filter(cleanup => insertion.has(cleanup));
|
|
74
|
+
for (const cleanup of fiber.e) {
|
|
75
|
+
if (!insertion.has(cleanup))
|
|
76
|
+
invokeCommit(fiber, cleanup);
|
|
77
|
+
}
|
|
78
|
+
fiber.e = keep.length ? keep : null;
|
|
79
|
+
}
|
|
80
|
+
for (const [hook, effect] of fiber.ef ?? []) {
|
|
81
|
+
if (effect.t !== 2)
|
|
82
|
+
hook.c = null;
|
|
83
|
+
}
|
|
84
|
+
detachRef(fiber.cr ?? fiber.ref);
|
|
85
|
+
fiber.cr = null;
|
|
86
|
+
fiber.rc = null;
|
|
87
|
+
if (!fiber.ld)
|
|
88
|
+
disconnectClass(fiber);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function reconnect(fiber: Fiber): void {
|
|
92
|
+
syncDom(fiber);
|
|
93
|
+
if (isHidden(fiber) || inSuspensePrimary(fiber) || !setRetainedFlag(fiber, 'ad', false))
|
|
94
|
+
return;
|
|
95
|
+
setRetainedFlag(fiber, 'ld', false);
|
|
96
|
+
const instance = fiber.i?._f === fiber ? fiber.i : null;
|
|
97
|
+
if (fiber.t === FiberTag.Host || fiber.t === FiberTag.Resource)
|
|
98
|
+
attachRef(fiber, fiber.n);
|
|
99
|
+
else if (instance || fiber.t === FiberTag.Fragment)
|
|
100
|
+
attachRef(fiber, fiber.i);
|
|
101
|
+
for (const effect of fiber.ef?.values() ?? []) {
|
|
102
|
+
if (effect.t !== 2)
|
|
103
|
+
enqueueEffect(fiber, effect);
|
|
104
|
+
}
|
|
105
|
+
if (instance?.componentDidMount) {
|
|
106
|
+
scheduleLifecycle(fiber, () => instance.componentDidMount());
|
|
107
|
+
}
|
|
108
|
+
flushFiberCommits(fiber);
|
|
109
|
+
}
|
|
110
|
+
function syncDom(fiber: Fiber): void {
|
|
111
|
+
if (!(fiber.r ?? findRoot(fiber))?.a)
|
|
112
|
+
return;
|
|
113
|
+
if (!fiber.n || (fiber.t !== FiberTag.Host && fiber.t !== FiberTag.Text))
|
|
114
|
+
return;
|
|
115
|
+
if (needsHiddenDom(fiber)) {
|
|
116
|
+
setRetainedFlag(fiber, 'ah', true);
|
|
117
|
+
queueMutation(() => {
|
|
118
|
+
if (fiber.t === FiberTag.Text)
|
|
119
|
+
fiber.n!.nodeValue = '';
|
|
120
|
+
else
|
|
121
|
+
(fiber.n as HTMLElement).style.setProperty('display', 'none', 'important');
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else if (setRetainedFlag(fiber, 'ah', false)) {
|
|
125
|
+
// A Suspense fallback can remain active after its Activity is revealed.
|
|
126
|
+
// Its preserved primary DOM must stay hidden until that boundary resumes.
|
|
127
|
+
for (let parent = fiber.p; parent; parent = parent.p) {
|
|
128
|
+
if (parent.t === FiberTag.Suspense && parent.b?.d?.some(([node]: [
|
|
129
|
+
Node,
|
|
130
|
+
string
|
|
131
|
+
]) => node === fiber.n))
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const props = fiber.v;
|
|
135
|
+
queueMutation(() => {
|
|
136
|
+
if (fiber.t === FiberTag.Text)
|
|
137
|
+
fiber.n!.nodeValue = props;
|
|
138
|
+
else {
|
|
139
|
+
const display = props?.style?.display;
|
|
140
|
+
(fiber.n as HTMLElement).style.display = display == null || typeof display === 'boolean' ? '' : ('' + display).trim();
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
installCapability('i', isHidden);
|
|
146
|
+
installCapability('d', fiber => !!fiber.ad);
|
|
147
|
+
installCapability('p', prepare);
|
|
148
|
+
installCapability('s', finish);
|
|
149
|
+
registerTypeMatcher(type => type === REACT_ACTIVITY_TYPE ? FiberTag.Activity : null);
|
|
150
|
+
installRenderer(FiberTag.Activity, renderActivity);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './full'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
2
|
+
import { REACT_ACTIVITY_TYPE } from '../../../react/activity';
|
|
3
|
+
import { childrenToArray, reconcileRaw, installRenderer, registerTypeMatcher } from '../../reconcile';
|
|
4
|
+
// Explicit small-preset downgrade: hidden children unmount instead of being
|
|
5
|
+
// retained. Showing them again creates fresh state, DOM, effects, and refs.
|
|
6
|
+
function renderActivity(fiber: Fiber): void {
|
|
7
|
+
const props = fiber.v ?? {};
|
|
8
|
+
reconcileRaw(fiber, props.mode === 'hidden' ? null : props.children);
|
|
9
|
+
fiber.m = props;
|
|
10
|
+
}
|
|
11
|
+
registerTypeMatcher(type => type === REACT_ACTIVITY_TYPE ? FiberTag.Activity : null);
|
|
12
|
+
installRenderer(FiberTag.Activity, renderActivity);
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { devToolsMetadata } from '../../../core/devtools';
|
|
2
|
+
import { resolveClassProps } from '../../../core/class-props';
|
|
3
|
+
import { invokeCommit, stageCommit, recoveringBoundaries } from '../../reconcile';
|
|
4
|
+
import { installRenderer, reconcileRaw, childrenToArray, scheduleUpdate, scheduleLifecycle, isThenable, handleSuspended, handleErrorInRender, readContext, attachRef, syncRefIfChanged, isActivityHidden, layoutIsDisconnected, RenderErrorCapture, handleCommitError, } from '../../reconcile';
|
|
5
|
+
import { checkpointCommit, rewindCommit, queueBeforeMutation, queueMutation } from '../../commit';
|
|
6
|
+
import { FiberTag, type Fiber, type ReactNode } from '../../../core';
|
|
7
|
+
import { failRefreshBoundary } from '../../refresh';
|
|
8
|
+
import { isFunction } from '../../../core/functions';
|
|
9
|
+
import { q as queueTransition, r as reduceTransition } from '../suspense-runtime';
|
|
10
|
+
import { devToolsError, markDevToolsError, markDevToolsClassUpdate, consumeDevToolsClassUpdate } from '../../devtools';
|
|
11
|
+
function findHost(fiber: Fiber): Node | null {
|
|
12
|
+
if (fiber.t <= FiberTag.Text)
|
|
13
|
+
return fiber.n;
|
|
14
|
+
if (fiber.t === FiberTag.Resource)
|
|
15
|
+
return fiber.i;
|
|
16
|
+
for (let child = fiber.c; child; child = child.s) {
|
|
17
|
+
const node = findHost(child);
|
|
18
|
+
if (node)
|
|
19
|
+
return node;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
installRenderer(FiberTag.Class, renderClass);
|
|
24
|
+
export function findDOMNode(instance: any): Node | null {
|
|
25
|
+
const fiber = instance._f as Fiber | undefined;
|
|
26
|
+
if (!fiber || fiber.u)
|
|
27
|
+
throw new Error(process.env.NODE_ENV !== 'production' ? 'Unable to find node on an unmounted component.' : '');
|
|
28
|
+
return findHost(fiber);
|
|
29
|
+
}
|
|
30
|
+
function renderClass(fiber: Fiber): void {
|
|
31
|
+
fiber.cx?.clear();
|
|
32
|
+
const Ctor = fiber.type as any;
|
|
33
|
+
let instance = fiber.i;
|
|
34
|
+
const props = resolveClassProps(Ctor, fiber.v ?? {});
|
|
35
|
+
const isNew = !instance;
|
|
36
|
+
const previous = fiber.b?.c;
|
|
37
|
+
let didRender = true;
|
|
38
|
+
let captured = fiber.b?.error instanceof RenderErrorCapture ? fiber.b.error as RenderErrorCapture : undefined;
|
|
39
|
+
if (captured)
|
|
40
|
+
delete fiber.b.error;
|
|
41
|
+
// Class contextType: read the current value of the subscribed context so
|
|
42
|
+
// `this.context` reflects the nearest Provider. Evaluated every render.
|
|
43
|
+
const ctxValue = Ctor.contextType ? readContext(fiber, Ctor.contextType) : undefined;
|
|
44
|
+
const contextChanged = instance && !Object.is(instance.context, ctxValue);
|
|
45
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
46
|
+
const override = devToolsError(fiber);
|
|
47
|
+
if (override === true) captured = new RenderErrorCapture(fiber, new Error('Simulated error coming from DevTools'));
|
|
48
|
+
else if (override === false && instance) {
|
|
49
|
+
instance.state = { ...instance.state, ...new Ctor(fiber.m ?? props, instance.context).state };
|
|
50
|
+
captured = undefined;
|
|
51
|
+
markDevToolsClassUpdate(fiber);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (isNew) {
|
|
55
|
+
instance = new Ctor(props, ctxValue);
|
|
56
|
+
instance.props = props;
|
|
57
|
+
instance.context = ctxValue;
|
|
58
|
+
instance._f = fiber;
|
|
59
|
+
instance._q = (updater: any, cb?: () => void) => {
|
|
60
|
+
if (queueTransition) {
|
|
61
|
+
const hook = (fiber.h ||= [{ s: instance.state, d: undefined, c: null, q: undefined }])[0]!;
|
|
62
|
+
if (!hook.t)
|
|
63
|
+
hook.s = instance.state;
|
|
64
|
+
if (queueTransition(hook, fiber, [updater, cb]))
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
instance.state = updateState(instance.state, updater, instance.props);
|
|
68
|
+
instance._u(cb);
|
|
69
|
+
};
|
|
70
|
+
instance._u = (cb?: () => void) => {
|
|
71
|
+
if (cb)
|
|
72
|
+
stageCommit(fiber, () => cb.call(instance), true);
|
|
73
|
+
scheduleUpdate(fiber);
|
|
74
|
+
};
|
|
75
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
76
|
+
const forceUpdate = instance.forceUpdate;
|
|
77
|
+
instance.forceUpdate = (...args: any[]) => { markDevToolsClassUpdate(fiber); forceUpdate.apply(instance, args); };
|
|
78
|
+
}
|
|
79
|
+
fiber.i = instance;
|
|
80
|
+
}
|
|
81
|
+
if (fiber.h && reduceTransition?.(fiber.h[0]!, (state, update) => {
|
|
82
|
+
if (update[1])
|
|
83
|
+
stageCommit(fiber, () => { const callback = update[1]; update[1] = null; callback?.call(instance); }, true);
|
|
84
|
+
return updateState(state, update[0], props);
|
|
85
|
+
}))
|
|
86
|
+
instance.state = fiber.h[0]!.s;
|
|
87
|
+
instance.context = ctxValue;
|
|
88
|
+
if (Ctor.getDerivedStateFromProps) {
|
|
89
|
+
const d = Ctor.getDerivedStateFromProps(props, instance.state);
|
|
90
|
+
if (d)
|
|
91
|
+
instance.state = { ...instance.state, ...d };
|
|
92
|
+
}
|
|
93
|
+
if (!isNew) {
|
|
94
|
+
if (!(process.env.NODE_ENV !== 'production' && consumeDevToolsClassUpdate(fiber)) && !captured && instance.shouldComponentUpdate && !contextChanged) {
|
|
95
|
+
if (!instance.shouldComponentUpdate(props, instance.state, instance.context)) {
|
|
96
|
+
didRender = false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
instance.props = props;
|
|
100
|
+
}
|
|
101
|
+
// Errors from a recovery tree belong to an enclosing boundary. A nested
|
|
102
|
+
// boundary introduced by that recovery remains eligible to catch them.
|
|
103
|
+
if (captured) recoveringBoundaries.add(fiber);
|
|
104
|
+
try {
|
|
105
|
+
if (captured && Ctor.getDerivedStateFromError) {
|
|
106
|
+
const update = Ctor.getDerivedStateFromError(captured.e);
|
|
107
|
+
if (update != null)
|
|
108
|
+
instance.state = { ...instance.state, ...update };
|
|
109
|
+
}
|
|
110
|
+
let rendered: ReactNode = captured && !Ctor.getDerivedStateFromError ? null : didRender ? instance.render() : fiber.b?.r;
|
|
111
|
+
fiber.b = { ...(fiber.b ?? {}), r: rendered };
|
|
112
|
+
const canCatch = Ctor.getDerivedStateFromError || instance.componentDidCatch;
|
|
113
|
+
if (canCatch)
|
|
114
|
+
fiber.b.b = Ctor;
|
|
115
|
+
if (canCatch && fiber.r)
|
|
116
|
+
fiber.r.eb = true;
|
|
117
|
+
const checkpoint = canCatch ? checkpointCommit(fiber) : -1;
|
|
118
|
+
try {
|
|
119
|
+
reconcileRaw(fiber, rendered);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (!(error instanceof RenderErrorCapture) || error.b !== fiber)
|
|
123
|
+
throw error;
|
|
124
|
+
rewindCommit(checkpoint);
|
|
125
|
+
captured = error;
|
|
126
|
+
recoveringBoundaries.add(fiber);
|
|
127
|
+
didRender = true;
|
|
128
|
+
if (Ctor.getDerivedStateFromError) {
|
|
129
|
+
const update = Ctor.getDerivedStateFromError(error.e);
|
|
130
|
+
if (update != null)
|
|
131
|
+
instance.state = { ...instance.state, ...update };
|
|
132
|
+
rendered = instance.render();
|
|
133
|
+
}
|
|
134
|
+
else
|
|
135
|
+
rendered = null;
|
|
136
|
+
fiber.b = { ...(fiber.b ?? {}), r: rendered };
|
|
137
|
+
reconcileRaw(fiber, rendered);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
recoveringBoundaries.delete(fiber);
|
|
142
|
+
}
|
|
143
|
+
fiber.m = props;
|
|
144
|
+
const state = instance.state;
|
|
145
|
+
queueMutation(() => { fiber.b.c = { p: props, s: state }; });
|
|
146
|
+
if (isNew)
|
|
147
|
+
attachRef(fiber, instance);
|
|
148
|
+
else
|
|
149
|
+
syncRefIfChanged(fiber, instance);
|
|
150
|
+
// Schedule lifecycle
|
|
151
|
+
if (isNew) {
|
|
152
|
+
if (instance.componentDidMount) {
|
|
153
|
+
scheduleLifecycle(fiber, () => instance.componentDidMount());
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else if (previous && didRender) {
|
|
157
|
+
let snapshot: any;
|
|
158
|
+
if (instance.getSnapshotBeforeUpdate && !layoutIsDisconnected(fiber)) {
|
|
159
|
+
queueBeforeMutation(() => {
|
|
160
|
+
if (!fiber.u && !fiber.pd && !isActivityHidden(fiber) && !layoutIsDisconnected(fiber)) {
|
|
161
|
+
snapshot = invokeCommit(fiber, () => instance.getSnapshotBeforeUpdate(previous.p, previous.s));
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (instance.componentDidUpdate) {
|
|
166
|
+
scheduleLifecycle(fiber, () => instance.componentDidUpdate(previous.p, previous.s, snapshot));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (captured) {
|
|
170
|
+
if (process.env.NODE_ENV !== 'production') markDevToolsError(fiber);
|
|
171
|
+
if (process.env.NODE_ENV !== 'production')
|
|
172
|
+
failRefreshBoundary(fiber);
|
|
173
|
+
const error = captured.e;
|
|
174
|
+
const info = { componentStack: captured.s };
|
|
175
|
+
scheduleLifecycle(fiber, () => {
|
|
176
|
+
const previousCurrent = process.env.NODE_ENV !== 'production' ? devToolsMetadata.current : null;
|
|
177
|
+
const previousStack = process.env.NODE_ENV !== 'production' ? devToolsMetadata.errorStack : undefined;
|
|
178
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
179
|
+
devToolsMetadata.current = null;
|
|
180
|
+
devToolsMetadata.errorStack = captured!.o ?? null;
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
try {
|
|
184
|
+
fiber.r?.ce?.(error, { ...info, errorBoundary: instance });
|
|
185
|
+
}
|
|
186
|
+
catch (callbackError) {
|
|
187
|
+
setTimeout(() => { throw callbackError; });
|
|
188
|
+
}
|
|
189
|
+
instance.componentDidCatch?.(error, info);
|
|
190
|
+
} finally {
|
|
191
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
192
|
+
devToolsMetadata.current = previousCurrent;
|
|
193
|
+
devToolsMetadata.errorStack = previousStack;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function updateState(state: any, update: any, props: any): any {
|
|
200
|
+
const next = isFunction(update) ? update(state, props) : update;
|
|
201
|
+
return next == null ? state : { ...state, ...next };
|
|
202
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './full'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { resolveClassProps } from '../../../core/class-props';
|
|
2
|
+
import { isFunction } from '../../../core/functions';
|
|
3
|
+
import { FiberTag, type Fiber, type ReactNode } from '../../../core';
|
|
4
|
+
import { installRenderer, reconcileRaw, childrenToArray, scheduleUpdate, isThenable, handleSuspended, deferHydration, handleErrorInRender, } from '../../reconcile';
|
|
5
|
+
// Stub: Class feature disabled. Class components still render — they're
|
|
6
|
+
// detected by `type.prototype.isReactComponent` in the reconciler regardless —
|
|
7
|
+
// but ONLY the core contract is honored: constructor, `render()`, and
|
|
8
|
+
// `setState` triggering a re-render. Dropped from this stub:
|
|
9
|
+
// - `contextType` (this.context is always undefined)
|
|
10
|
+
// - `getDerivedStateFromProps`
|
|
11
|
+
// - `shouldComponentUpdate`
|
|
12
|
+
// - `componentDidMount` / `componentDidUpdate` / `componentWillUnmount`
|
|
13
|
+
// - `getDerivedStateFromError` / `componentDidCatch` (error boundaries)
|
|
14
|
+
// Apps that actually need these should keep the feature on. Apps that just
|
|
15
|
+
// have a handful of legacy class components that do `render() + setState`
|
|
16
|
+
// still work, and save ~400 B min / ~200 B gz.
|
|
17
|
+
function renderClassStub(fiber: Fiber): void {
|
|
18
|
+
const Ctor = fiber.type as any;
|
|
19
|
+
let instance = fiber.i;
|
|
20
|
+
const props = resolveClassProps(Ctor, fiber.v ?? {});
|
|
21
|
+
if (!instance) {
|
|
22
|
+
instance = new Ctor(props, undefined);
|
|
23
|
+
instance.props = props;
|
|
24
|
+
instance._f = fiber;
|
|
25
|
+
instance._q = (updater: any, cb?: () => void) => {
|
|
26
|
+
const next = isFunction(updater) ? updater(instance.state, instance.props) : updater;
|
|
27
|
+
if (next != null)
|
|
28
|
+
instance.state = { ...instance.state, ...next };
|
|
29
|
+
if (cb)
|
|
30
|
+
(fiber.e ||= []).push(cb);
|
|
31
|
+
scheduleUpdate(fiber);
|
|
32
|
+
};
|
|
33
|
+
instance._u = instance._q;
|
|
34
|
+
fiber.i = instance;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
instance.props = props;
|
|
38
|
+
}
|
|
39
|
+
let rendered: ReactNode;
|
|
40
|
+
try {
|
|
41
|
+
rendered = instance.render();
|
|
42
|
+
}
|
|
43
|
+
catch (e: any) {
|
|
44
|
+
if (isThenable(e)) {
|
|
45
|
+
if (deferHydration(fiber, e)) return;
|
|
46
|
+
handleSuspended(fiber, e);
|
|
47
|
+
rendered = null;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
handleErrorInRender(fiber, e);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
reconcileRaw(fiber, rendered);
|
|
55
|
+
fiber.m = props;
|
|
56
|
+
}
|
|
57
|
+
installRenderer(FiberTag.Class, renderClassStub);
|
|
58
|
+
export const findDOMNode = null;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { isFunction } from '../../../core/functions';
|
|
2
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
3
|
+
import { REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE } from '../../../react';
|
|
4
|
+
import { installRenderer, registerTypeMatcher, installCapability, reconcileRaw, childrenToArray, renderNode, getHostParent, } from '../../reconcile';
|
|
5
|
+
let changingProviders = 0;
|
|
6
|
+
function contextValue(fiber: Fiber, ctx: any): any {
|
|
7
|
+
let p: Fiber | null = fiber.p;
|
|
8
|
+
while (p) {
|
|
9
|
+
if (p.t === FiberTag.Provider && (p.type as any)._context === ctx) {
|
|
10
|
+
return p.v?.value;
|
|
11
|
+
}
|
|
12
|
+
p = p.p;
|
|
13
|
+
}
|
|
14
|
+
return ctx._currentValue;
|
|
15
|
+
}
|
|
16
|
+
function remember(fiber: Fiber, ctx: any, value: any): void {
|
|
17
|
+
;
|
|
18
|
+
(fiber.cx ??= new Map()).set(ctx, value);
|
|
19
|
+
}
|
|
20
|
+
function realReadContext(fiber: Fiber, ctx: any): any {
|
|
21
|
+
const value = contextValue(fiber, ctx);
|
|
22
|
+
remember(fiber, ctx, value);
|
|
23
|
+
// Initial suspended attempts are discarded. Keep their external context
|
|
24
|
+
// reads on the boundary so a provider can retry them before a promise settles.
|
|
25
|
+
let child = fiber;
|
|
26
|
+
let p = fiber.p;
|
|
27
|
+
while (p) {
|
|
28
|
+
if (p.t === FiberTag.Provider && p.type._context === ctx)
|
|
29
|
+
break;
|
|
30
|
+
if (p.t === FiberTag.Suspense && p.b?.f !== child)
|
|
31
|
+
remember(p, ctx, value);
|
|
32
|
+
child = p;
|
|
33
|
+
p = p.p;
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
export function ownContextChanged(fiber: Fiber): boolean {
|
|
38
|
+
if (!changingProviders)
|
|
39
|
+
return false;
|
|
40
|
+
const reads = fiber.cx;
|
|
41
|
+
if (reads) {
|
|
42
|
+
for (const [ctx, value] of reads) {
|
|
43
|
+
if (!Object.is(value, contextValue(fiber, ctx)))
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
export function hasContextChanged(fiber: Fiber, includeFallback = true): boolean {
|
|
50
|
+
if (!changingProviders)
|
|
51
|
+
return false;
|
|
52
|
+
if (ownContextChanged(fiber))
|
|
53
|
+
return true;
|
|
54
|
+
let child = fiber.c;
|
|
55
|
+
while (child) {
|
|
56
|
+
if (hasContextChanged(child))
|
|
57
|
+
return true;
|
|
58
|
+
child = child.s;
|
|
59
|
+
}
|
|
60
|
+
return includeFallback && fiber.t === FiberTag.Suspense && !!fiber.b?.f && hasContextChanged(fiber.b.f);
|
|
61
|
+
}
|
|
62
|
+
export function renderContextConsumers(fiber: Fiber): void {
|
|
63
|
+
if (!changingProviders)
|
|
64
|
+
return;
|
|
65
|
+
let child = fiber.c;
|
|
66
|
+
while (child) {
|
|
67
|
+
// Pending parents must reconcile before context reaches their old children.
|
|
68
|
+
if (child.g || (child.t === FiberTag.Suspense ? hasContextChanged(child) : ownContextChanged(child))) {
|
|
69
|
+
renderNode(child);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
renderContextConsumers(child);
|
|
73
|
+
}
|
|
74
|
+
child = child.s;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function renderProvider(fiber: Fiber): void {
|
|
78
|
+
const props = fiber.v ?? {};
|
|
79
|
+
const changed = fiber.m && !Object.is(fiber.m.value, props.value);
|
|
80
|
+
if (changed)
|
|
81
|
+
changingProviders++;
|
|
82
|
+
try {
|
|
83
|
+
reconcileRaw(fiber, props.children);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
if (changed)
|
|
87
|
+
changingProviders--;
|
|
88
|
+
}
|
|
89
|
+
fiber.m = props;
|
|
90
|
+
}
|
|
91
|
+
function renderConsumer(fiber: Fiber): void {
|
|
92
|
+
fiber.cx?.clear();
|
|
93
|
+
const props = fiber.v ?? {};
|
|
94
|
+
const children = props.children;
|
|
95
|
+
const value = realReadContext(fiber, (fiber.type as any)._context);
|
|
96
|
+
const rendered = isFunction(children) ? children(value) : null;
|
|
97
|
+
reconcileRaw(fiber, rendered);
|
|
98
|
+
fiber.m = props;
|
|
99
|
+
}
|
|
100
|
+
registerTypeMatcher((_type, marker) => marker === REACT_CONTEXT_TYPE || marker === REACT_PROVIDER_TYPE
|
|
101
|
+
? FiberTag.Provider
|
|
102
|
+
: marker === REACT_CONSUMER_TYPE
|
|
103
|
+
? FiberTag.Consumer
|
|
104
|
+
: null);
|
|
105
|
+
installRenderer(FiberTag.Provider, renderProvider);
|
|
106
|
+
installRenderer(FiberTag.Consumer, renderConsumer);
|
|
107
|
+
installCapability('c', realReadContext);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './full'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isFunction } from '../../../core/functions';
|
|
2
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
3
|
+
import { REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE, REACT_CONSUMER_TYPE } from '../../../react';
|
|
4
|
+
import { installRenderer, registerTypeMatcher, reconcileRaw, childrenToArray, } from '../../reconcile';
|
|
5
|
+
export const hasContextChanged: (_f: Fiber, _includeFallback?: boolean) => boolean = () => false;
|
|
6
|
+
export const ownContextChanged = hasContextChanged;
|
|
7
|
+
export function renderContextConsumers(_f: Fiber): void { }
|
|
8
|
+
// Stub: Context feature disabled. Provider elements render as Fragments
|
|
9
|
+
// (value is never propagated — descendants see only the Context's default).
|
|
10
|
+
// Consumer elements still invoke their function-children with the default
|
|
11
|
+
// value, so `<Ctx.Consumer>{v => ...}</Ctx.Consumer>` patterns keep working.
|
|
12
|
+
// The default `readContext` capability returns `ctx._currentValue` without
|
|
13
|
+
// walking, which matches the no-Provider-fibers-in-tree reality.
|
|
14
|
+
function renderConsumerStub(fiber: Fiber): void {
|
|
15
|
+
const props = fiber.v ?? {};
|
|
16
|
+
const rendered = isFunction(props.children)
|
|
17
|
+
? props.children((fiber.type as any)._context._currentValue) : null;
|
|
18
|
+
reconcileRaw(fiber, rendered);
|
|
19
|
+
fiber.m = props;
|
|
20
|
+
}
|
|
21
|
+
registerTypeMatcher((_type, marker) => marker === REACT_CONTEXT_TYPE || marker === REACT_PROVIDER_TYPE
|
|
22
|
+
? FiberTag.Fragment
|
|
23
|
+
: marker === REACT_CONSUMER_TYPE
|
|
24
|
+
? FiberTag.Consumer
|
|
25
|
+
: null);
|
|
26
|
+
installRenderer(FiberTag.Consumer, renderConsumerStub);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
2
|
+
import { REACT_FORWARD_REF_TYPE } from '../../../react';
|
|
3
|
+
import { installRenderer, registerTypeMatcher, renderFunction } from '../../reconcile';
|
|
4
|
+
function renderForwardRef(fiber: Fiber): void {
|
|
5
|
+
const { ref, ...props } = fiber.v ?? {};
|
|
6
|
+
renderFunction(fiber, fiber.type.render, props, fiber.ref ?? ref ?? null);
|
|
7
|
+
}
|
|
8
|
+
registerTypeMatcher((_type, marker) => marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null);
|
|
9
|
+
installRenderer(FiberTag.ForwardRef, renderForwardRef);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './full'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FiberTag, type Fiber } from '../../../core';
|
|
2
|
+
import { REACT_FORWARD_REF_TYPE } from '../../../react';
|
|
3
|
+
import { installRenderer, registerTypeMatcher, delegateFiber } from '../../reconcile';
|
|
4
|
+
// Stub: ForwardRef feature disabled. `forwardRef(fn)` elements still render,
|
|
5
|
+
// but the ref prop is NOT forwarded — the component is called as a plain
|
|
6
|
+
// function with just props. React 19+ supports refs as normal props on
|
|
7
|
+
// function components, so most apps can drop forwardRef entirely; this stub
|
|
8
|
+
// preserves JSX compatibility while stripping the dispatcher save/restore
|
|
9
|
+
// machinery.
|
|
10
|
+
function renderForwardRefStub(fiber: Fiber): void {
|
|
11
|
+
const render = (fiber.type as any).render;
|
|
12
|
+
delegateFiber(fiber, render);
|
|
13
|
+
}
|
|
14
|
+
registerTypeMatcher((_type, marker) => marker === REACT_FORWARD_REF_TYPE ? FiberTag.ForwardRef : null);
|
|
15
|
+
installRenderer(FiberTag.ForwardRef, renderForwardRefStub);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createFragmentInstance, updateFragmentHost, refreshFragmentInstances, commitFragmentRef, placeFragmentCommits } from '../../fragment-instance'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const createFragmentInstance: (_f: unknown) => any = () => null
|
|
2
|
+
export function updateFragmentHost(_f: unknown, _adding: boolean): void {}
|
|
3
|
+
export function refreshFragmentInstances(_root: unknown): void {}
|
|
4
|
+
|
|
5
|
+
export function commitFragmentRef(_f: unknown, _phase = 0): void {}
|
|
6
|
+
export function placeFragmentCommits(_f: unknown, _entries: unknown, _pending: unknown): boolean | void {}
|