diff --git a/package.json b/package.json index 57a0b954f61f06a99ac4e880b27759bdcfa8b2d5..c889895ef5cfd4640d3fa8b9d1e481fdc43aa687 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "rollup-plugin-vue": "^6.0.0", "semver": "^7.3.5", "ts-jest": "^27.0.3", - "typescript": "4.6.2", + "typescript": "4.6.3", "vite": "^2.8.6", "vue": "3.2.31", "vue-router": "^4.0.14", diff --git a/packages/uni-mp-vue/dist/vue.runtime.esm.js b/packages/uni-mp-vue/dist/vue.runtime.esm.js index 3cd02c2f8a05194a4d3487839ff7fd0808ac1f9c..99b91e76fc30aca2595f25c246b03b6b57b4a756 100644 --- a/packages/uni-mp-vue/dist/vue.runtime.esm.js +++ b/packages/uni-mp-vue/dist/vue.runtime.esm.js @@ -5364,15 +5364,13 @@ function createInvoker(initialValue, instance) { args = e.detail.__args__; } const eventValue = invoker.value; - const invoke = () => { - callWithAsyncErrorHandling(patchStopImmediatePropagation(e, eventValue), instance, 5 /* NATIVE_EVENT_HANDLER */, args); - }; + const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e, eventValue), instance, 5 /* NATIVE_EVENT_HANDLER */, args); // 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228 if (bubbles.includes(e.type)) { setTimeout(invoke); } else { - invoke(); + return invoke(); } }; invoker.value = initialValue; diff --git a/packages/uni-mp-vue/src/helpers/vOn.ts b/packages/uni-mp-vue/src/helpers/vOn.ts index e7f8902d8ff19e6726299c8ed57246eb87dfa930..0039c928fabbb41f4d7a9885937f767e158c3e19 100644 --- a/packages/uni-mp-vue/src/helpers/vOn.ts +++ b/packages/uni-mp-vue/src/helpers/vOn.ts @@ -16,7 +16,7 @@ import { type EventValue = Function | Function[] interface Invoker { - (evt: MPEvent): void + (evt: MPEvent): unknown value: EventValue } @@ -76,19 +76,19 @@ function createInvoker( args = (e as MPEvent).detail.__args__! } const eventValue = invoker.value - const invoke = () => { + const invoke = () => callWithAsyncErrorHandling( patchStopImmediatePropagation(e, eventValue), instance, ErrorCodes.NATIVE_EVENT_HANDLER, args ) - } + // 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228 if (bubbles.includes(e.type)) { setTimeout(invoke) } else { - invoke() + return invoke() } } invoker.value = initialValue diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bc815d41bd8715ecab3ae5ed90ec4d8c73fefcb..ca8e57970673b429990839ed87fe0e8bed3238e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,7 +46,7 @@ importers: rollup-plugin-vue: ^6.0.0 semver: ^7.3.5 ts-jest: ^27.0.3 - typescript: 4.6.2 + typescript: 4.6.3 vite: ^2.8.6 vue: 3.2.31 vue-router: ^4.0.14 @@ -66,7 +66,7 @@ importers: '@rollup/plugin-replace': 2.4.2_rollup@2.60.2 '@rollup/plugin-strip': 2.1.0_rollup@2.60.2 '@types/jest': 26.0.24 - '@typescript-eslint/parser': 5.14.0_eslint@7.32.0+typescript@4.6.2 + '@typescript-eslint/parser': 5.14.0_eslint@7.32.0+typescript@4.6.3 '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 '@vitejs/plugin-vue-jsx': 1.3.8 '@vue/reactivity': 3.2.31 @@ -90,11 +90,11 @@ importers: rollup-plugin-node-builtins: 2.1.2 rollup-plugin-node-globals: 1.4.0 rollup-plugin-terser: 7.0.2_rollup@2.60.2 - rollup-plugin-typescript2: 0.29.0_rollup@2.60.2+typescript@4.6.2 + rollup-plugin-typescript2: 0.29.0_rollup@2.60.2+typescript@4.6.3 rollup-plugin-vue: 6.0.0 semver: 7.3.5 - ts-jest: 27.1.0_10dfe7065d15c80fe56b2c6373c06482 - typescript: 4.6.2 + ts-jest: 27.1.0_2528360f5083edd4f29e3d452ccadc0f + typescript: 4.6.3 vite: 2.8.6 vue: 3.2.31 vue-router: 4.0.14_vue@3.2.31 @@ -3067,7 +3067,7 @@ packages: dev: true optional: true - /@typescript-eslint/parser/5.14.0_eslint@7.32.0+typescript@4.6.2: + /@typescript-eslint/parser/5.14.0_eslint@7.32.0+typescript@4.6.3: resolution: {integrity: sha512-aHJN8/FuIy1Zvqk4U/gcO/fxeMKyoSv/rS46UXMXOJKVsLQ+iYPuXNbpbH7cBLcpSbmyyFbwrniLx5+kutu1pw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3079,10 +3079,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.14.0 '@typescript-eslint/types': 5.14.0 - '@typescript-eslint/typescript-estree': 5.14.0_typescript@4.6.2 + '@typescript-eslint/typescript-estree': 5.14.0_typescript@4.6.3 debug: 4.3.3 eslint: 7.32.0 - typescript: 4.6.2 + typescript: 4.6.3 transitivePeerDependencies: - supports-color dev: true @@ -3100,7 +3100,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.14.0_typescript@4.6.2: + /@typescript-eslint/typescript-estree/5.14.0_typescript@4.6.3: resolution: {integrity: sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3115,8 +3115,8 @@ packages: globby: 11.0.4 is-glob: 4.0.3 semver: 7.3.5 - tsutils: 3.21.0_typescript@4.6.2 - typescript: 4.6.2 + tsutils: 3.21.0_typescript@4.6.3 + typescript: 4.6.3 transitivePeerDependencies: - supports-color dev: true @@ -7857,7 +7857,7 @@ packages: - acorn dev: true - /rollup-plugin-typescript2/0.29.0_rollup@2.60.2+typescript@4.6.2: + /rollup-plugin-typescript2/0.29.0_rollup@2.60.2+typescript@4.6.3: resolution: {integrity: sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw==} peerDependencies: rollup: '>=1.26.3' @@ -7869,7 +7869,7 @@ packages: resolve: 1.17.0 rollup: 2.60.2 tslib: 2.0.1 - typescript: 4.6.2 + typescript: 4.6.3 dev: true /rollup-plugin-vue/6.0.0: @@ -8363,7 +8363,7 @@ packages: punycode: 2.1.1 dev: true - /ts-jest/27.1.0_10dfe7065d15c80fe56b2c6373c06482: + /ts-jest/27.1.0_2528360f5083edd4f29e3d452ccadc0f: resolution: {integrity: sha512-ZouWlP03JMtzfNHg0ZeDrxAESYGmVhWyHtIl2/01kBbXaMbTr4Vhv6/GeMxUed6GFg/4ycMo+yU6Eo9gI16xTQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} hasBin: true @@ -8391,7 +8391,7 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.5 - typescript: 4.6.2 + typescript: 4.6.3 yargs-parser: 20.2.9 dev: true @@ -8407,14 +8407,14 @@ packages: resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==} dev: true - /tsutils/3.21.0_typescript@4.6.2: + /tsutils/3.21.0_typescript@4.6.3: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.6.2 + typescript: 4.6.3 dev: true /tunnel-agent/0.6.0: @@ -8484,8 +8484,8 @@ packages: hasBin: true dev: true - /typescript/4.6.2: - resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==} + /typescript/4.6.3: + resolution: {integrity: sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==} engines: {node: '>=4.2.0'} hasBin: true dev: true