Skip to content

Commit ed8857e

Browse files
JeanMechealxhub
authored andcommitted
refactor(platform-browser): use performance API for async animations (#53963)
This commit adds a standard performance marker PR Close #53963
1 parent 3e31f1a commit ed8857e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/core/test/bundling/animations-standalone/bundle.golden_symbols.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,15 +1223,15 @@
12231223
{
12241224
"name": "optimizeGroupPlayer"
12251225
},
1226-
{
1227-
"name": "options"
1228-
},
12291226
{
12301227
"name": "parseAndConvertBindingsForDefinition"
12311228
},
12321229
{
12331230
"name": "parseTimelineCommand"
12341231
},
1232+
{
1233+
"name": "performanceMarkFeature"
1234+
},
12351235
{
12361236
"name": "processInjectorTypesWithProviders"
12371237
},

packages/platform-browser/animations/async/src/providers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {DOCUMENT} from '@angular/common';
10-
import {ANIMATION_MODULE_TYPE, EnvironmentProviders, makeEnvironmentProviders, NgZone, RendererFactory2} from '@angular/core';
10+
import {ANIMATION_MODULE_TYPE, EnvironmentProviders, makeEnvironmentProviders, NgZone, RendererFactory2, ɵperformanceMarkFeature as performanceMarkFeature} from '@angular/core';
1111
import {ɵDomRendererFactory2 as DomRendererFactory2} from '@angular/platform-browser';
1212

1313
import {AsyncAnimationRendererFactory} from './async_animation_renderer';
@@ -42,6 +42,7 @@ import {AsyncAnimationRendererFactory} from './async_animation_renderer';
4242
*/
4343
export function provideAnimationsAsync(type: 'animations'|'noop' = 'animations'):
4444
EnvironmentProviders {
45+
performanceMarkFeature('NgAsyncAnimations');
4546
return makeEnvironmentProviders([
4647
{
4748
provide: RendererFactory2,

packages/platform-browser/animations/src/module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {ModuleWithProviders, NgModule, Provider} from '@angular/core';
8+
import {ModuleWithProviders, NgModule, Provider, ɵperformanceMarkFeature as performanceMarkFeature} from '@angular/core';
99
import {BrowserModule} from '@angular/platform-browser';
1010

1111
import {BROWSER_ANIMATIONS_PROVIDERS, BROWSER_NOOP_ANIMATIONS_PROVIDERS} from './providers';
@@ -81,6 +81,7 @@ export class BrowserAnimationsModule {
8181
* @publicApi
8282
*/
8383
export function provideAnimations(): Provider[] {
84+
performanceMarkFeature('NgEagerAnimations');
8485
// Return a copy to prevent changes to the original array in case any in-place
8586
// alterations are performed to the `provideAnimations` call results in app code.
8687
return [...BROWSER_ANIMATIONS_PROVIDERS];

0 commit comments

Comments
 (0)