Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72aad32

Browse files
arturovtmhevery
authored andcommitted
perf(animations): usengDevMode to tree-shake warning (#39964)
This commit adds ngDevMode guard to show warning onlyin dev mode (similar to how things work in other parts of Ivy runtime code).The ngDevMode flag helps to tree-shake this warning from production builds(in dev mode everything will work as it works right now) to decrease production bundle size.PRClose#39964
1 parentbf3de9b commit72aad32

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

‎packages/animations/browser/src/render/css_keyframes/css_keyframes_driver.ts‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const TAB_SPACE = ' ';
2121
exportclassCssKeyframesDriverimplementsAnimationDriver{
2222
private_count=0;
2323
privatereadonly_head:any=document.querySelector('head');
24-
private_warningIssued=false;
2524

2625
validateStyleProperty(prop:string):boolean{
2726
returnvalidateStyleProperty(prop);
@@ -79,8 +78,8 @@ export class CssKeyframesDriver implements AnimationDriver {
7978
animate(
8079
element:any,keyframes:ɵStyleData[],duration:number,delay:number,easing:string,
8180
previousPlayers:AnimationPlayer[]=[],scrubberAccessRequested?:boolean):AnimationPlayer{
82-
if(scrubberAccessRequested){
83-
this._notifyFaultyScrubber();
81+
if((typeofngDevMode==='undefined'||ngDevMode)&&scrubberAccessRequested){
82+
notifyFaultyScrubber();
8483
}
8584

8685
constpreviousCssKeyframePlayers=<CssKeyframesPlayer[]>previousPlayers.filter(
@@ -117,15 +116,6 @@ export class CssKeyframesDriver implements AnimationDriver {
117116
player.onDestroy(()=>removeElement(kfElm));
118117
returnplayer;
119118
}
120-
121-
private_notifyFaultyScrubber(){
122-
if(!this._warningIssued){
123-
console.warn(
124-
'@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n',
125-
' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
126-
this._warningIssued=true;
127-
}
128-
}
129119
}
130120

131121
functionflattenKeyframesIntoStyles(keyframes:null|{[key:string]:any}|
@@ -146,3 +136,12 @@ function flattenKeyframesIntoStyles(keyframes: null|{[key: string]: any}|
146136
functionremoveElement(node:any){
147137
node.parentNode.removeChild(node);
148138
}
139+
140+
letwarningIssued=false;
141+
functionnotifyFaultyScrubber():void{
142+
if(warningIssued)return;
143+
console.warn(
144+
'@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n',
145+
' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
146+
warningIssued=true;
147+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp