Skip to content

Commit 698c058

Browse files
devversionthePunderWoman
authored andcommitted
fix(animations): remove code duplication between entry-points (#51500)
The animations packages were duplicating a little bit of code due to relative imports between entry-points. This caused bundlers to inline shared functions twice in both FESM outputs. PR Close #51500
1 parent a6b7dbc commit 698c058

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/animations/browser/src/private_export.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export {AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationSty
1010
export {WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_normalizer';
1111
export {NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver';
1212
export {AnimationEngine as ɵAnimationEngine} from './render/animation_engine_next';
13-
export {containsElement as ɵcontainsElement, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, validateStyleProperty as ɵvalidateStyleProperty} from './render/shared';
13+
export {containsElement as ɵcontainsElement, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, validateStyleProperty as ɵvalidateStyleProperty, validateWebAnimatableStyleProperty as ɵvalidateWebAnimatableStyleProperty} from './render/shared';
1414
export {WebAnimationsDriver as ɵWebAnimationsDriver} from './render/web_animations/web_animations_driver';
1515
export {WebAnimationsPlayer as ɵWebAnimationsPlayer} from './render/web_animations/web_animations_player';
16-
export {allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, normalizeKeyframes as ɵnormalizeKeyframes} from './util';
16+
export {allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, camelCaseToDashCase as ɵcamelCaseToDashCase, normalizeKeyframes as ɵnormalizeKeyframes} from './util';

packages/animations/browser/testing/src/mock_animation_driver.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import {AnimationPlayer, AUTO_STYLE, NoopAnimationPlayer, ɵStyleDataMap} from '@angular/animations';
9-
import {AnimationDriver, ɵallowPreviousPlayerStylesMerge as allowPreviousPlayerStylesMerge, ɵcontainsElement as containsElement, ɵgetParentElement as getParentElement, ɵinvokeQuery as invokeQuery, ɵnormalizeKeyframes as normalizeKeyframes, ɵvalidateStyleProperty as validateStyleProperty,} from '@angular/animations/browser';
10-
11-
import {validateWebAnimatableStyleProperty} from '../../src/render/shared';
12-
import {camelCaseToDashCase} from '../../src/util';
9+
import {AnimationDriver, ɵallowPreviousPlayerStylesMerge as allowPreviousPlayerStylesMerge, ɵcamelCaseToDashCase, ɵcontainsElement as containsElement, ɵgetParentElement as getParentElement, ɵinvokeQuery as invokeQuery, ɵnormalizeKeyframes as normalizeKeyframes, ɵvalidateStyleProperty as validateStyleProperty, ɵvalidateWebAnimatableStyleProperty} from '@angular/animations/browser';
1310

1411
/**
1512
* @publicApi
@@ -22,8 +19,8 @@ export class MockAnimationDriver implements AnimationDriver {
2219
}
2320

2421
validateAnimatableStyleProperty(prop: string): boolean {
25-
const cssProp = camelCaseToDashCase(prop);
26-
return validateWebAnimatableStyleProperty(cssProp);
22+
const cssProp = ɵcamelCaseToDashCase(prop);
23+
return ɵvalidateWebAnimatableStyleProperty(cssProp);
2724
}
2825

2926
matchesElement(_element: any, _selector: string): boolean {

0 commit comments

Comments
 (0)