From 021ead5399ab1136da160c7348ec8555ef5ee8fd Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Tue, 19 Aug 2025 20:32:04 +0200 Subject: [PATCH] refactor(animations): remove dependency on `@angular/common` (#63248) `DOCUMENT` was move to `@angular/core`, so we don't need to depend on common anymore. PR Close #63248 --- integration/legacy-animations-async/size.json | 2 +- integration/legacy-animations/size.json | 2 +- packages/animations/BUILD.bazel | 3 --- packages/animations/browser/BUILD.bazel | 1 - packages/animations/browser/testing/BUILD.bazel | 1 - packages/animations/package.json | 3 +-- packages/animations/src/animation_builder.ts | 2 +- packages/animations/test/BUILD.bazel | 1 - packages/animations/test/browser_animation_builder_spec.ts | 3 +-- pnpm-lock.yaml | 3 --- 10 files changed, 5 insertions(+), 16 deletions(-) diff --git a/integration/legacy-animations-async/size.json b/integration/legacy-animations-async/size.json index 33647f9fe6e..b2cb266296f 100644 --- a/integration/legacy-animations-async/size.json +++ b/integration/legacy-animations-async/size.json @@ -1,5 +1,5 @@ { - "dist/main.js": 86540, + "dist/main.js": 97227, "dist/polyfills.js": 33782, "dist/browser-[hash].js": 63949, "dist/open-close.component-[hash].js": 1218 diff --git a/integration/legacy-animations/size.json b/integration/legacy-animations/size.json index c9f4a8bd888..b578b263198 100644 --- a/integration/legacy-animations/size.json +++ b/integration/legacy-animations/size.json @@ -1,5 +1,5 @@ { - "dist/main.js": 143167, + "dist/main.js": 153915, "dist/polyfills.js": 34023, "dist/open-close.component-[hash].js": 1190 } diff --git a/packages/animations/BUILD.bazel b/packages/animations/BUILD.bazel index b490b2e97ff..a5758778a9a 100644 --- a/packages/animations/BUILD.bazel +++ b/packages/animations/BUILD.bazel @@ -11,7 +11,6 @@ ng_project( ], ), deps = [ - "//packages/common", "//packages/core", ], ) @@ -72,8 +71,6 @@ generate_api_docs( name = "animations_docs", srcs = [ ":files_for_docgen", - "//packages:common_files_and_deps_for_docs", - "//packages/common:files_for_docgen", ], entry_point = ":index.ts", module_name = "@angular/animations", diff --git a/packages/animations/browser/BUILD.bazel b/packages/animations/browser/BUILD.bazel index eb164cda7b8..bce53dc86b0 100644 --- a/packages/animations/browser/BUILD.bazel +++ b/packages/animations/browser/BUILD.bazel @@ -30,7 +30,6 @@ generate_api_docs( name = "animations_browser_docs", srcs = [ ":files_for_docgen", - "//packages:common_files_and_deps_for_docs", "//packages/animations:files_for_docgen", ], entry_point = ":index.ts", diff --git a/packages/animations/browser/testing/BUILD.bazel b/packages/animations/browser/testing/BUILD.bazel index c9e3acdb51f..03d23edc56e 100644 --- a/packages/animations/browser/testing/BUILD.bazel +++ b/packages/animations/browser/testing/BUILD.bazel @@ -25,7 +25,6 @@ generate_api_docs( name = "animations_browser_testing_docs", srcs = [ ":files_for_docgen", - "//packages:common_files_and_deps_for_docs", ], entry_point = ":index.ts", module_name = "@angular/animations/browser/testing", diff --git a/packages/animations/package.json b/packages/animations/package.json index caec5575991..7e3161a3908 100644 --- a/packages/animations/package.json +++ b/packages/animations/package.json @@ -11,8 +11,7 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@angular/core": "0.0.0-PLACEHOLDER", - "@angular/common": "0.0.0-PLACEHOLDER" + "@angular/core": "0.0.0-PLACEHOLDER" }, "repository": { "type": "git", diff --git a/packages/animations/src/animation_builder.ts b/packages/animations/src/animation_builder.ts index 91da06fe7bf..e4acf16eed4 100644 --- a/packages/animations/src/animation_builder.ts +++ b/packages/animations/src/animation_builder.ts @@ -5,9 +5,9 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import {DOCUMENT} from '@angular/common'; import { ANIMATION_MODULE_TYPE, + DOCUMENT, Inject, inject, Injectable, diff --git a/packages/animations/test/BUILD.bazel b/packages/animations/test/BUILD.bazel index c8da65c69e2..c428120002d 100644 --- a/packages/animations/test/BUILD.bazel +++ b/packages/animations/test/BUILD.bazel @@ -9,7 +9,6 @@ ts_project( "//packages/animations", "//packages/animations/browser", "//packages/animations/browser/testing", - "//packages/common", "//packages/core", "//packages/core/testing", "//packages/platform-browser", diff --git a/packages/animations/test/browser_animation_builder_spec.ts b/packages/animations/test/browser_animation_builder_spec.ts index 2f0fc320986..45eea5e3339 100644 --- a/packages/animations/test/browser_animation_builder_spec.ts +++ b/packages/animations/test/browser_animation_builder_spec.ts @@ -13,8 +13,7 @@ import { } from '../src/animations'; import {AnimationDriver} from '../browser'; import {MockAnimationDriver} from '../browser/testing'; -import {DOCUMENT} from '@angular/common'; -import {Component, NgZone, RendererFactory2, ViewChild} from '@angular/core'; +import {Component, NgZone, RendererFactory2, ViewChild, DOCUMENT} from '@angular/core'; import {fakeAsync, flushMicrotasks, TestBed} from '@angular/core/testing'; import {ɵDomRendererFactory2 as DomRendererFactory2} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5734a7fd304..3eda77e7c0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -889,9 +889,6 @@ importers: packages/animations: dependencies: - '@angular/common': - specifier: 'workspace: *' - version: link:../common '@angular/core': specifier: 'workspace: *' version: link:../core