Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a flag in bootstrap to enable coalesce event to improve per…
…formance
- Loading branch information
1 parent
6b51ed2
commit b0ec7b4
Showing
10 changed files
with
138 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"master": { | ||
"uncompressed": { | ||
"runtime": 1497, | ||
"main": 166799, | ||
"main": 168478, | ||
"polyfills": 43626 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import {global} from './global'; | ||
|
||
let nativeRequestAnimationFrame: any; | ||
let nativeCancelAnimationFrame: any; | ||
|
||
function initNativeRequestAnimationFrame() { | ||
nativeRequestAnimationFrame = global['requestAnimationFrame']; | ||
nativeCancelAnimationFrame = global['cancelAnimationFrame']; | ||
if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame && nativeCancelAnimationFrame) { | ||
// use unpatched version of requestAnimationFrame if possible | ||
// to avoid another Change detection | ||
const unpatchedRequestAnimationFrame = | ||
(nativeRequestAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')]; | ||
if (unpatchedRequestAnimationFrame) { | ||
nativeRequestAnimationFrame = unpatchedRequestAnimationFrame; | ||
} | ||
const unpatchedCancelAnimationFrame = | ||
(nativeCancelAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')]; | ||
if (unpatchedCancelAnimationFrame) { | ||
nativeCancelAnimationFrame = unpatchedCancelAnimationFrame; | ||
} | ||
} | ||
} | ||
|
||
initNativeRequestAnimationFrame(); | ||
|
||
export {nativeCancelAnimationFrame, nativeRequestAnimationFrame}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters