From a64576dfa4bc0ca7a9259452de911ed9dbdaf055 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 5 Mar 2025 12:37:09 +0100 Subject: [PATCH] fix(cdk/portal): remove deprecated symbols Removes some symbols that have been deprecated for a while. BREAKING CHANGE: * `DomPortalHost` has been removed. Use `DomPortalOutlet` instead. * `PortalInjector` has been removed. Use `Injector.create` instead. * `PortalHost` has been removed. Use `PortalOutlet` instead. * `BasePortalHost` has been removed. Use `BasePortalOutlet` instead. --- src/cdk/portal/dom-portal-outlet.ts | 6 ----- src/cdk/portal/portal-injector.ts | 33 ---------------------------- src/cdk/portal/portal.ts | 12 ---------- src/cdk/portal/public-api.ts | 1 - tools/public_api_guard/cdk/portal.md | 18 --------------- 5 files changed, 70 deletions(-) delete mode 100644 src/cdk/portal/portal-injector.ts diff --git a/src/cdk/portal/dom-portal-outlet.ts b/src/cdk/portal/dom-portal-outlet.ts index 1dd3da5d9298..af0530c7906a 100644 --- a/src/cdk/portal/dom-portal-outlet.ts +++ b/src/cdk/portal/dom-portal-outlet.ts @@ -166,9 +166,3 @@ export class DomPortalOutlet extends BasePortalOutlet { return (componentRef.hostView as EmbeddedViewRef).rootNodes[0] as HTMLElement; } } - -/** - * @deprecated Use `DomPortalOutlet` instead. - * @breaking-change 9.0.0 - */ -export class DomPortalHost extends DomPortalOutlet {} diff --git a/src/cdk/portal/portal-injector.ts b/src/cdk/portal/portal-injector.ts deleted file mode 100644 index 84370a120906..000000000000 --- a/src/cdk/portal/portal-injector.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright Google LLC 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.dev/license - */ - -import {Injector} from '@angular/core'; - -/** - * Custom injector to be used when providing custom - * injection tokens to components inside a portal. - * @docs-private - * @deprecated Use `Injector.create` instead. - * @breaking-change 11.0.0 - */ -export class PortalInjector implements Injector { - constructor( - private _parentInjector: Injector, - private _customTokens: WeakMap, - ) {} - - get(token: any, notFoundValue?: any): any { - const value = this._customTokens.get(token); - - if (typeof value !== 'undefined') { - return value; - } - - return this._parentInjector.get(token, notFoundValue); - } -} diff --git a/src/cdk/portal/portal.ts b/src/cdk/portal/portal.ts index 6083f27047c4..7865c6d0781e 100644 --- a/src/cdk/portal/portal.ts +++ b/src/cdk/portal/portal.ts @@ -180,12 +180,6 @@ export interface PortalOutlet { hasAttached(): boolean; } -/** - * @deprecated Use `PortalOutlet` instead. - * @breaking-change 9.0.0 - */ -export type PortalHost = PortalOutlet; - /** * Partial implementation of PortalOutlet that handles attaching * ComponentPortal and TemplatePortal. @@ -281,9 +275,3 @@ export abstract class BasePortalOutlet implements PortalOutlet { } } } - -/** - * @deprecated Use `BasePortalOutlet` instead. - * @breaking-change 9.0.0 - */ -export abstract class BasePortalHost extends BasePortalOutlet {} diff --git a/src/cdk/portal/public-api.ts b/src/cdk/portal/public-api.ts index e33561f944e2..fbd8e0392b86 100644 --- a/src/cdk/portal/public-api.ts +++ b/src/cdk/portal/public-api.ts @@ -9,4 +9,3 @@ export * from './portal'; export * from './dom-portal-outlet'; export * from './portal-directives'; -export * from './portal-injector'; diff --git a/tools/public_api_guard/cdk/portal.md b/tools/public_api_guard/cdk/portal.md index 15bed9e23ceb..8bdacce62928 100644 --- a/tools/public_api_guard/cdk/portal.md +++ b/tools/public_api_guard/cdk/portal.md @@ -16,10 +16,6 @@ import { OnInit } from '@angular/core'; import { TemplateRef } from '@angular/core'; import { ViewContainerRef } from '@angular/core'; -// @public @deprecated (undocumented) -export abstract class BasePortalHost extends BasePortalOutlet { -} - // @public export abstract class BasePortalOutlet implements PortalOutlet { // (undocumented) @@ -95,10 +91,6 @@ export class DomPortal extends Portal { readonly element: T; } -// @public @deprecated (undocumented) -export class DomPortalHost extends DomPortalOutlet { -} - // @public export class DomPortalOutlet extends BasePortalOutlet { constructor( @@ -119,9 +111,6 @@ export abstract class Portal { setAttachedHost(host: PortalOutlet | null): void; } -// @public @deprecated (undocumented) -export type PortalHost = PortalOutlet; - // @public @deprecated (undocumented) export class PortalHostDirective extends CdkPortalOutlet { // (undocumented) @@ -130,13 +119,6 @@ export class PortalHostDirective extends CdkPortalOutlet { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public @deprecated -export class PortalInjector implements Injector { - constructor(_parentInjector: Injector, _customTokens: WeakMap); - // (undocumented) - get(token: any, notFoundValue?: any): any; -} - // @public (undocumented) export class PortalModule { // (undocumented)