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": { diff --git a/packages/miniapp-render/CHANGELOG.md b/packages/miniapp-render/CHANGELOG.md index e6f36557..88f2fa16 100644 --- a/packages/miniapp-render/CHANGELOG.md +++ b/packages/miniapp-render/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog + +## [2.8.9] - 2022-03-23 + +### 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 ### 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" diff --git a/packages/miniapp-render/src/builtInComponents/view.js b/packages/miniapp-render/src/builtInComponents/view.js index b4e89004..8e34ddf2 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,23 +35,7 @@ if (isMiniApp) { { name: 'onViewDisappear', eventName: 'disappear' - }, - { - name: 'onViewTransitionEnd', - eventName: 'transitionend' - }, - { - name: 'onViewAnimationIteration', - eventName: 'animationiteration' - }, - { - name: 'onViewAnimationStart', - eventName: 'animationstart' - }, - { - name: 'onViewAnimationEnd', - eventName: 'animationend' - }]; + }]); } export default view; 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..f5522a4c 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) { + let i = list.length; + const ret = new Array(i); + while (i--) { + ret[i] = list[i]; + } + return ret; +} + export { toDash, toCamel, @@ -73,5 +85,6 @@ export { isUndef, isFunction, omitFalsyFields, - joinClassNames + joinClassNames, + toArray }; 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": [ 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: '',