Skip to content

Commit

Permalink
perf(πŸ“¦): remove @ant-design/css-animation (ant-design#28201)
Browse files Browse the repository at this point in the history
* perf(πŸ“¦): remove @ant-design/css-animation

* fix test case

* fix test case
  • Loading branch information
afc163 authored and vouis committed Dec 10, 2020
1 parent 1eec1d1 commit 53755a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 8 additions & 5 deletions components/_util/wave.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import TransitionEvents from '@ant-design/css-animation/lib/Event';
import { supportRef, composeRef } from 'rc-util/lib/ref';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
Expand Down Expand Up @@ -106,8 +105,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
if (insertExtraNode) {
node.appendChild(extraNode);
}
TransitionEvents.addStartEventListener(node, this.onTransitionStart);
TransitionEvents.addEndEventListener(node, this.onTransitionEnd);
['transition', 'animation'].forEach(name => {
node.addEventListener(`${name}start`, this.onTransitionStart);
node.addEventListener(`${name}end`, this.onTransitionEnd);
});
};

onTransitionStart = (e: AnimationEvent) => {
Expand Down Expand Up @@ -190,8 +191,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
node.removeChild(this.extraNode);
}
TransitionEvents.removeStartEventListener(node, this.onTransitionStart);
TransitionEvents.removeEndEventListener(node, this.onTransitionEnd);
['transition', 'animation'].forEach(name => {
node.removeEventListener(`${name}start`, this.onTransitionStart);
node.removeEventListener(`${name}end`, this.onTransitionEnd);
});
}

renderWave = ({ csp }: ConfigConsumerProps) => {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
],
"dependencies": {
"@ant-design/colors": "^5.0.0",
"@ant-design/css-animation": "^1.7.2",
"@ant-design/icons": "^4.3.0",
"@ant-design/react-slick": "~0.27.0",
"@babel/runtime": "^7.11.2",
Expand Down

0 comments on commit 53755a1

Please sign in to comment.