@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,171 @@
|
|
|
1
|
+
import { isFunction } from '../core/functions'
|
|
2
|
+
import { FiberTag, type Fiber, type FiberRoot, type ReactNode } from '../core'
|
|
3
|
+
import { REACT_FORWARD_REF_TYPE, REACT_MEMO_TYPE, REACT_LAZY_TYPE, ReactSharedInternals } from '../react'
|
|
4
|
+
import { flushSyncWork, renderRoot, scheduleRootRender, scheduleUpdate } from './reconcile'
|
|
5
|
+
import { queueCommitEffects, onCommitFailure, onCommitRollback } from './commit'
|
|
6
|
+
import { enableDevTools, devToolsRenderer, commitDevTools } from './devtools'
|
|
7
|
+
|
|
8
|
+
// Only referenced inside development guards. The production renderer does not
|
|
9
|
+
// register a hook, allocate refresh bookkeeping, or check component families.
|
|
10
|
+
interface Family { current: any }
|
|
11
|
+
interface RefreshUpdate { updatedFamilies: Set<Family>; staleFamilies: Set<Family> }
|
|
12
|
+
interface RootState { memoizedState: { element: ReactNode } }
|
|
13
|
+
interface RefreshRoot {
|
|
14
|
+
root: FiberRoot
|
|
15
|
+
current: RootState & { alternate: RootState | null }
|
|
16
|
+
render?: (() => void) | undefined
|
|
17
|
+
failed: boolean
|
|
18
|
+
}
|
|
19
|
+
interface RefreshHook {
|
|
20
|
+
isDisabled?: boolean
|
|
21
|
+
inject(renderer: object): number
|
|
22
|
+
onScheduleFiberRoot?(id: number, root: RefreshRoot, children: ReactNode): void
|
|
23
|
+
onCommitFiberRoot?(id: number, root: RefreshRoot, priority: undefined, failed: boolean): void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let resolveFamily: ((type: any) => Family | undefined) | undefined
|
|
27
|
+
let hook: RefreshHook | undefined
|
|
28
|
+
let rendererID: number
|
|
29
|
+
const roots = new WeakMap<FiberRoot, RefreshRoot>()
|
|
30
|
+
const refreshing = new WeakSet<Fiber>()
|
|
31
|
+
const remounting = new WeakSet<Fiber>()
|
|
32
|
+
const failedBoundaries = new WeakSet<Fiber>()
|
|
33
|
+
|
|
34
|
+
function getRefreshRoot(root: FiberRoot): RefreshRoot | undefined {
|
|
35
|
+
if (!hook) {
|
|
36
|
+
const candidate = (globalThis as { __REACT_DEVTOOLS_GLOBAL_HOOK__?: RefreshHook }).__REACT_DEVTOOLS_GLOBAL_HOOK__
|
|
37
|
+
if (!candidate || candidate.isDisabled) return
|
|
38
|
+
try {
|
|
39
|
+
enableDevTools(candidate, { shared: ReactSharedInternals, scheduleUpdate, flushSyncWork, onCommitRollback })
|
|
40
|
+
rendererID = candidate.inject({
|
|
41
|
+
...devToolsRenderer(),
|
|
42
|
+
rendererPackageName: '@tanstack/redact',
|
|
43
|
+
bundleType: 1,
|
|
44
|
+
setRefreshHandler(handler: typeof resolveFamily) { resolveFamily = handler },
|
|
45
|
+
scheduleRefresh,
|
|
46
|
+
scheduleRoot(adapter: RefreshRoot, element: ReactNode) {
|
|
47
|
+
flushSyncWork(() => scheduleRootRender(adapter.root, adapter.render || (() => renderRoot(adapter.root, element))))
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
hook = candidate
|
|
51
|
+
} catch { return }
|
|
52
|
+
}
|
|
53
|
+
let adapter = roots.get(root)
|
|
54
|
+
if (!adapter) {
|
|
55
|
+
adapter = { root, current: { memoizedState: { element: null }, alternate: null }, failed: false }
|
|
56
|
+
roots.set(root, adapter)
|
|
57
|
+
}
|
|
58
|
+
return adapter
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function rememberRefreshRender(root: FiberRoot, render: () => void): void {
|
|
62
|
+
const adapter = getRefreshRoot(root)
|
|
63
|
+
if (adapter) adapter.render = render
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function scheduleRefreshRoot(root: FiberRoot, children: ReactNode): void {
|
|
67
|
+
const adapter = getRefreshRoot(root)
|
|
68
|
+
// Fatal error cleanup renders null internally. It must not replace the
|
|
69
|
+
// user's last element or look like an intentional unmount to React Refresh.
|
|
70
|
+
if (adapter && !adapter.failed) {
|
|
71
|
+
try { hook!.onScheduleFiberRoot?.(rendererID, adapter, children) } catch {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function commitRefreshRoot(root: FiberRoot): void {
|
|
76
|
+
if (pendingCommits.has(root)) return
|
|
77
|
+
pendingCommits.add(root)
|
|
78
|
+
onCommitFailure(() => pendingCommits.delete(root))
|
|
79
|
+
queueCommitEffects(() => {
|
|
80
|
+
pendingCommits.delete(root)
|
|
81
|
+
notifyCommit(root)
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const pendingCommits = /* @__PURE__ */ new WeakSet<FiberRoot>()
|
|
86
|
+
|
|
87
|
+
function notifyCommit(root: FiberRoot): void {
|
|
88
|
+
const adapter = roots.get(root)
|
|
89
|
+
if (!adapter) return
|
|
90
|
+
const previous = adapter.current.memoizedState
|
|
91
|
+
const failed = adapter.failed
|
|
92
|
+
adapter.failed = false
|
|
93
|
+
if (commitDevTools(root, adapter, hook, rendererID, failed)) return
|
|
94
|
+
adapter.current = {
|
|
95
|
+
memoizedState: { element: root.r.m?.children ?? null },
|
|
96
|
+
alternate: { memoizedState: previous },
|
|
97
|
+
}
|
|
98
|
+
try { hook!.onCommitFiberRoot?.(rendererID, adapter, undefined, failed) } catch {}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function failRefreshRoot(root: FiberRoot): void {
|
|
102
|
+
const adapter = roots.get(root)
|
|
103
|
+
if (adapter) adapter.failed = true
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function failRefreshBoundary(fiber: Fiber): void {
|
|
107
|
+
failedBoundaries.add(fiber)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function resolveRefreshType<T>(type: T): T {
|
|
111
|
+
return resolveFamily?.(type)?.current ?? type
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function resolveRefreshMemo(wrapper: any): any {
|
|
115
|
+
const type = resolveRefreshType(wrapper.type)
|
|
116
|
+
return type === wrapper.type ? wrapper : { ...wrapper, type }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function sameRefreshFamily(previous: any, next: any): boolean {
|
|
120
|
+
const family = resolveFamily?.(previous)
|
|
121
|
+
return family !== undefined && family === resolveFamily?.(next)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function isRefreshing(fiber: Fiber | null): boolean {
|
|
125
|
+
return !!fiber && refreshing.has(fiber)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function finishRefresh(fiber: Fiber): void {
|
|
129
|
+
if (refreshing.has(fiber)) queueCommitEffects(() => refreshing.delete(fiber))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function needsRefreshRemount(fiber: Fiber): boolean {
|
|
133
|
+
return remounting.has(fiber)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function typeKind(type: any): any {
|
|
137
|
+
return isFunction(type) ? (type.prototype?.isReactComponent ? 'class' : 'function') : type?.$$typeof
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function scheduleRefresh(adapter: RefreshRoot, update: RefreshUpdate): void {
|
|
141
|
+
flushSyncWork(() => visit(adapter.root.r, update))
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function visit(fiber: Fiber, update: RefreshUpdate): void {
|
|
145
|
+
if (fiber.u || fiber.pd) return
|
|
146
|
+
let remount = failedBoundaries.has(fiber), render = false
|
|
147
|
+
let type = fiber.type
|
|
148
|
+
while (type) {
|
|
149
|
+
const family = resolveFamily?.(type)
|
|
150
|
+
if (family) {
|
|
151
|
+
if (update.staleFamilies.has(family) || typeKind(type) !== typeKind(family.current)) remount = true
|
|
152
|
+
else if (update.updatedFamilies.has(family)) {
|
|
153
|
+
if (typeKind(type) === 'class') remount = true
|
|
154
|
+
else render = true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (type.$$typeof === REACT_MEMO_TYPE) type = type.type
|
|
158
|
+
else if (type.$$typeof === REACT_FORWARD_REF_TYPE) type = type.render
|
|
159
|
+
else if (type.$$typeof === REACT_LAZY_TYPE && (type._payload?.status === 'fulfilled' || type._payload?.status === 1 || type._payload?._status === 1)) type = type._init(type._payload)
|
|
160
|
+
else break
|
|
161
|
+
}
|
|
162
|
+
if (remount) remounting.add(fiber)
|
|
163
|
+
if (render || remount) {
|
|
164
|
+
refreshing.add(fiber)
|
|
165
|
+
scheduleUpdate(fiber)
|
|
166
|
+
}
|
|
167
|
+
if (!remount) {
|
|
168
|
+
for (let child = fiber.c; child; child = child.s) visit(child, update)
|
|
169
|
+
if (fiber.t === FiberTag.Suspense && fiber.b?.f) visit(fiber.b.f, update)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { acquireResource } from './resources';
|
|
2
|
+
import { isString } from "../core/functions";
|
|
3
|
+
import { isObject } from '../core/functions';
|
|
4
|
+
const requestOptions = 'integrity fetchPriority';
|
|
5
|
+
function options(input: any, fields: string, as?: string): ResourceHintOptions {
|
|
6
|
+
const result: ResourceHintOptions = {};
|
|
7
|
+
for (const name of fields ? fields.split(' ') : []) {
|
|
8
|
+
const value = input?.[name];
|
|
9
|
+
if (isString(value))
|
|
10
|
+
result[name] = value;
|
|
11
|
+
}
|
|
12
|
+
const crossOrigin = input?.crossOrigin;
|
|
13
|
+
if (as === 'font' || isString(crossOrigin)) {
|
|
14
|
+
result.crossOrigin = as !== 'font' && crossOrigin === 'use-credentials' ? crossOrigin : '';
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
const scriptDestination = (as: string): boolean => (/^(script|audioworklet|paintworklet|serviceworker|sharedworker|worker)$/.test(as));
|
|
19
|
+
export function preinit(href: string, input?: any): void {
|
|
20
|
+
if (isString(href) && input) {
|
|
21
|
+
if (input.as === 'style') {
|
|
22
|
+
const props = options(input, 'precedence ' + requestOptions);
|
|
23
|
+
props.precedence ||= 'default';
|
|
24
|
+
emit('stylesheet', href, props);
|
|
25
|
+
}
|
|
26
|
+
else if (input.as === 'script') {
|
|
27
|
+
emit('script', href, options(input, 'nonce ' + requestOptions));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function prefetchDNS(href: string): void {
|
|
32
|
+
if (isString(href))
|
|
33
|
+
emit('dns-prefetch', href, {});
|
|
34
|
+
}
|
|
35
|
+
export function preconnect(href: string, input?: any): void {
|
|
36
|
+
if (isString(href))
|
|
37
|
+
emit('preconnect', href, options(input, ''));
|
|
38
|
+
}
|
|
39
|
+
export function preinitModule(href: string, input?: any): void {
|
|
40
|
+
if (isString(href) && (input == null || isObject(input) && (input.as == null || input.as === 'script'))) {
|
|
41
|
+
emit('module-script', href, options(input, 'nonce ' + requestOptions));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function preloadModule(href: string, input?: any): void {
|
|
45
|
+
if (isString(href)) {
|
|
46
|
+
const props = options(input, 'as nonce ' + requestOptions, input?.as);
|
|
47
|
+
if (props.as === 'script')
|
|
48
|
+
delete props.as;
|
|
49
|
+
emit('modulepreload', href, props);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function emit(kind: ResourceHintKind, href: string, props: ResourceHintOptions): void {
|
|
53
|
+
if (!href || resourceHintDispatcher.emit?.(kind, href, props) || typeof document === 'undefined')
|
|
54
|
+
return;
|
|
55
|
+
const script = kind === 'script' || kind === 'module-script';
|
|
56
|
+
if (kind === 'stylesheet' || script) {
|
|
57
|
+
acquireResource(script ? 'script' : 'link', script
|
|
58
|
+
? { src: href, async: true, ...(kind === 'module-script' ? { type: 'module' } : {}), ...props }
|
|
59
|
+
: { rel: 'stylesheet', href, ...props }, document);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const resources = getResources(document);
|
|
63
|
+
const preload = kind === 'preload' || kind === 'modulepreload';
|
|
64
|
+
const as = props.as || 'script';
|
|
65
|
+
let selector = `link[rel="${kind}"]`;
|
|
66
|
+
let resource = '';
|
|
67
|
+
if (preload) {
|
|
68
|
+
selector += resourceAttribute('as', as);
|
|
69
|
+
if (as === 'image' && props.imageSrcSet) {
|
|
70
|
+
selector += resourceAttribute('imagesrcset', props.imageSrcSet);
|
|
71
|
+
if (isString(props.imageSizes))
|
|
72
|
+
selector += resourceAttribute('imagesizes', props.imageSizes);
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
selector += resourceAttribute('href', href);
|
|
76
|
+
resource = (kind === 'preload' ? as === 'script' || as === 'style' : scriptDestination(as))
|
|
77
|
+
? resourceSelector(href, as) : '';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
selector += resourceAttribute('href', href);
|
|
81
|
+
if (props.crossOrigin != null)
|
|
82
|
+
selector += resourceAttribute('crossorigin', props.crossOrigin);
|
|
83
|
+
}
|
|
84
|
+
const key = resource || selector;
|
|
85
|
+
if (resources.p.has(key))
|
|
86
|
+
return;
|
|
87
|
+
resources.p.set(key, props);
|
|
88
|
+
if (document.querySelector(selector) || resource && document.querySelector(resource))
|
|
89
|
+
return;
|
|
90
|
+
const node = document.createElement('link');
|
|
91
|
+
node.setAttribute('rel', kind);
|
|
92
|
+
if (!(kind === 'preload' && as === 'image' && props.imageSrcSet))
|
|
93
|
+
node.setAttribute('href', resourceURL(href));
|
|
94
|
+
for (const name in props)
|
|
95
|
+
node.setAttribute(name.toLowerCase(), props[name]!);
|
|
96
|
+
insertResource(node);
|
|
97
|
+
}
|
|
98
|
+
export function preload(href: string, input?: any): void {
|
|
99
|
+
if (isString(href) && input && isObject(input) && isString(input.as) && input.as) {
|
|
100
|
+
emit('preload', href, options(input, 'as nonce type referrerPolicy imageSrcSet imageSizes media ' + requestOptions, input.as));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
import { resourceHintDispatcher, resourceURL, type ResourceHintKind, type ResourceHintOptions } from '../core/resource-hints';
|
|
104
|
+
import { getResources, insertResource, resourceAttribute, resourceSelector } from './resource-store';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ResourceHintOptions } from '../core/resource-hints';
|
|
2
|
+
interface Resources {
|
|
3
|
+
// Connection and preload selectors are disjoint, so one map deduplicates both.
|
|
4
|
+
p: Map<string, ResourceHintOptions>;
|
|
5
|
+
i: Map<string, Element>;
|
|
6
|
+
}
|
|
7
|
+
export type ResourceRoot = Document | DocumentFragment;
|
|
8
|
+
const roots = /*#__PURE__*/ new WeakMap<ResourceRoot, Resources>();
|
|
9
|
+
// Existing document links can satisfy a shadow declaration. Links created by
|
|
10
|
+
// the resource system belong to their original root instead.
|
|
11
|
+
export const createdStylesheets = /*#__PURE__*/ new WeakSet<Element>();
|
|
12
|
+
export const resourceAttribute = (name: string, value: string): string => (`[${name}="${value.replace(/[\n"\\]/g, char => '\\' + char.charCodeAt(0).toString(16) + ' ')}"]`);
|
|
13
|
+
export const resourceSelector = (href: string, as: string): string => (as === 'style'
|
|
14
|
+
? 'link[rel="stylesheet"]' + resourceAttribute('href', href)
|
|
15
|
+
: 'script[async]' + resourceAttribute('src', href));
|
|
16
|
+
export function adoptResourceProps(props: any, prior: ResourceHintOptions | undefined, script: boolean): void {
|
|
17
|
+
if (prior)
|
|
18
|
+
for (const name of ['crossOrigin', 'referrerPolicy', script ? 'integrity' : 'title']) {
|
|
19
|
+
if (props[name] == null && prior[name] != null)
|
|
20
|
+
props[name] = prior[name];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function getResources(root: ResourceRoot): Resources {
|
|
24
|
+
let resources = roots.get(root);
|
|
25
|
+
if (!resources)
|
|
26
|
+
roots.set(root, resources = { p: new Map(), i: new Map() });
|
|
27
|
+
return resources;
|
|
28
|
+
}
|
|
29
|
+
export function insertResource(node: Element, precedence?: string, root: ResourceRoot = node.ownerDocument): void {
|
|
30
|
+
const container = root.nodeType === 9 ? (root as Document).head : root;
|
|
31
|
+
if (precedence != null) {
|
|
32
|
+
if (node.localName === 'link')
|
|
33
|
+
createdStylesheets.add(node);
|
|
34
|
+
let previous: Element | undefined;
|
|
35
|
+
let matched = false;
|
|
36
|
+
for (const sibling of root.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]')) {
|
|
37
|
+
if (sibling.getAttribute('data-precedence') === precedence)
|
|
38
|
+
matched = true;
|
|
39
|
+
else if (matched)
|
|
40
|
+
break;
|
|
41
|
+
previous = sibling;
|
|
42
|
+
}
|
|
43
|
+
if (previous)
|
|
44
|
+
previous.parentNode!.insertBefore(node, previous.nextSibling);
|
|
45
|
+
else
|
|
46
|
+
container.insertBefore(node, container.firstChild);
|
|
47
|
+
}
|
|
48
|
+
else
|
|
49
|
+
container.appendChild(node);
|
|
50
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { setProp } from './dom';
|
|
2
|
+
import { resourceURL } from '../core/resource-hints';
|
|
3
|
+
import { adoptResourceProps, createdStylesheets, getResources, insertResource, resourceAttribute, resourceSelector, type ResourceRoot } from './resource-store';
|
|
4
|
+
// Called only during commit. Resource nodes are shared by href and are not
|
|
5
|
+
// owned by a component's placement or unmount operations.
|
|
6
|
+
// The renderer has already checked this host's resource eligibility.
|
|
7
|
+
export function acquireResource(type: string, props: any, container: Node): Element {
|
|
8
|
+
const script = type === 'script';
|
|
9
|
+
const style = type === 'style';
|
|
10
|
+
const ownerDocument = (container.ownerDocument || container) as Document;
|
|
11
|
+
const tree = script ? ownerDocument : container.getRootNode();
|
|
12
|
+
const root = (tree.nodeType === 9 || tree.nodeType === 11 ? tree : ownerDocument) as ResourceRoot;
|
|
13
|
+
const href = script ? props.src : props.href;
|
|
14
|
+
const resources = getResources(root);
|
|
15
|
+
const key = resourceSelector(href, script ? 'script' : 'style');
|
|
16
|
+
let node = resources.i.get(key);
|
|
17
|
+
if (node)
|
|
18
|
+
return node;
|
|
19
|
+
const existing = !style && !script && root !== ownerDocument ? ownerDocument.querySelector(key) : null;
|
|
20
|
+
node = existing && !createdStylesheets.has(existing) && !(existing as any)._p ? existing
|
|
21
|
+
: root.querySelector(style ? 'style' + resourceAttribute('data-href~', href) : key) || undefined;
|
|
22
|
+
if (node) {
|
|
23
|
+
resources.i.set(key, node);
|
|
24
|
+
return node;
|
|
25
|
+
}
|
|
26
|
+
const next = { ...props };
|
|
27
|
+
if (!script) {
|
|
28
|
+
next['data-precedence'] = props.precedence;
|
|
29
|
+
delete next.precedence;
|
|
30
|
+
if (style) {
|
|
31
|
+
next['data-href'] = props.href;
|
|
32
|
+
delete next.href;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!style)
|
|
36
|
+
adoptResourceProps(next, getResources(ownerDocument).p.get(key), script);
|
|
37
|
+
node = ownerDocument.createElement(type);
|
|
38
|
+
for (const name in next) {
|
|
39
|
+
setProp(node, name, name === 'href' || name === 'src' ? resourceURL(next[name]) : next[name], undefined, false);
|
|
40
|
+
}
|
|
41
|
+
if (style && next.dangerouslySetInnerHTML == null && isTextContent(next.children))
|
|
42
|
+
node.textContent = '' + next.children;
|
|
43
|
+
resources.i.set(key, node);
|
|
44
|
+
insertResource(node, script ? undefined : props.precedence, root);
|
|
45
|
+
return node;
|
|
46
|
+
}
|
|
47
|
+
import { isTextContent } from '../core/functions';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { invokeCommit, layoutIsDisconnected } from './reconcile';
|
|
2
|
+
import { onCommitRollback } from './commit';
|
|
3
|
+
import { FiberTag, type Fiber, type Hook, type Effect } from '../core';
|
|
4
|
+
export function disconnectClass(fiber: Fiber, removing?: boolean): void {
|
|
5
|
+
const instance = fiber.i?._f === fiber ? fiber.i : null;
|
|
6
|
+
if (!instance)
|
|
7
|
+
return;
|
|
8
|
+
const props = instance.props, state = instance.state, committed = fiber.b?.c;
|
|
9
|
+
if (committed) {
|
|
10
|
+
instance.props = committed.p;
|
|
11
|
+
instance.state = committed.s;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
if (instance.componentWillUnmount && (!removing || !layoutIsDisconnected(fiber))) {
|
|
15
|
+
invokeCommit(fiber, () => instance.componentWillUnmount());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
if (!removing) {
|
|
20
|
+
instance.props = props;
|
|
21
|
+
instance.state = state;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (removing)
|
|
25
|
+
instance._f = instance._q = instance._u = null;
|
|
26
|
+
}
|
|
27
|
+
export function inSuspensePrimary(fiber: Fiber): boolean {
|
|
28
|
+
for (let child = fiber, parent = fiber.p; parent; child = parent, parent = parent.p) {
|
|
29
|
+
if (parent.t === FiberTag.Suspense && parent.b?.d && parent.b.f !== child)
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
export { walkRetained } from './walk';
|
|
35
|
+
export function rememberRetainedEffect(fiber: Fiber, hook: Hook, effect: Effect): void {
|
|
36
|
+
let entries = fiber.ef;
|
|
37
|
+
if (!entries) {
|
|
38
|
+
fiber.ef = entries = new Map();
|
|
39
|
+
onCommitRollback(() => { fiber.ef = undefined; });
|
|
40
|
+
}
|
|
41
|
+
const previous = entries.get(hook), target = entries;
|
|
42
|
+
onCommitRollback(() => {
|
|
43
|
+
if (previous)
|
|
44
|
+
target.set(hook, previous);
|
|
45
|
+
else
|
|
46
|
+
target.delete(hook);
|
|
47
|
+
});
|
|
48
|
+
entries.set(hook, effect);
|
|
49
|
+
}
|
|
50
|
+
export function setRetainedFlag(fiber: Fiber, key: 'ld' | 'ad' | 'ah', disconnected: boolean): boolean {
|
|
51
|
+
const previous = !!fiber[key];
|
|
52
|
+
if (previous !== disconnected) {
|
|
53
|
+
onCommitRollback(() => { fiber[key] = previous; });
|
|
54
|
+
fiber[key] = disconnected;
|
|
55
|
+
}
|
|
56
|
+
return previous;
|
|
57
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FiberTag, createFiber, type Fiber, type FiberRoot, type RecoverableErrorHandler } from '../core';
|
|
2
|
+
export interface RootOptionsInternal {
|
|
3
|
+
identifierStrategy?: 'react';
|
|
4
|
+
identifierPrefix?: string;
|
|
5
|
+
onRecoverableError?: RecoverableErrorHandler;
|
|
6
|
+
onCaughtError?: RecoverableErrorHandler;
|
|
7
|
+
onUncaughtError?: RecoverableErrorHandler;
|
|
8
|
+
}
|
|
9
|
+
export function createFiberRoot(container: Element | Document | DocumentFragment, options: RootOptionsInternal): FiberRoot {
|
|
10
|
+
const root = {
|
|
11
|
+
p: new Set(),
|
|
12
|
+
s: false,
|
|
13
|
+
re: options.onRecoverableError,
|
|
14
|
+
ce: options.onCaughtError,
|
|
15
|
+
ue: options.onUncaughtError,
|
|
16
|
+
i: options.identifierPrefix,
|
|
17
|
+
h: false,
|
|
18
|
+
} as FiberRoot;
|
|
19
|
+
root.ri = true;
|
|
20
|
+
attachRootFiber(root, container);
|
|
21
|
+
return root;
|
|
22
|
+
}
|
|
23
|
+
export function attachRootFiber(root: FiberRoot, container: Element | Document | DocumentFragment): void {
|
|
24
|
+
const rootFiber = createFiber(FiberTag.Root, null, null);
|
|
25
|
+
root.c = container as any;
|
|
26
|
+
root.ic = 0;
|
|
27
|
+
rootFiber.r = root;
|
|
28
|
+
rootFiber.i = container;
|
|
29
|
+
root.r = rootFiber;
|
|
30
|
+
}
|
|
31
|
+
export function getRootContainer(fiber: Fiber, fallback: Node = fiber.r!.c): Node {
|
|
32
|
+
for (let parent = fiber.p; parent; parent = parent.p) {
|
|
33
|
+
if (parent.t === FiberTag.Portal)
|
|
34
|
+
return parent.v.container;
|
|
35
|
+
}
|
|
36
|
+
return fiber.r?.c || fallback;
|
|
37
|
+
}
|
package/src/dom/root.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { discardPendingWork, renderRoot, scheduleRootRender, flushSyncWork, batchedUpdates } from './reconcile'
|
|
2
|
+
|
|
3
|
+
import { createFiberRoot } from './root-internal'
|
|
4
|
+
|
|
5
|
+
import { queueMutation } from './commit'
|
|
6
|
+
import { clearHostContainer } from './document-metadata'
|
|
7
|
+
|
|
8
|
+
import { hydrateRootImpl } from './features/hydration'
|
|
9
|
+
|
|
10
|
+
import type { ReactNode, RecoverableErrorHandler } from '../core'
|
|
11
|
+
|
|
12
|
+
export interface RootOptions {
|
|
13
|
+
formState?: unknown[] | null
|
|
14
|
+
identifierStrategy?: 'react'
|
|
15
|
+
identifierPrefix?: string
|
|
16
|
+
onRecoverableError?: RecoverableErrorHandler
|
|
17
|
+
onCaughtError?: RecoverableErrorHandler
|
|
18
|
+
onUncaughtError?: RecoverableErrorHandler
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Root {
|
|
22
|
+
render(children: ReactNode): void
|
|
23
|
+
unmount(): void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function createRoot(container: Element | DocumentFragment | Document, options: RootOptions = {}): Root {
|
|
27
|
+
const root = createFiberRoot(container, options)
|
|
28
|
+
|
|
29
|
+
let firstRender = true
|
|
30
|
+
return {
|
|
31
|
+
render(children) {
|
|
32
|
+
scheduleRootRender(root, () => {
|
|
33
|
+
if (firstRender) {
|
|
34
|
+
queueMutation(() => {
|
|
35
|
+
firstRender = false
|
|
36
|
+
if (container.nodeType === 1 || container.nodeType === 9) clearHostContainer(container)
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
renderRoot(root, children)
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
unmount() {
|
|
43
|
+
discardPendingWork(root)
|
|
44
|
+
flushSyncWork(() => {
|
|
45
|
+
renderRoot(root, null)
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function hydrateRoot(
|
|
52
|
+
container: Element | Document,
|
|
53
|
+
initialChildren: ReactNode,
|
|
54
|
+
options: RootOptions = {},
|
|
55
|
+
): Root {
|
|
56
|
+
return hydrateRootImpl(container, initialChildren, options)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { flushSyncWork as flushSync, batchedUpdates }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isFunction } from '../core/functions'
|
|
2
|
+
// Snapshot native values so retaining or redispatching an event cannot change them.
|
|
3
|
+
export function createSyntheticEvent(native: Event) {
|
|
4
|
+
let stopped = false
|
|
5
|
+
const event: Record<string, any> = {
|
|
6
|
+
nativeEvent: native,
|
|
7
|
+
defaultPrevented: native.defaultPrevented,
|
|
8
|
+
isDefaultPrevented: () => event.defaultPrevented,
|
|
9
|
+
isPropagationStopped: () => stopped,
|
|
10
|
+
preventDefault() { event.defaultPrevented = true; native.preventDefault() },
|
|
11
|
+
stopPropagation() { stopped = true; native.stopPropagation() },
|
|
12
|
+
stopImmediatePropagation() { stopped = true; native.stopImmediatePropagation() },
|
|
13
|
+
persist() {},
|
|
14
|
+
}
|
|
15
|
+
for (const key in native) {
|
|
16
|
+
if (!(key in event)) {
|
|
17
|
+
const value = (native as any)[key]
|
|
18
|
+
event[key] = isFunction(value) ? value.bind(native) : value
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return event
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { act } from '../react/act'
|