Skip to content

Commit b6c65c4

Browse files
committed
fix(multiple): remove remaining references to ComponentFactoryResolver
Removes the remaining APIs that were referencing `ComponentFactoryResolver`. These were all placeholders since we removed the code that was passing the values along a couple major versions ago. BREAKING CHANGE: * `DialogConfig.componentFactoryResolver` has been removed. * The constructor of `DomPortalOutlet` has changed. * `ComponentPortal.componentFactoryResolver` has been removed. * The constructor signature of `ComponentPortal` has changed. * `MatDialogConfig.componentFactoryResolver` has been removed.
1 parent e2ffd95 commit b6c65c4

File tree

9 files changed

+4
-57
lines changed

9 files changed

+4
-57
lines changed

src/cdk/dialog/dialog-config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ export class DialogConfig<D = unknown, R = unknown, C extends BasePortalOutlet =
138138
*/
139139
closeOnOverlayDetachments?: boolean = true;
140140

141-
/**
142-
* Alternate `ComponentFactoryResolver` to use when resolving the associated component.
143-
* @deprecated No longer used. Will be removed.
144-
* @breaking-change 20.0.0
145-
*/
146-
componentFactoryResolver?: unknown;
147-
148141
/**
149142
* Providers that will be exposed to the contents of the dialog. Can also
150143
* be provided as a function in order to generate the providers lazily.

src/cdk/overlay/overlay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ export class Overlay {
138138
this._appRef = this._injector.get<ApplicationRef>(ApplicationRef);
139139
}
140140

141-
return new DomPortalOutlet(pane, null, this._appRef, this._injector, this._document);
141+
return new DomPortalOutlet(pane, this._appRef, this._injector);
142142
}
143143
}

src/cdk/portal/dom-portal-outlet.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,20 @@ import {BasePortalOutlet, ComponentPortal, DomPortal, TemplatePortal} from './po
2121
* application context.
2222
*/
2323
export class DomPortalOutlet extends BasePortalOutlet {
24-
private _document: Document;
25-
2624
/**
2725
* @param outletElement Element into which the content is projected.
28-
* @param _unusedComponentFactoryResolver Used to resolve the component factory.
29-
* Only required when attaching component portals.
3026
* @param _appRef Reference to the application. Only used in component portals when there
3127
* is no `ViewContainerRef` available.
3228
* @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
3329
* have one. Only used for component portals.
34-
* @param _document Reference to the document. Used when attaching a DOM portal. Will eventually
35-
* become a required parameter.
3630
*/
3731
constructor(
3832
/** Element into which the content is projected. */
3933
public outletElement: Element,
40-
/**
41-
* @deprecated No longer in use. To be removed.
42-
* @breaking-change 18.0.0
43-
*/
44-
_unusedComponentFactoryResolver?: any,
4534
private _appRef?: ApplicationRef,
4635
private _defaultInjector?: Injector,
47-
48-
/**
49-
* @deprecated `_document` Parameter to be made required.
50-
* @breaking-change 10.0.0
51-
*/
52-
_document?: any,
5336
) {
5437
super();
55-
this._document = _document;
5638
}
5739

5840
/**
@@ -157,7 +139,7 @@ export class DomPortalOutlet extends BasePortalOutlet {
157139

158140
// Anchor used to save the element's previous position so
159141
// that we can restore it when the portal is detached.
160-
const anchorNode = this._document.createComment('dom-portal');
142+
const anchorNode = this.outletElement.ownerDocument.createComment('dom-portal');
161143

162144
element.parentNode!.insertBefore(anchorNode, element);
163145
this.outletElement.appendChild(element);

src/cdk/portal/portal.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ export class ComponentPortal<T> extends Portal<ComponentRef<T>> {
9494
/** Injector used for the instantiation of the component. */
9595
injector?: Injector | null;
9696

97-
/**
98-
* @deprecated No longer in use. To be removed.
99-
* @breaking-change 18.0.0
100-
*/
101-
componentFactoryResolver?: any;
102-
10397
/**
10498
* List of DOM nodes that should be projected through `<ng-content>` of the attached component.
10599
*/
@@ -109,11 +103,6 @@ export class ComponentPortal<T> extends Portal<ComponentRef<T>> {
109103
component: ComponentType<T>,
110104
viewContainerRef?: ViewContainerRef | null,
111105
injector?: Injector | null,
112-
/**
113-
* @deprecated No longer in use. To be removed.
114-
* @breaking-change 18.0.0
115-
*/
116-
_componentFactoryResolver?: any,
117106
projectableNodes?: Node[][] | null,
118107
) {
119108
super();

src/material/dialog/dialog-config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ export class MatDialogConfig<D = any> {
137137
*/
138138
closeOnNavigation?: boolean = true;
139139

140-
/**
141-
* Alternate `ComponentFactoryResolver` to use when resolving the associated component.
142-
* @deprecated No longer used. Will be removed.
143-
* @breaking-change 20.0.0
144-
*/
145-
componentFactoryResolver?: unknown;
146-
147140
/**
148141
* Duration of the enter animation in ms.
149142
* Should be a number, string type is deprecated.

src/material/menu/menu-content.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export class MatMenuContent implements OnDestroy {
6565
if (!this._outlet) {
6666
this._outlet = new DomPortalOutlet(
6767
this._document.createElement('div'),
68-
null,
6968
this._appRef,
7069
this._injector,
7170
);

tools/public_api_guard/cdk/dialog.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ export class DialogConfig<D = unknown, R = unknown, C extends BasePortalOutlet =
133133
closeOnDestroy?: boolean;
134134
closeOnNavigation?: boolean;
135135
closeOnOverlayDetachments?: boolean;
136-
// @deprecated
137-
componentFactoryResolver?: unknown;
138136
container?: Type<C> | {
139137
type: Type<C>;
140138
providers: (config: DialogConfig<D, R, C>) => StaticProvider[];

tools/public_api_guard/cdk/portal.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ export type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any
7676

7777
// @public
7878
export class ComponentPortal<T> extends Portal<ComponentRef<T>> {
79-
constructor(component: ComponentType<T>, viewContainerRef?: ViewContainerRef | null, injector?: Injector | null,
80-
_componentFactoryResolver?: any, projectableNodes?: Node[][] | null);
79+
constructor(component: ComponentType<T>, viewContainerRef?: ViewContainerRef | null, injector?: Injector | null, projectableNodes?: Node[][] | null);
8180
component: ComponentType<T>;
82-
// @deprecated (undocumented)
83-
componentFactoryResolver?: any;
8481
injector?: Injector | null;
8582
projectableNodes?: Node[][] | null;
8683
viewContainerRef?: ViewContainerRef | null;
@@ -105,9 +102,7 @@ export class DomPortalHost extends DomPortalOutlet {
105102
// @public
106103
export class DomPortalOutlet extends BasePortalOutlet {
107104
constructor(
108-
outletElement: Element,
109-
_unusedComponentFactoryResolver?: any, _appRef?: ApplicationRef | undefined, _defaultInjector?: Injector | undefined,
110-
_document?: any);
105+
outletElement: Element, _appRef?: ApplicationRef | undefined, _defaultInjector?: Injector | undefined);
111106
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
112107
// @deprecated
113108
attachDomPortal: (portal: DomPortal) => void;

tools/public_api_guard/material/dialog.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ export class MatDialogConfig<D = any> {
149149
autoFocus?: AutoFocusTarget | string | boolean;
150150
backdropClass?: string | string[];
151151
closeOnNavigation?: boolean;
152-
// @deprecated
153-
componentFactoryResolver?: unknown;
154152
data?: D | null;
155153
delayFocusTrap?: boolean;
156154
direction?: Direction;

0 commit comments

Comments
 (0)