From f2eaeb1db1380f0c3981c3acb3b6e0349ec9dd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Wed, 23 Mar 2022 15:36:59 +0800 Subject: [PATCH 1/9] fix(miniapp): can't use animation events in view in wechat --- .../src/builtInComponents/view.js | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/miniapp-render/src/builtInComponents/view.js b/packages/miniapp-render/src/builtInComponents/view.js index b4e89004..90563771 100644 --- a/packages/miniapp-render/src/builtInComponents/view.js +++ b/packages/miniapp-render/src/builtInComponents/view.js @@ -2,11 +2,29 @@ import { isMiniApp } from 'universal-env'; const view = { - name: 'view' + name: 'view', + simpleEvents: [ + { + name: 'onViewTransitionEnd', + eventName: 'transitionend' + }, + { + name: 'onViewAnimationIteration', + eventName: 'animationiteration' + }, + { + name: 'onViewAnimationStart', + eventName: 'animationstart' + }, + { + name: 'onViewAnimationEnd', + eventName: 'animationend' + } + ] }; if (isMiniApp) { - view.simpleEvents = [{ + view.simpleEvents = view.simpleEvents.concat[{ name: 'onViewAppear', eventName: 'appear' }, @@ -17,22 +35,6 @@ if (isMiniApp) { { name: 'onViewDisappear', eventName: 'disappear' - }, - { - name: 'onViewTransitionEnd', - eventName: 'transitionend' - }, - { - name: 'onViewAnimationIteration', - eventName: 'animationiteration' - }, - { - name: 'onViewAnimationStart', - eventName: 'animationstart' - }, - { - name: 'onViewAnimationEnd', - eventName: 'animationend' }]; } From 24a690ade20bef685217927bf1aa7fcb94877030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Wed, 23 Mar 2022 15:38:04 +0800 Subject: [PATCH 2/9] build(miniapp): publish miniapp-render v2.8.9 --- packages/miniapp-render/CHANGELOG.md | 7 +++++++ packages/miniapp-render/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/miniapp-render/CHANGELOG.md b/packages/miniapp-render/CHANGELOG.md index e6f36557..19c24b66 100644 --- a/packages/miniapp-render/CHANGELOG.md +++ b/packages/miniapp-render/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog + +## [2.8.9] - 2022-03-23 + +### Fixed + +- can't use animation events in view in non-ali miniapps + ## [2.8.8] - 2022-01-06 ### Fixed diff --git a/packages/miniapp-render/package.json b/packages/miniapp-render/package.json index 1fb55115..b6c29986 100644 --- a/packages/miniapp-render/package.json +++ b/packages/miniapp-render/package.json @@ -1,6 +1,6 @@ { "name": "miniapp-render", - "version": "2.8.8", + "version": "2.8.9", "description": "DOM simulator for MiniApp", "files": [ "dist" From f382a8e80397f2bfff0910ec5b5f2ddfa17ef35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Fri, 1 Apr 2022 16:37:53 +0800 Subject: [PATCH 3/9] fix(miniapp): view simpleEvents in ali miniapp --- packages/miniapp-render/src/builtInComponents/view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/miniapp-render/src/builtInComponents/view.js b/packages/miniapp-render/src/builtInComponents/view.js index 90563771..8e34ddf2 100644 --- a/packages/miniapp-render/src/builtInComponents/view.js +++ b/packages/miniapp-render/src/builtInComponents/view.js @@ -24,7 +24,7 @@ const view = { }; if (isMiniApp) { - view.simpleEvents = view.simpleEvents.concat[{ + view.simpleEvents = view.simpleEvents.concat([{ name: 'onViewAppear', eventName: 'appear' }, @@ -35,7 +35,7 @@ if (isMiniApp) { { name: 'onViewDisappear', eventName: 'disappear' - }]; + }]); } export default view; From d044955ebbb82a5dde39890a0c2ad15ab112a6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Fri, 22 Apr 2022 14:07:47 +0800 Subject: [PATCH 4/9] fix(miniapp): optimize addEventListener and removeEventListener --- packages/miniapp-render/src/event/event-target.js | 6 +++++- packages/miniapp-render/src/utils/tool.js | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/miniapp-render/src/event/event-target.js b/packages/miniapp-render/src/event/event-target.js index 2d0aee5c..cfe125bc 100755 --- a/packages/miniapp-render/src/event/event-target.js +++ b/packages/miniapp-render/src/event/event-target.js @@ -2,6 +2,7 @@ import { isMiniApp } from 'universal-env'; import Event from './event'; import cache from '../utils/cache'; +import { toArray } from '../utils/tool'; import CustomEvent from './custom-event'; /** @@ -222,7 +223,7 @@ class EventTarget { // Trigger node event _trigger(eventName, { event, args = [], isCapture, isTarget } = {}) { eventName = eventName.toLowerCase(); - const handlers = this.__getHandles(eventName, isCapture) || []; + let handlers = this.__getHandles(eventName, isCapture) || []; if (eventName === 'onshareappmessage') { if (process.env.NODE_ENV === 'development' && handlers.length > 1) { @@ -244,6 +245,9 @@ class EventTarget { if (handlers && handlers.length) { let result; + if (handlers.length > 1) { + handlers = toArray(handlers); + } // Trigger addEventListener binded events handlers.forEach(handler => { if (event && event._immediateStop) return; diff --git a/packages/miniapp-render/src/utils/tool.js b/packages/miniapp-render/src/utils/tool.js index 1b5bb38e..77e2198c 100755 --- a/packages/miniapp-render/src/utils/tool.js +++ b/packages/miniapp-render/src/utils/tool.js @@ -66,6 +66,18 @@ function joinClassNames(...args) { return args.filter(v => !!v).join(' '); } +/** + * Cconvert an Array-like object to a real Array + */ +function toArray (list, start = 0) { + let i = list.length - start; + const ret = new Array(i); + while(i--) { + ret[i] = list[i + start]; + } + return ret; +} + export { toDash, toCamel, @@ -73,5 +85,6 @@ export { isUndef, isFunction, omitFalsyFields, - joinClassNames + joinClassNames, + toArray }; From 693c1102973b7837b877e33d8f96ba194f3b597f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Fri, 22 Apr 2022 14:11:19 +0800 Subject: [PATCH 5/9] fix(miniapp): lint error --- packages/miniapp-render/src/utils/tool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/miniapp-render/src/utils/tool.js b/packages/miniapp-render/src/utils/tool.js index 77e2198c..6064bda7 100755 --- a/packages/miniapp-render/src/utils/tool.js +++ b/packages/miniapp-render/src/utils/tool.js @@ -69,10 +69,10 @@ function joinClassNames(...args) { /** * Cconvert an Array-like object to a real Array */ -function toArray (list, start = 0) { +function toArray(list, start = 0) { let i = list.length - start; const ret = new Array(i); - while(i--) { + while (i--) { ret[i] = list[i + start]; } return ret; From 76317ea1dd5346f51ee1a66a0981db970cb43745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Mon, 16 May 2022 14:31:58 +0800 Subject: [PATCH 6/9] fix: remove second param of toArray --- packages/miniapp-render/src/utils/tool.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/miniapp-render/src/utils/tool.js b/packages/miniapp-render/src/utils/tool.js index 6064bda7..f5522a4c 100755 --- a/packages/miniapp-render/src/utils/tool.js +++ b/packages/miniapp-render/src/utils/tool.js @@ -69,11 +69,11 @@ function joinClassNames(...args) { /** * Cconvert an Array-like object to a real Array */ -function toArray(list, start = 0) { - let i = list.length - start; +function toArray(list) { + let i = list.length; const ret = new Array(i); while (i--) { - ret[i] = list[i + start]; + ret[i] = list[i]; } return ret; } From cf32960539b75469745bfcbc3d68305631a7de99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Mon, 16 May 2022 16:34:38 +0800 Subject: [PATCH 7/9] fix(miniapp): throw error when not config setting in map --- .../rax-miniapp-runtime-webpack-plugin/src/platforms/wechat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rax-miniapp-runtime-webpack-plugin/src/platforms/wechat.js b/packages/rax-miniapp-runtime-webpack-plugin/src/platforms/wechat.js index bc486897..8201b6e3 100644 --- a/packages/rax-miniapp-runtime-webpack-plugin/src/platforms/wechat.js +++ b/packages/rax-miniapp-runtime-webpack-plugin/src/platforms/wechat.js @@ -738,7 +738,7 @@ const MiniappMap = { 'enable-traffic': 'false', 'enable-poi': '', 'enable-building': '', - setting: '', + setting: ' {skew:0} ', }, events: { MarkerTap: '', From ee9c763fa1f35f6ad46c07448ffdabe61c924756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Mon, 16 May 2022 16:38:03 +0800 Subject: [PATCH 8/9] fix(miniapp-history): dependabot alerts --- packages/miniapp-history/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/miniapp-history/package.json b/packages/miniapp-history/package.json index 28b00286..e9b488f6 100644 --- a/packages/miniapp-history/package.json +++ b/packages/miniapp-history/package.json @@ -53,8 +53,7 @@ "glob": "^7.1.6", "jest": "^24.9.0", "minimatch": "^3.0.4", - "minimist": "^1.2.0", - "shelljs": "0.8.3" + "minimist": "^1.2.0" }, "config": { "ghooks": { From 62e46ad393efeb000d1b0edf77bcfb6f7db56fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=86=E8=91=B5?= Date: Mon, 16 May 2022 17:20:52 +0800 Subject: [PATCH 9/9] build(miniapp): bump version --- packages/miniapp-render/CHANGELOG.md | 1 + packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md | 6 ++++++ packages/rax-miniapp-runtime-webpack-plugin/package.json | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/miniapp-render/CHANGELOG.md b/packages/miniapp-render/CHANGELOG.md index 19c24b66..88f2fa16 100644 --- a/packages/miniapp-render/CHANGELOG.md +++ b/packages/miniapp-render/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixed - can't use animation events in view in non-ali miniapps +- should copy handlers in trigger function to avoid remove in handlers ## [2.8.8] - 2022-01-06 diff --git a/packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md b/packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md index 58f372be..c8d277fa 100644 --- a/packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md +++ b/packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.1] - 2022-05-17 + +### Fixed + +- Add default value for setting in map component + ## [5.0.1] - 2022-01-11 ### Added diff --git a/packages/rax-miniapp-runtime-webpack-plugin/package.json b/packages/rax-miniapp-runtime-webpack-plugin/package.json index dd59cfc7..955309f8 100644 --- a/packages/rax-miniapp-runtime-webpack-plugin/package.json +++ b/packages/rax-miniapp-runtime-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "rax-miniapp-runtime-webpack-plugin", - "version": "5.0.1", + "version": "5.0.2", "description": "A webpack plugin for miniapp runtime build", "main": "src/index.js", "files": [