mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(platform-browser): use performance API for async animations (#53963)
This commit adds a standard performance marker PR Close #53963
This commit is contained in:
committed by
Alex Rickabaugh
parent
3e31f1a34e
commit
ed8857e46f
@@ -1223,15 +1223,15 @@
|
||||
{
|
||||
"name": "optimizeGroupPlayer"
|
||||
},
|
||||
{
|
||||
"name": "options"
|
||||
},
|
||||
{
|
||||
"name": "parseAndConvertBindingsForDefinition"
|
||||
},
|
||||
{
|
||||
"name": "parseTimelineCommand"
|
||||
},
|
||||
{
|
||||
"name": "performanceMarkFeature"
|
||||
},
|
||||
{
|
||||
"name": "processInjectorTypesWithProviders"
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {DOCUMENT} from '@angular/common';
|
||||
import {ANIMATION_MODULE_TYPE, EnvironmentProviders, makeEnvironmentProviders, NgZone, RendererFactory2} from '@angular/core';
|
||||
import {ANIMATION_MODULE_TYPE, EnvironmentProviders, makeEnvironmentProviders, NgZone, RendererFactory2, ɵperformanceMarkFeature as performanceMarkFeature} from '@angular/core';
|
||||
import {ɵDomRendererFactory2 as DomRendererFactory2} from '@angular/platform-browser';
|
||||
|
||||
import {AsyncAnimationRendererFactory} from './async_animation_renderer';
|
||||
@@ -42,6 +42,7 @@ import {AsyncAnimationRendererFactory} from './async_animation_renderer';
|
||||
*/
|
||||
export function provideAnimationsAsync(type: 'animations'|'noop' = 'animations'):
|
||||
EnvironmentProviders {
|
||||
performanceMarkFeature('NgAsyncAnimations');
|
||||
return makeEnvironmentProviders([
|
||||
{
|
||||
provide: RendererFactory2,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* 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 {ModuleWithProviders, NgModule, Provider} from '@angular/core';
|
||||
import {ModuleWithProviders, NgModule, Provider, ɵperformanceMarkFeature as performanceMarkFeature} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {BROWSER_ANIMATIONS_PROVIDERS, BROWSER_NOOP_ANIMATIONS_PROVIDERS} from './providers';
|
||||
@@ -81,6 +81,7 @@ export class BrowserAnimationsModule {
|
||||
* @publicApi
|
||||
*/
|
||||
export function provideAnimations(): Provider[] {
|
||||
performanceMarkFeature('NgEagerAnimations');
|
||||
// Return a copy to prevent changes to the original array in case any in-place
|
||||
// alterations are performed to the `provideAnimations` call results in app code.
|
||||
return [...BROWSER_ANIMATIONS_PROVIDERS];
|
||||
|
||||
Reference in New Issue
Block a user