Skip to content

Commit 4d8f3aa

Browse files
committed
fix(multiple): deprecate exported factories (#30608)
There are a bunch of factory functions that made it into our public API as a result of an old ViewEngine limitation where the factories had to be separate variables and had to be exported. With Ivy this isn't necessary and the factories can be inlined. Also they were never meant to be public APIs. These changes mark them as deprecated so they can be dropped from the public API in v21. (cherry picked from commit 810495c)
1 parent 3de78fe commit 4d8f3aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+258
-78
lines changed

src/cdk/a11y/key-manager/tree-key-manager.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> implements TreeKeyMana
411411
}
412412
}
413413

414-
/** @docs-private */
414+
/**
415+
* @docs-private
416+
* @deprecated No longer used, will be removed.
417+
* @breaking-change 21.0.0
418+
*/
415419
export function TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerItem>(): TreeKeyManagerFactory<T> {
416420
return (items, options) => new TreeKeyManager(items, options);
417421
}
@@ -422,7 +426,11 @@ export const TREE_KEY_MANAGER = new InjectionToken<TreeKeyManagerFactory<any>>('
422426
factory: TREE_KEY_MANAGER_FACTORY,
423427
});
424428

425-
/** @docs-private */
429+
/**
430+
* @docs-private
431+
* @deprecated No longer used, will be removed.
432+
* @breaking-change 21.0.0
433+
*/
426434
export const TREE_KEY_MANAGER_FACTORY_PROVIDER = {
427435
provide: TREE_KEY_MANAGER,
428436
useFactory: TREE_KEY_MANAGER_FACTORY,

src/cdk/a11y/live-announcer/live-announcer-tokens.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export const LIVE_ANNOUNCER_ELEMENT_TOKEN = new InjectionToken<HTMLElement | nul
2222
},
2323
);
2424

25-
/** @docs-private */
25+
/**
26+
* @docs-private
27+
* @deprecated No longer used, will be removed.
28+
* @breaking-change 21.0.0
29+
*/
2630
export function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY(): null {
2731
return null;
2832
}

src/cdk/bidi/dir-document-token.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {
2929
factory: DIR_DOCUMENT_FACTORY,
3030
});
3131

32-
/** @docs-private */
32+
/**
33+
* @docs-private
34+
* @deprecated No longer used, will be removed.
35+
* @breaking-change 21.0.0
36+
*/
3337
export function DIR_DOCUMENT_FACTORY(): Document {
3438
return inject(DOCUMENT);
3539
}

src/cdk/overlay/overlay-directives.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,22 @@ export class CdkConnectedOverlay implements OnDestroy, OnChanges {
457457
}
458458
}
459459

460-
/** @docs-private */
460+
/**
461+
* @docs-private
462+
* @deprecated No longer used, will be removed.
463+
* @breaking-change 21.0.0
464+
*/
461465
export function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(
462466
overlay: Overlay,
463467
): () => RepositionScrollStrategy {
464468
return () => overlay.scrollStrategies.reposition();
465469
}
466470

467-
/** @docs-private */
471+
/**
472+
* @docs-private
473+
* @deprecated No longer used, will be removed.
474+
* @breaking-change 21.0.0
475+
*/
468476
export const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
469477
provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
470478
deps: [Overlay],

src/material-luxon-adapter/adapter/luxon-date-adapter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ export const MAT_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken<MatLuxonDateAda
4545
},
4646
);
4747

48-
/** @docs-private */
48+
/**
49+
* @docs-private
50+
* @deprecated No longer used, will be removed.
51+
* @breaking-change 21.0.0
52+
*/
4953
export function MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): MatLuxonDateAdapterOptions {
5054
return {
5155
useUtc: false,

src/material-moment-adapter/adapter/moment-date-adapter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateA
4444
},
4545
);
4646

47-
/** @docs-private */
47+
/**
48+
* @docs-private
49+
* @deprecated No longer used, will be removed.
50+
* @breaking-change 21.0.0
51+
*/
4852
export function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {
4953
return {
5054
useUtc: false,

src/material/autocomplete/autocomplete-trigger.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,20 @@ export const MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken<() => ScrollS
9393
},
9494
);
9595

96-
/** @docs-private */
96+
/**
97+
* @docs-private
98+
* @deprecated No longer used, will be removed.
99+
* @breaking-change 21.0.0
100+
*/
97101
export function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {
98102
return () => overlay.scrollStrategies.reposition();
99103
}
100104

101-
/** @docs-private */
105+
/**
106+
* @docs-private
107+
* @deprecated No longer used, will be removed.
108+
* @breaking-change 21.0.0
109+
*/
102110
export const MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {
103111
provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY,
104112
deps: [Overlay],

src/material/autocomplete/autocomplete.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken<MatAutocomple
8686
},
8787
);
8888

89-
/** @docs-private */
89+
/**
90+
* @docs-private
91+
* @deprecated No longer used, will be removed.
92+
* @breaking-change 21.0.0
93+
*/
9094
export function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): MatAutocompleteDefaultOptions {
9195
return {
9296
autoActiveFirstOption: false,

src/material/button-toggle/button-toggle.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ export const MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS = new InjectionToken<MatButtonTog
7777
},
7878
);
7979

80+
/**
81+
* @docs-private
82+
* @deprecated No longer used, will be removed.
83+
* @breaking-change 21.0.0
84+
*/
8085
export function MAT_BUTTON_TOGGLE_GROUP_DEFAULT_OPTIONS_FACTORY(): MatButtonToggleDefaultOptions {
8186
return {
8287
hideSingleSelectionIndicator: false,

src/material/button/fab.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export const MAT_FAB_DEFAULT_OPTIONS = new InjectionToken<MatFabDefaultOptions>(
4141
},
4242
);
4343

44-
/** @docs-private */
44+
/**
45+
* @docs-private
46+
* @deprecated No longer used, will be removed.
47+
* @breaking-change 21.0.0
48+
*/
4549
export function MAT_FAB_DEFAULT_OPTIONS_FACTORY(): MatFabDefaultOptions {
4650
return {
4751
// The FAB by default has its color set to accent.

0 commit comments

Comments
 (0)