wevu 7.2.2 → 7.4.0
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/README.md +6 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/internal-runtime.d.mts +2 -1
- package/dist/dev/internal-runtime.mjs +3 -2
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
- package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
- package/dist/dev/reactivity/core.mjs +5 -8
- package/dist/dev/reactivity/core.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/patch.mjs +3 -3
- package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
- package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
- package/dist/dev/reactivity/reactive.mjs +5 -10
- package/dist/dev/reactivity/reactive.mjs.map +1 -1
- package/dist/dev/reactivity/ref.mjs +2 -2
- package/dist/dev/reactivity/ref.mjs.map +1 -1
- package/dist/dev/reactivity/shallowRef.mjs +1 -1
- package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
- package/dist/dev/reactivity/watch/helpers.mjs +1 -1
- package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
- package/dist/dev/reactivity/watch.mjs +6 -8
- package/dist/dev/reactivity/watch.mjs.map +1 -1
- package/dist/dev/router/createRouter.mjs +17 -24
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/initialNavigation.mjs +22 -17
- package/dist/dev/router/initialNavigation.mjs.map +1 -1
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/instance.mjs.map +1 -1
- package/dist/dev/router/navigationCore.mjs +2 -2
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/navigationResult.mjs +7 -10
- package/dist/dev/router/navigationResult.mjs.map +1 -1
- package/dist/dev/router/navigationTarget.mjs +1 -3
- package/dist/dev/router/navigationTarget.mjs.map +1 -1
- package/dist/dev/router/resolve.mjs +3 -4
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/routeRegistry.mjs +1 -1
- package/dist/dev/router/routeRegistry.mjs.map +1 -1
- package/dist/dev/router/routeSync.mjs +1 -1
- package/dist/dev/router/routeSync.mjs.map +1 -1
- package/dist/dev/router/scrollRestoration/adapters.d.mts +8 -0
- package/dist/dev/router/scrollRestoration/adapters.mjs +86 -0
- package/dist/dev/router/scrollRestoration/adapters.mjs.map +1 -0
- package/dist/dev/router/scrollRestoration/controller.d.mts +8 -0
- package/dist/dev/router/scrollRestoration/controller.mjs +148 -0
- package/dist/dev/router/scrollRestoration/controller.mjs.map +1 -0
- package/dist/dev/router/scrollRestoration/host.d.mts +3 -0
- package/dist/dev/router/scrollRestoration/host.mjs +76 -0
- package/dist/dev/router/scrollRestoration/host.mjs.map +1 -0
- package/dist/dev/router/scrollRestoration/index.d.mts +9 -0
- package/dist/dev/router/scrollRestoration/index.mjs +156 -0
- package/dist/dev/router/scrollRestoration/index.mjs.map +1 -0
- package/dist/dev/router/scrollRestoration/types.d.mts +61 -0
- package/dist/dev/router/useRoute.mjs +12 -19
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router.d.mts +5 -1
- package/dist/dev/router.mjs +4 -1
- package/dist/dev/routerInternal/location.mjs +2 -3
- package/dist/dev/routerInternal/location.mjs.map +1 -1
- package/dist/dev/routerInternal/params.mjs +2 -3
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/routerInternal/records.mjs +1 -1
- package/dist/dev/routerInternal/records.mjs.map +1 -1
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
- package/dist/dev/runtime/app/context.mjs +13 -26
- package/dist/dev/runtime/app/context.mjs.map +1 -1
- package/dist/dev/runtime/app/diagnostics.mjs +2 -4
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
- package/dist/dev/runtime/app/mount.mjs +27 -33
- package/dist/dev/runtime/app/mount.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
- package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/payload.mjs +2 -3
- package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
- package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
- package/dist/dev/runtime/app.mjs +9 -9
- package/dist/dev/runtime/app.mjs.map +1 -1
- package/dist/dev/runtime/bindingManifest.mjs +6 -14
- package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
- package/dist/dev/runtime/capabilities.d.mts +4 -1
- package/dist/dev/runtime/capabilities.mjs.map +1 -1
- package/dist/dev/runtime/css.mjs +4 -8
- package/dist/dev/runtime/css.mjs.map +1 -1
- package/dist/dev/runtime/defaults.mjs +4 -4
- package/dist/dev/runtime/defaults.mjs.map +1 -1
- package/dist/dev/runtime/define/initialComputed.mjs +5 -5
- package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
- package/dist/dev/runtime/define/options.mjs +10 -12
- package/dist/dev/runtime/define/options.mjs.map +1 -1
- package/dist/dev/runtime/define/props.mjs +4 -5
- package/dist/dev/runtime/define/props.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/define/setupResult.mjs +17 -28
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
- package/dist/dev/runtime/define.mjs +9 -12
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +9 -11
- package/dist/dev/runtime/diff.mjs.map +1 -1
- package/dist/dev/runtime/disposables.mjs +2 -2
- package/dist/dev/runtime/disposables.mjs.map +1 -1
- package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
- package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
- package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
- package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
- package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
- package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
- package/dist/dev/runtime/features/layout.mjs +2 -3
- package/dist/dev/runtime/features/layout.mjs.map +1 -1
- package/dist/dev/runtime/features/publicLayout.mjs +2 -6
- package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
- package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
- package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/features/templateRefs.mjs +1 -1
- package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.mjs +20 -43
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/hooks/pageScroll.mjs +41 -0
- package/dist/dev/runtime/hooks/pageScroll.mjs.map +1 -0
- package/dist/dev/runtime/hooks/register.mjs +2 -1
- package/dist/dev/runtime/hooks/register.mjs.map +1 -1
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
- package/dist/dev/runtime/intersectionObserver.mjs +6 -6
- package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/jsxIsland.mjs +16 -33
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/layoutBridge.mjs +32 -62
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
- package/dist/dev/runtime/nativeBridge.mjs +1 -1
- package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
- package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
- package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
- package/dist/dev/runtime/pageEnvironment.mjs +15 -18
- package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
- package/dist/dev/runtime/pageLayout.mjs +7 -11
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.mjs +2 -3
- package/dist/dev/runtime/pageScroll.mjs.map +1 -1
- package/dist/dev/runtime/platform/current.mjs +12 -0
- package/dist/dev/runtime/platform/current.mjs.map +1 -0
- package/dist/dev/runtime/platform/generic.mjs +36 -0
- package/dist/dev/runtime/platform/generic.mjs.map +1 -0
- package/dist/dev/runtime/platform/globals.mjs +29 -0
- package/dist/dev/runtime/platform/globals.mjs.map +1 -0
- package/dist/dev/runtime/platform.mjs +15 -60
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/provideContext.mjs +7 -9
- package/dist/dev/runtime/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/publicRuntime.mjs +4 -0
- package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
- package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
- package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
- package/dist/dev/runtime/register/app.mjs +18 -19
- package/dist/dev/runtime/register/app.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipay.mjs +9 -18
- package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
- package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +2 -5
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +13 -26
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/methods.mjs +13 -18
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs +3 -4
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/component/props.mjs +25 -31
- package/dist/dev/runtime/register/component/props.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +21 -40
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component.mjs +3 -5
- package/dist/dev/runtime/register/component.mjs.map +1 -1
- package/dist/dev/runtime/register/inline.mjs +8 -10
- package/dist/dev/runtime/register/inline.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +13 -15
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
- package/dist/dev/runtime/register/setup.mjs +2 -3
- package/dist/dev/runtime/register/setup.mjs.map +1 -1
- package/dist/dev/runtime/register/snapshot.mjs +1 -4
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/watch.mjs +3 -5
- package/dist/dev/runtime/register/watch.mjs.map +1 -1
- package/dist/dev/runtime/scopedSlots.mjs +14 -21
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/selectorQuery.mjs +5 -9
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
- package/dist/dev/runtime/template.mjs +1 -1
- package/dist/dev/runtime/template.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs.mjs +8 -15
- package/dist/dev/runtime/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/uniAppHost.mjs +6 -14
- package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
- package/dist/dev/runtime/updatePerformance.mjs +1 -1
- package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
- package/dist/dev/runtime/use.mjs +1 -1
- package/dist/dev/runtime/use.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/context.mjs +3 -5
- package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/model.mjs +9 -13
- package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/router.mjs +4 -4
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
- package/dist/dev/scheduler.mjs +3 -4
- package/dist/dev/scheduler.mjs.map +1 -1
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/create.mjs +11 -22
- package/dist/dev/store/define/create.mjs.map +1 -1
- package/dist/dev/store/define.mjs +1 -1
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/view.mjs +1 -1
- package/dist/dev/store/view.mjs.map +1 -1
- package/dist/internal-runtime.d.mts +2 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.mjs +1 -1
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/patch.mjs +1 -1
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shared.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.mjs +1 -1
- package/dist/reactivity/watch/helpers.mjs +1 -1
- package/dist/reactivity/watch.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/instance.mjs +1 -1
- package/dist/router/navigationCore.mjs +1 -1
- package/dist/router/navigationResult.mjs +1 -1
- package/dist/router/navigationTarget.mjs +1 -1
- package/dist/router/resolve.mjs +1 -1
- package/dist/router/routeRegistry.mjs +1 -1
- package/dist/router/routeSync.mjs +1 -1
- package/dist/router/scrollRestoration/adapters.d.mts +7 -0
- package/dist/router/scrollRestoration/adapters.mjs +1 -0
- package/dist/router/scrollRestoration/controller.d.mts +7 -0
- package/dist/router/scrollRestoration/controller.mjs +1 -0
- package/dist/router/scrollRestoration/host.d.mts +3 -0
- package/dist/router/scrollRestoration/host.mjs +1 -0
- package/dist/router/scrollRestoration/index.d.mts +8 -0
- package/dist/router/scrollRestoration/index.mjs +1 -0
- package/dist/router/scrollRestoration/types.d.mts +60 -0
- package/dist/router/useRoute.mjs +1 -1
- package/dist/router.d.mts +5 -1
- package/dist/router.mjs +1 -1
- package/dist/routerInternal/location.mjs +1 -1
- package/dist/routerInternal/params.mjs +1 -1
- package/dist/routerInternal/records.mjs +1 -1
- package/dist/routerInternal/recordsWarnings.mjs +1 -1
- package/dist/runtime/app/context.mjs +1 -1
- package/dist/runtime/app/diagnostics.mjs +1 -1
- package/dist/runtime/app/mount.mjs +1 -1
- package/dist/runtime/app/setData/commitTracker.mjs +1 -1
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
- package/dist/runtime/app/setData/payload.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app/setData/snapshot.mjs +1 -1
- package/dist/runtime/app/setDataOptions.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -1
- package/dist/runtime/capabilities.d.mts +4 -1
- package/dist/runtime/css.mjs +1 -1
- package/dist/runtime/defaults.mjs +1 -1
- package/dist/runtime/define/initialComputed.mjs +1 -1
- package/dist/runtime/define/options.mjs +1 -1
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define/setupResult.mjs +1 -1
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/diff.mjs +1 -1
- package/dist/runtime/disposables.mjs +1 -1
- package/dist/runtime/elementIntersectionObserver.mjs +1 -1
- package/dist/runtime/features/inlineEvents.mjs +1 -1
- package/dist/runtime/features/jsxIslands.d.mts +6 -0
- package/dist/runtime/features/jsxIslands.mjs +1 -0
- package/dist/runtime/features/layout.mjs +1 -1
- package/dist/runtime/features/publicLayout.mjs +1 -1
- package/dist/runtime/features/scopedSlots.mjs +1 -1
- package/dist/runtime/features/templateRefs.mjs +1 -1
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/hooks/pageScroll.mjs +1 -0
- package/dist/runtime/hooks/register.mjs +1 -1
- package/dist/runtime/inlineDataset.mjs +1 -1
- package/dist/runtime/intersectionObserver.mjs +1 -1
- package/dist/runtime/jsxIsland.mjs +1 -1
- package/dist/runtime/layoutBridge.mjs +1 -1
- package/dist/runtime/nativeBridge.mjs +1 -1
- package/dist/runtime/navigationLifecycle.mjs +1 -0
- package/dist/runtime/pageEnvironment.mjs +1 -1
- package/dist/runtime/pageLayout.mjs +1 -1
- package/dist/runtime/pageScroll.mjs +1 -1
- package/dist/runtime/platform/current.mjs +1 -0
- package/dist/runtime/platform/generic.mjs +1 -0
- package/dist/runtime/platform/globals.mjs +1 -0
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/provideContext.mjs +1 -1
- package/dist/runtime/publicRuntime.mjs +1 -1
- package/dist/runtime/pullDownRefresh.mjs +1 -1
- package/dist/runtime/register/app.mjs +1 -1
- package/dist/runtime/register/component/alipay.mjs +1 -1
- package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/optionalHooks.mjs +1 -1
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
- package/dist/runtime/register/component/lifecycle.mjs +1 -1
- package/dist/runtime/register/component/methods.mjs +1 -1
- package/dist/runtime/register/component/options.mjs +1 -1
- package/dist/runtime/register/component/props.mjs +1 -1
- package/dist/runtime/register/component/registerDefinition.mjs +1 -1
- package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
- package/dist/runtime/register/component.mjs +1 -1
- package/dist/runtime/register/inline.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.mjs +1 -1
- package/dist/runtime/register/snapshot.mjs +1 -1
- package/dist/runtime/register/watch.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/selectorQuery.mjs +1 -1
- package/dist/runtime/template.mjs +1 -1
- package/dist/runtime/templateRefs/helpers.mjs +1 -1
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/uniAppHost.mjs +1 -1
- package/dist/runtime/updatePerformance.mjs +1 -1
- package/dist/runtime/use.mjs +1 -1
- package/dist/runtime/vueCompat/context.mjs +1 -1
- package/dist/runtime/vueCompat/model.mjs +1 -1
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/scheduler.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/create.mjs +1 -1
- package/dist/store/define.mjs +1 -1
- package/dist/store/view.mjs +1 -1
- package/package.json +7 -7
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../../../src/runtime/register/runtimeInstance/utils.ts"],"sourcesContent":["import type { SetDataAdapterSettler, SetDataPayload } from '../../app/setData/commitTracker'\nimport type {\n InternalRuntimeState,\n MiniProgramAdapter,\n RuntimeInstance,\n SetupContextNativeInstance,\n} from '../../types'\nimport {\n WEVU_NATIVE_INSTANCE_KEY,\n WEVU_PROP_KEYS_KEY,\n WEVU_PROPS_KEY,\n WEVU_RUNTIME_KEY,\n WEVU_SETUP_CONTEXT_INSTANCE_KEY,\n WEVU_SETUP_STATE_KEY,\n} from '@weapp-core/constants'\nimport { shallowReactive } from '../../../reactivity'\nimport { hasOwn } from '../../../utils'\nimport { isNativeBridgeMethod } from '../../nativeBridge'\n\nexport type AdapterWithSetData = Omit<Required<MiniProgramAdapter>, 'setData'> & {\n setData: (payload: Record<string, any>, callback?: () => void) => void | Promise<void> | undefined\n __wevu_dispatchSetData: (payload: SetDataPayload, settle: SetDataAdapterSettler) => void\n __wevu_enableSetData?: (discardPending?: boolean) => void\n __wevu_setVisibility?: (visible: boolean) => void\n __wevu_reportSetDataError?: (error: Error) => void\n __wevu_disposeSetData?: () => void\n}\n\nexport type NativeSetData = (payload: Record<string, any>, callback?: () => void) => void | Promise<void> | undefined\n\nexport function attachRuntimeProxyProps(state: Record<string, any>, props: Record<string, any>) {\n try {\n Object.defineProperty(state, WEVU_PROPS_KEY, {\n value: props,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(state as any)[WEVU_PROPS_KEY] = props\n }\n}\n\nexport function attachRuntimeSetupState(state: Record<string, any>, setupState: Record<string, any>) {\n try {\n Object.defineProperty(state, WEVU_SETUP_STATE_KEY, {\n value: setupState,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(state as any)[WEVU_SETUP_STATE_KEY] = setupState\n }\n}\n\nexport function attachNativeInstanceRef(state: Record<string, any>, instance: InternalRuntimeState) {\n try {\n Object.defineProperty(state, WEVU_NATIVE_INSTANCE_KEY, {\n value: instance,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(state as any)[WEVU_NATIVE_INSTANCE_KEY] = instance\n }\n}\n\nexport function attachRuntimeRef(state: Record<string, any>, runtime: RuntimeInstance<any, any, any>) {\n try {\n Object.defineProperty(state, WEVU_RUNTIME_KEY, {\n value: runtime,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(state as any)[WEVU_RUNTIME_KEY] = runtime\n }\n}\n\nexport function attachRuntimeInstance(runtime: RuntimeInstance<any, any, any>, instance: InternalRuntimeState) {\n try {\n Object.defineProperty(runtime as Record<string, any>, 'instance', {\n value: instance,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n try {\n ;(runtime as Record<string, any>).instance = instance\n }\n catch {\n // 忽略冻结对象写入失败\n }\n }\n}\n\nexport function resolveNativeSetData(instance: InternalRuntimeState) {\n const setupInstance = (instance as any)[WEVU_SETUP_CONTEXT_INSTANCE_KEY] as SetupContextNativeInstance | undefined\n const setupOverride = setupInstance && typeof setupInstance.setData === 'function'\n ? setupInstance.setData\n : undefined\n if (typeof setupOverride === 'function' && !isNativeBridgeMethod(setupOverride)) {\n return setupOverride as NativeSetData\n }\n\n const candidate = (instance as any).setData\n if (typeof candidate !== 'function') {\n return undefined\n }\n if (isNativeBridgeMethod(candidate)) {\n return undefined\n }\n return candidate as NativeSetData\n}\n\nfunction getRuntimeOwnerLabel(instance: InternalRuntimeState) {\n const route = (instance as any).route\n if (typeof route === 'string' && route) {\n return route\n }\n const is = (instance as any).is\n if (typeof is === 'string' && is) {\n return is\n }\n return 'unknown'\n}\n\nexport function callNativeSetData(\n instance: InternalRuntimeState,\n setData: NativeSetData,\n payload: Record<string, any>,\n callback?: () => void,\n) {\n try {\n return callback\n ? setData.call(instance, payload, callback)\n : setData.call(instance, payload)\n }\n catch (error) {\n const owner = getRuntimeOwnerLabel(instance)\n throw new Error(`[wevu] setData failed (${owner}): ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\nexport function syncRuntimeProps(\n props: Record<string, any>,\n mpProperties: Record<string, any>,\n declaredPropKeys?: readonly string[],\n) {\n const declaredPropKeySet = declaredPropKeys ? new Set(declaredPropKeys) : undefined\n const currentKeys = Object.keys(props)\n for (const key of currentKeys) {\n if (!hasOwn(mpProperties, key) || (declaredPropKeySet && !declaredPropKeySet.has(key))) {\n try {\n delete props[key]\n }\n catch {\n // 忽略异常\n }\n }\n }\n const nextKeys = declaredPropKeys ?? Object.keys(mpProperties)\n for (const key of nextKeys) {\n if (hasOwn(mpProperties, key)) {\n props[key] = mpProperties[key]\n }\n }\n}\n\nexport function ensureRuntimeProps(\n target: InternalRuntimeState,\n runtimeState: Record<string, any>,\n mpProperties: Record<string, any> = ((target as any).properties || {}) as Record<string, any>,\n) {\n const runtimeProps = runtimeState && typeof runtimeState === 'object'\n ? ((runtimeState as any)[WEVU_PROPS_KEY] as Record<string, any> | undefined)\n : undefined\n const props = runtimeProps && typeof runtimeProps === 'object'\n ? runtimeProps\n : shallowReactive({}) as Record<string, any>\n\n const declaredPropKeys = Array.isArray((target as any)[WEVU_PROP_KEYS_KEY])\n ? ((target as any)[WEVU_PROP_KEYS_KEY] as string[])\n : undefined\n syncRuntimeProps(props, mpProperties, declaredPropKeys)\n if (runtimeState && typeof runtimeState === 'object') {\n attachRuntimeProxyProps(runtimeState, props)\n }\n try {\n Object.defineProperty(target, WEVU_PROPS_KEY, {\n value: props,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(target as any)[WEVU_PROPS_KEY] = props\n }\n\n return props\n}\n"],"mappings":";;;;;;AA8BA,SAAgB,wBAAwB,OAA4B,OAA4B;CAC9F,IAAI;EACF,OAAO,eAAe,OAAO,gBAAgB;GAC3C,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../../../src/runtime/register/runtimeInstance/utils.ts"],"sourcesContent":["import type { SetDataAdapterSettler, SetDataPayload } from '../../app/setData/commitTracker'\nimport type {\n InternalRuntimeState,\n MiniProgramAdapter,\n RuntimeInstance,\n SetupContextNativeInstance,\n} from '../../types'\nimport {\n WEVU_NATIVE_INSTANCE_KEY,\n WEVU_PROP_KEYS_KEY,\n WEVU_PROPS_KEY,\n WEVU_RUNTIME_KEY,\n WEVU_SETUP_CONTEXT_INSTANCE_KEY,\n WEVU_SETUP_STATE_KEY,\n} from '@weapp-core/constants'\nimport { shallowReactive } from '../../../reactivity'\nimport { hasOwn } from '../../../utils'\nimport { isNativeBridgeMethod } from '../../nativeBridge'\n\nexport type AdapterWithSetData = Omit<Required<MiniProgramAdapter>, 'setData'> & {\n setData: (payload: Record<string, any>, callback?: () => void) => void | Promise<void> | undefined\n __wevu_dispatchSetData: (payload: SetDataPayload, settle: SetDataAdapterSettler) => void\n __wevu_enableSetData?: (discardPending?: boolean) => void\n __wevu_setVisibility?: (visible: boolean) => void\n __wevu_reportSetDataError?: (error: Error) => void\n __wevu_disposeSetData?: () => void\n}\n\nexport type NativeSetData = (payload: Record<string, any>, callback?: () => void) => void | Promise<void> | undefined\n\nexport function attachRuntimeProxyProps(state: Record<string, any>, props: Record<string, any>) {\n try {\n Object.defineProperty(state, WEVU_PROPS_KEY, {\n value: props,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(state as any)[WEVU_PROPS_KEY] = props\n }\n}\n\nexport function attachRuntimeSetupState(state: Record<string, any>, setupState: Record<string, any>) {\n try {\n Object.defineProperty(state, WEVU_SETUP_STATE_KEY, {\n value: setupState,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(state as any)[WEVU_SETUP_STATE_KEY] = setupState\n }\n}\n\nexport function attachNativeInstanceRef(state: Record<string, any>, instance: InternalRuntimeState) {\n try {\n Object.defineProperty(state, WEVU_NATIVE_INSTANCE_KEY, {\n value: instance,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(state as any)[WEVU_NATIVE_INSTANCE_KEY] = instance\n }\n}\n\nexport function attachRuntimeRef(state: Record<string, any>, runtime: RuntimeInstance<any, any, any>) {\n try {\n Object.defineProperty(state, WEVU_RUNTIME_KEY, {\n value: runtime,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(state as any)[WEVU_RUNTIME_KEY] = runtime\n }\n}\n\nexport function attachRuntimeInstance(runtime: RuntimeInstance<any, any, any>, instance: InternalRuntimeState) {\n try {\n Object.defineProperty(runtime as Record<string, any>, 'instance', {\n value: instance,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n try {\n ;(runtime as Record<string, any>).instance = instance\n }\n catch {\n // 忽略冻结对象写入失败\n }\n }\n}\n\nexport function resolveNativeSetData(instance: InternalRuntimeState) {\n const setupInstance = (instance as any)[WEVU_SETUP_CONTEXT_INSTANCE_KEY] as SetupContextNativeInstance | undefined\n const setupOverride = setupInstance && typeof setupInstance.setData === 'function'\n ? setupInstance.setData\n : undefined\n if (typeof setupOverride === 'function' && !isNativeBridgeMethod(setupOverride)) {\n return setupOverride as NativeSetData\n }\n\n const candidate = (instance as any).setData\n if (typeof candidate !== 'function') {\n return undefined\n }\n if (isNativeBridgeMethod(candidate)) {\n return undefined\n }\n return candidate as NativeSetData\n}\n\nfunction getRuntimeOwnerLabel(instance: InternalRuntimeState) {\n const route = (instance as any).route\n if (typeof route === 'string' && route) {\n return route\n }\n const is = (instance as any).is\n if (typeof is === 'string' && is) {\n return is\n }\n return 'unknown'\n}\n\nexport function callNativeSetData(\n instance: InternalRuntimeState,\n setData: NativeSetData,\n payload: Record<string, any>,\n callback?: () => void,\n) {\n try {\n return callback\n ? setData.call(instance, payload, callback)\n : setData.call(instance, payload)\n }\n catch (error) {\n const owner = getRuntimeOwnerLabel(instance)\n throw new Error(`[wevu] setData failed (${owner}): ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\nexport function syncRuntimeProps(\n props: Record<string, any>,\n mpProperties: Record<string, any>,\n declaredPropKeys?: readonly string[],\n) {\n const declaredPropKeySet = declaredPropKeys ? new Set(declaredPropKeys) : undefined\n const currentKeys = Object.keys(props)\n for (const key of currentKeys) {\n if (!hasOwn(mpProperties, key) || (declaredPropKeySet && !declaredPropKeySet.has(key))) {\n try {\n delete props[key]\n }\n catch {\n // 忽略异常\n }\n }\n }\n const nextKeys = declaredPropKeys ?? Object.keys(mpProperties)\n for (const key of nextKeys) {\n if (hasOwn(mpProperties, key)) {\n props[key] = mpProperties[key]\n }\n }\n}\n\nexport function ensureRuntimeProps(\n target: InternalRuntimeState,\n runtimeState: Record<string, any>,\n mpProperties: Record<string, any> = ((target as any).properties || {}) as Record<string, any>,\n) {\n const runtimeProps = runtimeState && typeof runtimeState === 'object'\n ? ((runtimeState as any)[WEVU_PROPS_KEY] as Record<string, any> | undefined)\n : undefined\n const props = runtimeProps && typeof runtimeProps === 'object'\n ? runtimeProps\n : shallowReactive({}) as Record<string, any>\n\n const declaredPropKeys = Array.isArray((target as any)[WEVU_PROP_KEYS_KEY])\n ? ((target as any)[WEVU_PROP_KEYS_KEY] as string[])\n : undefined\n syncRuntimeProps(props, mpProperties, declaredPropKeys)\n if (runtimeState && typeof runtimeState === 'object') {\n attachRuntimeProxyProps(runtimeState, props)\n }\n try {\n Object.defineProperty(target, WEVU_PROPS_KEY, {\n value: props,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n ;(target as any)[WEVU_PROPS_KEY] = props\n }\n\n return props\n}\n"],"mappings":";;;;;;AA8BA,SAAgB,wBAAwB,OAA4B,OAA4B;CAC9F,IAAI;EACF,OAAO,eAAe,OAAO,gBAAgB;GAC3C,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACH,AAAC,MAAc,kBAAkB;CACpC;AACF;AAEA,SAAgB,wBAAwB,OAA4B,YAAiC;CACnG,IAAI;EACF,OAAO,eAAe,OAAO,sBAAsB;GACjD,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACH,AAAC,MAAc,wBAAwB;CAC1C;AACF;AAEA,SAAgB,wBAAwB,OAA4B,UAAgC;CAClG,IAAI;EACF,OAAO,eAAe,OAAO,0BAA0B;GACrD,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACH,AAAC,MAAc,4BAA4B;CAC9C;AACF;AAEA,SAAgB,iBAAiB,OAA4B,SAAyC;CACpG,IAAI;EACF,OAAO,eAAe,OAAO,kBAAkB;GAC7C,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACH,AAAC,MAAc,oBAAoB;CACtC;AACF;AAEA,SAAgB,sBAAsB,SAAyC,UAAgC;CAC7G,IAAI;EACF,OAAO,eAAe,SAAgC,YAAY;GAChE,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACJ,IAAI;GACD,AAAC,QAAgC,WAAW;EAC/C,QACM,CAEN;CACF;AACF;AAEA,SAAgB,qBAAqB,UAAgC;CACnE,MAAM,gBAAiB,SAAiB;CACxC,MAAM,gBAAgB,iBAAiB,OAAO,cAAc,YAAY,aACpE,cAAc,UACd;CACJ,IAAI,OAAO,kBAAkB,cAAc,CAAC,qBAAqB,aAAa,GAC5E,OAAO;CAGT,MAAM,YAAa,SAAiB;CACpC,IAAI,OAAO,cAAc,YACvB;CAEF,IAAI,qBAAqB,SAAS,GAChC;CAEF,OAAO;AACT;AAEA,SAAS,qBAAqB,UAAgC;CAC5D,MAAM,QAAS,SAAiB;CAChC,IAAI,OAAO,UAAU,YAAY,OAC/B,OAAO;CAET,MAAM,KAAM,SAAiB;CAC7B,IAAI,OAAO,OAAO,YAAY,IAC5B,OAAO;CAET,OAAO;AACT;AAEA,SAAgB,kBACd,UACA,SACA,SACA,UACA;CACA,IAAI;EACF,OAAO,WACH,QAAQ,KAAK,UAAU,SAAS,QAAQ,IACxC,QAAQ,KAAK,UAAU,OAAO;CACpC,SACO,OAAO;EACZ,MAAM,QAAQ,qBAAqB,QAAQ;EAC3C,MAAM,IAAI,MAAM,0BAA0B,MAAM,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CAC/G;AACF;AAEA,SAAgB,iBACd,OACA,cACA,kBACA;CACA,MAAM,qBAAqB,mBAAmB,IAAI,IAAI,gBAAgB,IAAI;CAC1E,MAAM,cAAc,OAAO,KAAK,KAAK;CACrC,KAAK,MAAM,OAAO,aAChB,IAAI,CAAC,OAAO,cAAc,GAAG,KAAM,sBAAsB,CAAC,mBAAmB,IAAI,GAAG,GAClF,IAAI;EACF,OAAO,MAAM;CACf,QACM,CAEN;CAGJ,MAAM,WAAW,oBAAoB,OAAO,KAAK,YAAY;CAC7D,KAAK,MAAM,OAAO,UAChB,IAAI,OAAO,cAAc,GAAG,GAC1B,MAAM,OAAO,aAAa;AAGhC;AAEA,SAAgB,mBACd,QACA,cACA,eAAsC,OAAe,cAAc,CAAC,GACpE;CACA,MAAM,eAAe,gBAAgB,OAAO,iBAAiB,WACvD,aAAqB,kBACvB;CACJ,MAAM,QAAQ,gBAAgB,OAAO,iBAAiB,WAClD,eACA,gBAAgB,CAAC,CAAC;CAKtB,iBAAiB,OAAO,cAHC,MAAM,QAAS,OAAe,mBAAmB,IACpE,OAAe,sBACjB,MACkD;CACtD,IAAI,gBAAgB,OAAO,iBAAiB,UAC1C,wBAAwB,cAAc,KAAK;CAE7C,IAAI;EACF,OAAO,eAAe,QAAQ,gBAAgB;GAC5C,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,QACM;EACH,AAAC,OAAe,kBAAkB;CACrC;CAEA,OAAO;AACT"}
|
|
@@ -33,7 +33,7 @@ function cloneInitialSnapshotValue(value, cache = /* @__PURE__ */ new WeakMap())
|
|
|
33
33
|
return next;
|
|
34
34
|
}
|
|
35
35
|
function mergeBufferedSetDataPayload(buffered, incoming) {
|
|
36
|
-
const merged = buffered
|
|
36
|
+
const merged = buffered ?? {};
|
|
37
37
|
for (const [path, value] of Object.entries(incoming)) {
|
|
38
38
|
let ancestorPath;
|
|
39
39
|
for (const candidate of Object.keys(merged)) if (path.startsWith(`${candidate}.`)) {
|
|
@@ -61,45 +61,41 @@ function resolveInitialSnapshotFromNativeData(target, omitKeys, extraEntries) {
|
|
|
61
61
|
const omitSet = Array.isArray(omitKeys) && omitKeys.length ? new Set(omitKeys) : void 0;
|
|
62
62
|
const snapshot = {};
|
|
63
63
|
if (data && typeof data === "object") for (const [key, value] of Object.entries(data)) {
|
|
64
|
-
if (omitSet
|
|
64
|
+
if (omitSet?.has(key)) continue;
|
|
65
65
|
snapshot[key] = cloneInitialSnapshotValue(value);
|
|
66
66
|
}
|
|
67
67
|
if (extraEntries) for (const [key, value] of Object.entries(extraEntries)) {
|
|
68
|
-
if (omitSet
|
|
68
|
+
if (omitSet?.has(key)) continue;
|
|
69
69
|
snapshot[key] = cloneInitialSnapshotValue(value);
|
|
70
70
|
}
|
|
71
71
|
return snapshot;
|
|
72
72
|
}
|
|
73
73
|
function hasTemplateRuntimeBindings(runtimeApp) {
|
|
74
|
-
return Boolean(runtimeApp
|
|
74
|
+
return Boolean(runtimeApp?.__wevuHasTemplateRuntimeBindings);
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* 挂载运行时实例(框架内部注册流程使用)。
|
|
78
78
|
* @internal
|
|
79
79
|
*/
|
|
80
80
|
function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
81
|
-
var _runtime$proxy, _runtime$state, _runtime$setupState, _computed, _runtime$methods, _watch, _bindModel, _snapshot, _unmount;
|
|
82
81
|
if (target.__wevu) return target.__wevu;
|
|
83
82
|
const runtimeSetDataOptions = runtimeApp.__wevuSetDataOptions;
|
|
84
83
|
const scopedSlotHooks = hasTemplateRuntimeBindings(runtimeApp) ? requireRuntimeCapability("scopedSlots", "mountRuntimeInstance(scoped-slot bindings)") : void 0;
|
|
85
|
-
const scopedSlotState = scopedSlotHooks
|
|
84
|
+
const scopedSlotState = scopedSlotHooks?.prepareMount(target);
|
|
86
85
|
const templateRefBindings = target.__wevuTemplateRefs;
|
|
87
86
|
if (Array.isArray(templateRefBindings) && templateRefBindings.length) requireRuntimeCapability("templateRefs", "mountRuntimeInstance(template refs)");
|
|
88
|
-
const highFrequencyWarningHooks = isSetDataHighFrequencyWarningRequested(runtimeSetDataOptions
|
|
87
|
+
const highFrequencyWarningHooks = isSetDataHighFrequencyWarningRequested(runtimeSetDataOptions?.highFrequencyWarning) ? requireRuntimeCapability("setDataHighFrequencyWarning", "mountRuntimeInstance(setData.highFrequencyWarning)") : void 0;
|
|
89
88
|
attachRuntimeProvideParentContext(target, runtimeApp);
|
|
90
89
|
safeMarkNoSetData(target);
|
|
91
|
-
const suspendWhenHidden = Boolean(runtimeSetDataOptions
|
|
90
|
+
const suspendWhenHidden = Boolean(runtimeSetDataOptions?.suspendWhenHidden);
|
|
92
91
|
const targetLabel = typeof target.route === "string" && target.route ? `page:${target.route}` : typeof target.is === "string" && target.is ? `component:${target.is}` : "unknown-target";
|
|
93
|
-
const highFrequencyWarning = highFrequencyWarningHooks
|
|
94
|
-
option: runtimeSetDataOptions
|
|
92
|
+
const highFrequencyWarning = highFrequencyWarningHooks?.createMonitor({
|
|
93
|
+
option: runtimeSetDataOptions?.highFrequencyWarning,
|
|
95
94
|
targetLabel,
|
|
96
|
-
isInPageScrollHook: () =>
|
|
97
|
-
var _WEVU_PAGE_SCROLL_HOO;
|
|
98
|
-
return Number((_WEVU_PAGE_SCROLL_HOO = target[WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY]) !== null && _WEVU_PAGE_SCROLL_HOO !== void 0 ? _WEVU_PAGE_SCROLL_HOO : 0) > 0;
|
|
99
|
-
}
|
|
95
|
+
isInPageScrollHook: () => Number(target[WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY] ?? 0) > 0
|
|
100
96
|
});
|
|
101
97
|
let visible = true;
|
|
102
|
-
let enabled = !
|
|
98
|
+
let enabled = !options?.deferSetData;
|
|
103
99
|
let disposed = false;
|
|
104
100
|
let dispatchGeneration = 0;
|
|
105
101
|
let pendingPayload;
|
|
@@ -121,8 +117,8 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
121
117
|
};
|
|
122
118
|
const flushHostCommitWaiter = () => {
|
|
123
119
|
if (pendingHostCommits || pendingPayload) return;
|
|
124
|
-
if (hostCommitFailed) rejectHostCommit
|
|
125
|
-
else resolveHostCommit
|
|
120
|
+
if (hostCommitFailed) rejectHostCommit?.(hostCommitCause);
|
|
121
|
+
else resolveHostCommit?.();
|
|
126
122
|
hostCommitPromise = void 0;
|
|
127
123
|
resolveHostCommit = void 0;
|
|
128
124
|
rejectHostCommit = void 0;
|
|
@@ -144,9 +140,8 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
144
140
|
configurable: true,
|
|
145
141
|
enumerable: false,
|
|
146
142
|
get: () => {
|
|
147
|
-
var _hostCommitPromise;
|
|
148
143
|
if (!pendingHostCommits && !pendingPayload) return hostCommitFailed ? Promise.reject(hostCommitCause) : void 0;
|
|
149
|
-
|
|
144
|
+
hostCommitPromise ?? (hostCommitPromise = new Promise((resolve, reject) => {
|
|
150
145
|
resolveHostCommit = resolve;
|
|
151
146
|
rejectHostCommit = reject;
|
|
152
147
|
}));
|
|
@@ -154,10 +149,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
154
149
|
}
|
|
155
150
|
});
|
|
156
151
|
const refreshOwnerSnapshot = () => {
|
|
157
|
-
if (scopedSlotState)
|
|
158
|
-
var _runtimeCapabilityReg;
|
|
159
|
-
(_runtimeCapabilityReg = runtimeCapabilityRegistry.scopedSlots) === null || _runtimeCapabilityReg === void 0 || _runtimeCapabilityReg.refresh(target, scopedSlotState);
|
|
160
|
-
}
|
|
152
|
+
if (scopedSlotState) runtimeCapabilityRegistry.scopedSlots?.refresh(target, scopedSlotState);
|
|
161
153
|
};
|
|
162
154
|
const completeSuccessfulSetData = () => {
|
|
163
155
|
if (disposed) return;
|
|
@@ -169,7 +161,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
169
161
|
requireRuntimeCapability("templateRefs", "mountRuntimeInstance(template ref completion)").schedule(target, ownsHostCommit ? finishHostCommit : void 0, target, ownsHostCommit ? failHostCommit : void 0);
|
|
170
162
|
};
|
|
171
163
|
const syncNativeOwnerId = () => {
|
|
172
|
-
if (scopedSlotState) scopedSlotHooks
|
|
164
|
+
if (scopedSlotState) scopedSlotHooks?.syncNativeOwnerId(target, scopedSlotState);
|
|
173
165
|
};
|
|
174
166
|
const appendPendingSettlement = (settle) => {
|
|
175
167
|
const record = {
|
|
@@ -259,7 +251,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
259
251
|
};
|
|
260
252
|
const baseMountAdapter = {
|
|
261
253
|
setData(payload, callback) {
|
|
262
|
-
highFrequencyWarning
|
|
254
|
+
highFrequencyWarning?.();
|
|
263
255
|
if (!enabled || suspendWhenHidden && !visible) {
|
|
264
256
|
bufferPayload(payload);
|
|
265
257
|
if (callback) pendingRawCallbacks.push(callback);
|
|
@@ -272,7 +264,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
272
264
|
const setData = resolveNativeSetData(target);
|
|
273
265
|
if (!setData) {
|
|
274
266
|
try {
|
|
275
|
-
callback
|
|
267
|
+
callback?.();
|
|
276
268
|
} catch (cause) {
|
|
277
269
|
finishHostCommit("failed", cause);
|
|
278
270
|
throw cause;
|
|
@@ -296,7 +288,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
296
288
|
};
|
|
297
289
|
const nativeCallback = () => {
|
|
298
290
|
try {
|
|
299
|
-
callback
|
|
291
|
+
callback?.();
|
|
300
292
|
} catch (cause) {
|
|
301
293
|
handleFailure(cause);
|
|
302
294
|
throw cause;
|
|
@@ -326,7 +318,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
326
318
|
return result;
|
|
327
319
|
},
|
|
328
320
|
__wevu_dispatchSetData(payload, settle) {
|
|
329
|
-
highFrequencyWarning
|
|
321
|
+
highFrequencyWarning?.();
|
|
330
322
|
if (disposed) {
|
|
331
323
|
settle("abandoned");
|
|
332
324
|
return;
|
|
@@ -388,13 +380,13 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
388
380
|
value: targetProperties,
|
|
389
381
|
writable: false
|
|
390
382
|
});
|
|
391
|
-
if (Array.isArray(options
|
|
383
|
+
if (Array.isArray(options?.snapshotOmitKeys) && options.snapshotOmitKeys.length) Object.defineProperty(baseMountAdapter, "__wevu_snapshotOmitKeys", {
|
|
392
384
|
configurable: true,
|
|
393
385
|
enumerable: false,
|
|
394
386
|
value: options.snapshotOmitKeys,
|
|
395
387
|
writable: false
|
|
396
388
|
});
|
|
397
|
-
const initialSnapshot = resolveInitialSnapshotFromNativeData(target, options
|
|
389
|
+
const initialSnapshot = resolveInitialSnapshotFromNativeData(target, options?.snapshotOmitKeys);
|
|
398
390
|
if (initialSnapshot && Object.keys(initialSnapshot).length) Object.defineProperty(baseMountAdapter, "__wevu_initialSnapshot", {
|
|
399
391
|
configurable: true,
|
|
400
392
|
enumerable: false,
|
|
@@ -407,7 +399,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
407
399
|
value: { [WEVU_SLOT_OWNER_ID_KEY]: scopedSlotState.ownerId },
|
|
408
400
|
writable: false
|
|
409
401
|
});
|
|
410
|
-
if (Boolean(options
|
|
402
|
+
if (Boolean(options?.deferSetData) || Boolean(setup) || Boolean(targetProperties && typeof targetProperties === "object" && Object.keys(targetProperties).length > 0)) Object.defineProperty(baseMountAdapter, "__wevu_deferInitialSnapshot", {
|
|
411
403
|
configurable: true,
|
|
412
404
|
enumerable: false,
|
|
413
405
|
value: true,
|
|
@@ -415,22 +407,22 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
415
407
|
});
|
|
416
408
|
const runtime = runtimeApp.mount(baseMountAdapter);
|
|
417
409
|
attachRuntimeInstance(runtime, target);
|
|
418
|
-
const runtimeProxy =
|
|
419
|
-
const runtimeState =
|
|
420
|
-
const runtimeSetupState =
|
|
410
|
+
const runtimeProxy = runtime?.proxy ?? {};
|
|
411
|
+
const runtimeState = runtime?.state ?? {};
|
|
412
|
+
const runtimeSetupState = runtime?.setupState ?? Object.create(null);
|
|
421
413
|
if (runtimeState && typeof runtimeState === "object") {
|
|
422
414
|
attachRuntimeRef(runtimeState, runtime);
|
|
423
415
|
attachNativeInstanceRef(runtimeState, target);
|
|
424
416
|
}
|
|
425
|
-
const runtimeComputed =
|
|
426
|
-
if (!
|
|
417
|
+
const runtimeComputed = runtime?.computed ?? Object.create(null);
|
|
418
|
+
if (!runtime?.methods) try {
|
|
427
419
|
runtime.methods = Object.create(null);
|
|
428
|
-
} catch
|
|
429
|
-
const runtimeMethods =
|
|
430
|
-
const runtimeWatch =
|
|
431
|
-
const runtimeBindModel =
|
|
420
|
+
} catch {}
|
|
421
|
+
const runtimeMethods = runtime?.methods ?? Object.create(null);
|
|
422
|
+
const runtimeWatch = runtime?.watch ?? (() => createNoopWatchStopHandle());
|
|
423
|
+
const runtimeBindModel = runtime?.bindModel ?? (() => {});
|
|
432
424
|
const runtimeWithDefaults = {
|
|
433
|
-
...runtime
|
|
425
|
+
...runtime ?? {},
|
|
434
426
|
state: runtimeState,
|
|
435
427
|
setupState: runtimeSetupState,
|
|
436
428
|
proxy: runtimeProxy,
|
|
@@ -438,8 +430,8 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
438
430
|
computed: runtimeComputed,
|
|
439
431
|
watch: runtimeWatch,
|
|
440
432
|
bindModel: runtimeBindModel,
|
|
441
|
-
snapshot:
|
|
442
|
-
unmount:
|
|
433
|
+
snapshot: runtime?.snapshot ?? (() => Object.create(null)),
|
|
434
|
+
unmount: runtime?.unmount ?? (() => {})
|
|
443
435
|
};
|
|
444
436
|
Object.defineProperty(runtimeWithDefaults, "__wevu_initialRuntimeSnapshot", {
|
|
445
437
|
configurable: true,
|
|
@@ -473,12 +465,11 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
473
465
|
target.__wevu = runtimeWithDefaults;
|
|
474
466
|
const runtimeProps = ensureRuntimeProps(target, runtimeState);
|
|
475
467
|
attachRuntimeSlots(runtimeState, runtimeProps);
|
|
476
|
-
if (scopedSlotState) scopedSlotHooks
|
|
468
|
+
if (scopedSlotState) scopedSlotHooks?.attachMount(target, runtimeWithDefaults, scopedSlotState, Boolean(options?.deferSetData));
|
|
477
469
|
syncNativeOwnerId();
|
|
478
470
|
const watchStops = watchMap ? registerWatches(runtimeWithDefaults, watchMap, target, { deferMissingSourceBaseline: Boolean(setup) }) : [];
|
|
479
471
|
if (watchStops.length) target[WEVU_WATCH_STOPS_KEY] = watchStops;
|
|
480
472
|
if (setup) try {
|
|
481
|
-
var _getMiniProgramRuntim;
|
|
482
473
|
runRuntimeSetupPhase({
|
|
483
474
|
target,
|
|
484
475
|
runtime,
|
|
@@ -487,27 +478,22 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
487
478
|
runtimeProxy,
|
|
488
479
|
setup
|
|
489
480
|
});
|
|
490
|
-
if (typeof
|
|
491
|
-
var _runtimeWithDefaults$;
|
|
481
|
+
if (typeof getMiniProgramRuntimeGlobalObject()?.[WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY]?.trackWevuComponent === "function") {
|
|
492
482
|
const initialReactiveSetupSnapshot = {};
|
|
493
|
-
for (const [key, value] of Object.entries(
|
|
483
|
+
for (const [key, value] of Object.entries(runtimeWithDefaults.setupState ?? {})) if (isReactive(value)) initialReactiveSetupSnapshot[key] = cloneInitialSnapshotValue(value);
|
|
494
484
|
initialReactiveSetupSnapshots.set(runtimeWithDefaults, initialReactiveSetupSnapshot);
|
|
495
485
|
}
|
|
496
|
-
if (!
|
|
497
|
-
|
|
498
|
-
(_runtimeWithSyncFlush = runtimeWithSyncFlush.__wevu_flushSetupSnapshotSync) === null || _runtimeWithSyncFlush === void 0 || _runtimeWithSyncFlush.call(runtimeWithSyncFlush);
|
|
499
|
-
}
|
|
500
|
-
if (!(options === null || options === void 0 ? void 0 : options.deferSetData)) refreshOwnerSnapshot();
|
|
486
|
+
if (!options?.deferSetData) runtimeWithSyncFlush.__wevu_flushSetupSnapshotSync?.();
|
|
487
|
+
if (!options?.deferSetData) refreshOwnerSnapshot();
|
|
501
488
|
for (const stop of watchStops) stop.resume();
|
|
502
489
|
} catch (error) {
|
|
503
490
|
try {
|
|
504
491
|
teardownRuntimeInstance(target, { skipHooks: true });
|
|
505
|
-
} catch
|
|
492
|
+
} catch {}
|
|
506
493
|
throw error;
|
|
507
494
|
}
|
|
508
|
-
else if (!
|
|
509
|
-
|
|
510
|
-
(_runtimeWithSyncFlush2 = runtimeWithSyncFlush.__wevu_flushSetupSnapshotSync) === null || _runtimeWithSyncFlush2 === void 0 || _runtimeWithSyncFlush2.call(runtimeWithSyncFlush);
|
|
495
|
+
else if (!options?.deferSetData && target.properties && typeof target.properties === "object" && Object.keys(target.properties).length > 0) {
|
|
496
|
+
runtimeWithSyncFlush.__wevu_flushSetupSnapshotSync?.();
|
|
511
497
|
refreshOwnerSnapshot();
|
|
512
498
|
}
|
|
513
499
|
bridgeRuntimeMethodsToTarget(target, runtime);
|
|
@@ -515,18 +501,17 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
515
501
|
}
|
|
516
502
|
function preserveRuntimeFacadeIdentity(target, previousRuntime, nextRuntime) {
|
|
517
503
|
for (const key of Reflect.ownKeys(previousRuntime)) if (!Reflect.has(nextRuntime, key)) {
|
|
518
|
-
|
|
519
|
-
if (descriptor === null || descriptor === void 0 ? void 0 : descriptor.configurable) Reflect.deleteProperty(previousRuntime, key);
|
|
504
|
+
if (Reflect.getOwnPropertyDescriptor(previousRuntime, key)?.configurable) Reflect.deleteProperty(previousRuntime, key);
|
|
520
505
|
}
|
|
521
506
|
for (const key of Reflect.ownKeys(nextRuntime)) {
|
|
522
507
|
const descriptor = Reflect.getOwnPropertyDescriptor(nextRuntime, key);
|
|
523
508
|
if (!descriptor) continue;
|
|
524
509
|
try {
|
|
525
510
|
Reflect.defineProperty(previousRuntime, key, descriptor);
|
|
526
|
-
} catch
|
|
511
|
+
} catch {
|
|
527
512
|
try {
|
|
528
513
|
previousRuntime[key] = nextRuntime[key];
|
|
529
|
-
} catch
|
|
514
|
+
} catch {}
|
|
530
515
|
}
|
|
531
516
|
}
|
|
532
517
|
attachRuntimeRef(previousRuntime.state, previousRuntime);
|
|
@@ -545,9 +530,9 @@ function createRuntimeStateSnapshot(runtime, nativeData, preferredState) {
|
|
|
545
530
|
const runtimeState = runtime.state;
|
|
546
531
|
const setupState = runtime.setupState;
|
|
547
532
|
const snapshot = {};
|
|
548
|
-
for (const key of Object.keys(nativeData
|
|
533
|
+
for (const key of Object.keys(nativeData ?? {})) {
|
|
549
534
|
if (!Object.prototype.hasOwnProperty.call(runtimeState, key)) continue;
|
|
550
|
-
const setupBinding = setupState
|
|
535
|
+
const setupBinding = setupState?.[key];
|
|
551
536
|
if (setupState && Object.prototype.hasOwnProperty.call(setupState, key) && !isRef(setupBinding) && !isReactive(setupBinding)) continue;
|
|
552
537
|
if (preferredState && Object.prototype.hasOwnProperty.call(preferredState, key)) {
|
|
553
538
|
snapshot[key] = cloneInitialSnapshotValue(preferredState[key]);
|
|
@@ -558,47 +543,42 @@ function createRuntimeStateSnapshot(runtime, nativeData, preferredState) {
|
|
|
558
543
|
return snapshot;
|
|
559
544
|
}
|
|
560
545
|
function syncRuntimeStateFromNativeData(target, options) {
|
|
561
|
-
var _options$nativeData;
|
|
562
546
|
const runtime = target.__wevu;
|
|
563
|
-
const runtimeState = runtime
|
|
564
|
-
const setupState = runtime
|
|
565
|
-
const nativeData =
|
|
547
|
+
const runtimeState = runtime?.state;
|
|
548
|
+
const setupState = runtime?.setupState;
|
|
549
|
+
const nativeData = options?.nativeData ?? target.data;
|
|
566
550
|
if (!runtimeState || typeof runtimeState !== "object" || !nativeData || typeof nativeData !== "object") return;
|
|
567
|
-
const initialRuntimeSnapshot = runtime
|
|
551
|
+
const initialRuntimeSnapshot = runtime?.__wevu_initialRuntimeSnapshot;
|
|
568
552
|
for (const [key, value] of Object.entries(nativeData)) {
|
|
569
553
|
if (!key || key === "undefined") continue;
|
|
570
554
|
if (Object.prototype.hasOwnProperty.call(runtimeState, key)) try {
|
|
571
|
-
const setupBinding = setupState
|
|
555
|
+
const setupBinding = setupState?.[key];
|
|
572
556
|
const runtimeValue = cloneInitialSnapshotValue(value);
|
|
573
557
|
if (setupState && Object.prototype.hasOwnProperty.call(setupState, key)) {
|
|
574
|
-
if (!
|
|
558
|
+
if (!options?.includeSetupState || !isRef(setupBinding) && !isReactive(setupBinding)) continue;
|
|
575
559
|
}
|
|
576
|
-
if (!
|
|
577
|
-
if (!
|
|
560
|
+
if (!options?.includeSetupState && initialRuntimeSnapshot && Object.prototype.hasOwnProperty.call(initialRuntimeSnapshot, key) && !isDeepEqualValue(runtimeState[key], initialRuntimeSnapshot[key], 20, { keys: 1e4 })) continue;
|
|
561
|
+
if (!options?.includeSetupState && initialRuntimeSnapshot && !Object.prototype.hasOwnProperty.call(initialRuntimeSnapshot, key)) continue;
|
|
578
562
|
if (isRef(setupBinding)) {
|
|
579
563
|
setupBinding.value = runtimeValue;
|
|
580
564
|
continue;
|
|
581
565
|
}
|
|
582
566
|
if (isReactive(setupBinding) && runtimeValue && typeof runtimeValue === "object") {
|
|
583
|
-
|
|
584
|
-
restoreReactiveSetupSnapshot(setupBinding, runtimeValue, options === null || options === void 0 || (_options$initialSetup = options.initialSetupState) === null || _options$initialSetup === void 0 ? void 0 : _options$initialSetup[key]);
|
|
567
|
+
restoreReactiveSetupSnapshot(setupBinding, runtimeValue, options?.initialSetupState?.[key]);
|
|
585
568
|
continue;
|
|
586
569
|
}
|
|
587
570
|
runtimeState[key] = runtimeValue;
|
|
588
|
-
} catch
|
|
571
|
+
} catch {}
|
|
589
572
|
}
|
|
590
573
|
}
|
|
591
574
|
function enableDeferredSetData(target, options) {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
(_wevu = target.__wevu) === null || _wevu === void 0 || (_wevu$__wevu_flushSet = _wevu.__wevu_flushSetupSnapshotSync) === null || _wevu$__wevu_flushSet === void 0 || _wevu$__wevu_flushSet.call(_wevu);
|
|
575
|
+
const adapter = target.__wevu?.adapter;
|
|
576
|
+
syncRuntimeStateFromNativeData(target, { includeSetupState: options?.rehydrateSetupState });
|
|
577
|
+
adapter?.__wevu_enableSetData?.(true);
|
|
578
|
+
target.__wevu?.__wevu_flushSetupSnapshotSync?.();
|
|
597
579
|
}
|
|
598
580
|
function setRuntimeSetDataVisibility(target, visible) {
|
|
599
|
-
|
|
600
|
-
const adapter = (_target$__wevu2 = target.__wevu) === null || _target$__wevu2 === void 0 ? void 0 : _target$__wevu2.adapter;
|
|
601
|
-
adapter === null || adapter === void 0 || (_adapter$__wevu_setVi = adapter.__wevu_setVisibility) === null || _adapter$__wevu_setVi === void 0 || _adapter$__wevu_setVi.call(adapter, visible);
|
|
581
|
+
(target.__wevu?.adapter)?.__wevu_setVisibility?.(visible);
|
|
602
582
|
}
|
|
603
583
|
/**
|
|
604
584
|
* 卸载运行时实例(框架内部注册流程使用)。
|
|
@@ -610,24 +590,20 @@ function teardownRuntimeInstance(target, options) {
|
|
|
610
590
|
const effectScope$1 = target[WEVU_EFFECT_SCOPE_KEY];
|
|
611
591
|
runTeardownSteps([
|
|
612
592
|
() => {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
if (effectScope$1 === null || effectScope$1 === void 0 ? void 0 : effectScope$1.active) effectScope$1.run(() => callHookList(target, WEVU_ON_BEFORE_UNMOUNT_HOOK));
|
|
593
|
+
if (!options?.skipHooks && runtime && target[WEVU_HOOKS_KEY]?.[WEVU_ON_BEFORE_UNMOUNT_HOOK]) {
|
|
594
|
+
if (effectScope$1?.active) effectScope$1.run(() => callHookList(target, WEVU_ON_BEFORE_UNMOUNT_HOOK));
|
|
616
595
|
else {
|
|
617
596
|
const teardownScope = effectScope(true);
|
|
618
597
|
runTeardownSteps([() => teardownScope.run(() => callHookList(target, WEVU_ON_BEFORE_UNMOUNT_HOOK)), () => teardownScope.stop()]);
|
|
619
598
|
}
|
|
620
599
|
}
|
|
621
600
|
},
|
|
622
|
-
() =>
|
|
623
|
-
var _runtimeCapabilityReg2;
|
|
624
|
-
return (_runtimeCapabilityReg2 = runtimeCapabilityRegistry.scopedSlots) === null || _runtimeCapabilityReg2 === void 0 ? void 0 : _runtimeCapabilityReg2.teardown(target);
|
|
625
|
-
},
|
|
601
|
+
() => runtimeCapabilityRegistry.scopedSlots?.teardown(target),
|
|
626
602
|
() => {
|
|
627
603
|
if (Array.isArray(target.__wevuTemplateRefs) && target.__wevuTemplateRefs.length > 0) requireRuntimeCapability("templateRefs", "teardownRuntimeInstance(template refs)").clear(target);
|
|
628
604
|
},
|
|
629
605
|
() => {
|
|
630
|
-
if (!
|
|
606
|
+
if (!options?.skipHooks && runtime && target[WEVU_HOOKS_KEY]) callHookList(target, "onUnload", []);
|
|
631
607
|
},
|
|
632
608
|
() => {
|
|
633
609
|
if (target[WEVU_HOOKS_KEY]) target[WEVU_HOOKS_KEY] = void 0;
|
|
@@ -635,22 +611,20 @@ function teardownRuntimeInstance(target, options) {
|
|
|
635
611
|
() => {
|
|
636
612
|
if (Array.isArray(stops)) for (const stop of stops) try {
|
|
637
613
|
stop();
|
|
638
|
-
} catch
|
|
614
|
+
} catch {}
|
|
639
615
|
},
|
|
640
616
|
() => {
|
|
641
617
|
target[WEVU_WATCH_STOPS_KEY] = void 0;
|
|
642
618
|
},
|
|
643
619
|
() => {
|
|
644
|
-
effectScope$1
|
|
620
|
+
effectScope$1?.stop();
|
|
645
621
|
},
|
|
646
622
|
() => {
|
|
647
623
|
target[WEVU_EFFECT_SCOPE_KEY] = void 0;
|
|
648
624
|
},
|
|
649
|
-
() => runtime
|
|
625
|
+
() => runtime?.unmount(),
|
|
650
626
|
() => {
|
|
651
|
-
|
|
652
|
-
const adapter = runtime === null || runtime === void 0 ? void 0 : runtime.adapter;
|
|
653
|
-
adapter === null || adapter === void 0 || (_adapter$__wevu_dispo = adapter.__wevu_disposeSetData) === null || _adapter$__wevu_dispo === void 0 || _adapter$__wevu_dispo.call(adapter);
|
|
627
|
+
(runtime?.adapter)?.__wevu_disposeSetData?.();
|
|
654
628
|
},
|
|
655
629
|
() => {
|
|
656
630
|
delete target[WEVU_SETUP_CONTEXT_INSTANCE_KEY];
|
|
@@ -671,13 +645,13 @@ function teardownRuntimeInstance(target, options) {
|
|
|
671
645
|
function refreshRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
672
646
|
const previousRuntime = target.__wevu;
|
|
673
647
|
const initialSetupState = previousRuntime ? initialReactiveSetupSnapshots.get(previousRuntime) : void 0;
|
|
674
|
-
const previousRuntimeState = previousRuntime ? createRuntimeStateSnapshot(previousRuntime, target.data, options
|
|
648
|
+
const previousRuntimeState = previousRuntime ? createRuntimeStateSnapshot(previousRuntime, target.data, options?.stateSnapshot) : void 0;
|
|
675
649
|
teardownRuntimeInstance(target, { skipHooks: true });
|
|
676
650
|
const nextRuntime = mountRuntimeInstance(target, runtimeApp, watchMap, setup, {
|
|
677
651
|
deferSetData: true,
|
|
678
|
-
snapshotOmitKeys: options
|
|
652
|
+
snapshotOmitKeys: options?.snapshotOmitKeys
|
|
679
653
|
});
|
|
680
|
-
const stateSnapshot = previousRuntimeState
|
|
654
|
+
const stateSnapshot = previousRuntimeState ?? (options?.stateSnapshot ? createRuntimeStateSnapshot(nextRuntime, options.stateSnapshot, options.stateSnapshot) : void 0);
|
|
681
655
|
if (stateSnapshot) {
|
|
682
656
|
const nativeData = target.data;
|
|
683
657
|
if (nativeData && typeof nativeData === "object") Object.assign(nativeData, cloneInitialSnapshotValue(stateSnapshot));
|