Skip to content

Commit

Permalink
Merge pull request #292 from raxjs/release/miniapp-0517
Browse files Browse the repository at this point in the history
Release/miniapp 0517
  • Loading branch information
ChrisCindy authored May 17, 2022
2 parents 83f8c15 + 62e46ad commit 9252746
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 26 deletions.
3 changes: 1 addition & 2 deletions packages/miniapp-history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 8 additions & 0 deletions packages/miniapp-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/miniapp-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniapp-render",
"version": "2.8.8",
"version": "2.8.9",
"description": "DOM simulator for MiniApp",
"files": [
"dist"
Expand Down
40 changes: 21 additions & 19 deletions packages/miniapp-render/src/builtInComponents/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand All @@ -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;
6 changes: 5 additions & 1 deletion packages/miniapp-render/src/event/event-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
15 changes: 14 additions & 1 deletion packages/miniapp-render/src/utils/tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,25 @@ 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,
getId,
isUndef,
isFunction,
omitFalsyFields,
joinClassNames
joinClassNames,
toArray
};
6 changes: 6 additions & 0 deletions packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/rax-miniapp-runtime-webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ const MiniappMap = {
'enable-traffic': 'false',
'enable-poi': '',
'enable-building': '',
setting: '',
setting: ' {skew:0} ',
},
events: {
MarkerTap: '',
Expand Down

0 comments on commit 9252746

Please sign in to comment.