Skip to content

Commit 585e34b

Browse files
crisbetoatscott
authored andcommitted
feat(core): remove entryComponents (#49484)
`entryComponents` have been deprecated since version 9, because with Ivy they weren't necessary. These changes remove any remaining references. BREAKING CHANGE: * `entryComponents` has been deleted from the `@NgModule` and `@Component` public APIs. Any usages can be removed since they weren't doing anyting. * `ANALYZE_FOR_ENTRY_COMPONENTS` injection token has been deleted. Any references can be removed. PR Close #49484
1 parent 6161c50 commit 585e34b

File tree

32 files changed

+19
-647
lines changed

32 files changed

+19
-647
lines changed

.pullapprove.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ groups:
265265
'aio/content/examples/dynamic-component-loader/**/{*,.*}',
266266
'aio/content/images/guide/dynamic-component-loader/**/{*,.*}',
267267
'aio/content/guide/example-apps-list.md',
268-
'aio/content/guide/entry-components.md',
269268
'aio/content/guide/feature-modules.md',
270269
'aio/content/examples/feature-modules/**/{*,.*}',
271270
'aio/content/images/guide/feature-modules/**/{*,.*}',

aio/content/guide/deprecations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ v16 - v19
4747
| `@angular/core` | [`DefaultIterableDiffer`](#core) | v7 | v11 |
4848
| `@angular/core` | [`ReflectiveKey`](#core) | v8 | v11 |
4949
| `@angular/core` | [`defineInjectable`](#core) | v8 | v11 |
50-
| `@angular/core` | [`entryComponents`](api/core/NgModule#entryComponents) | v9 | v11 |
51-
| `@angular/core` | [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | v9 | v11 |
50+
| `@angular/core` | [`entryComponents`](api/core/NgModule) | v9 | v11 |
51+
| `@angular/core` | [`ANALYZE_FOR_ENTRY_COMPONENTS`](#core) | v9 | v11 |
5252
| `@angular/forms` | [`ngModel` with reactive forms](#ngmodel-reactive) | v6 | v11 |
5353
| `@angular/upgrade` | [`@angular/upgrade`](#upgrade) | v8 | v11 |
5454
| `@angular/upgrade` | [`getAngularLib`](#upgrade-static) | v8 | v11 |
@@ -158,8 +158,8 @@ In the [API reference section](api) of this site, deprecated APIs are indicated
158158
| [`ReflectiveInjector`](api/core/ReflectiveInjector) | [`Injector.create()`](api/core/Injector#create) | v5 | See [`ReflectiveInjector`](#reflectiveinjector) |
159159
| [`ReflectiveKey`](api/core/ReflectiveKey) | none | v5 | none |
160160
| [`defineInjectable`](api/core/defineInjectable) | `ɵɵdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. |
161-
| [`entryComponents`](api/core/NgModule#entryComponents) | none | v9 | See [`entryComponents`](#entryComponents) |
162-
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | v9 | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](#entryComponents) |
161+
| [`entryComponents`](api/core/NgModule) | none | v9 | See [`entryComponents`](#entryComponents) |
162+
| `ANALYZE_FOR_ENTRY_COMPONENTS` | none | v9 | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](#entryComponents) |
163163
| [`async`](api/core/testing/async) | [`waitForAsync`](api/core/testing/waitForAsync) | v11 | The [`async`](api/core/testing/async) function from `@angular/core/testing` has been renamed to `waitForAsync` in order to avoid confusion with the native JavaScript `async` syntax. The existing function is deprecated and can be removed in a future version. |
164164
| [`getModuleFactory`](api/core/getModuleFactory) | [`getNgModuleById`](api/core/getNgModuleById) | v13 | Ivy allows working with NgModule classes directly, without retrieving corresponding factories. |
165165
| `ViewChildren.emitDistinctChangesOnly` / `ContentChildren.emitDistinctChangesOnly` | none \(was part of [issue #40091](https://github.com/angular/angular/issues/40091)\) | | This is a temporary flag introduced as part of bug fix of [issue #40091](https://github.com/angular/angular/issues/40091) and will be removed. |

aio/content/guide/entry-components.md

Lines changed: 0 additions & 121 deletions
This file was deleted.

aio/content/guide/ngmodule-api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ The following table summarizes the `@NgModule` metadata properties.
4242
You may also be interested in the following:
4343

4444
* [Feature Modules](guide/feature-modules)
45-
* [Entry Components](guide/entry-components)
4645
* [Providers](guide/providers)
4746
* [Types of Feature Modules](guide/module-types)
4847

aio/content/guide/ngmodule-faq.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Don't export the following:
128128

129129
* Non-declarable objects such as services, functions, configurations, and entity models.
130130
* Components that are only loaded dynamically by the router or by bootstrapping.
131-
Such [entry components](guide/ngmodule-faq#q-entry-component-defined) can never be selected in another component's template.
131+
Such components can never be selected in another component's template.
132132
While there's no harm in exporting them, there's also no benefit.
133133

134134
* Pure service modules that don't have public \(exported\) declarations.
@@ -408,28 +408,6 @@ Here is a custom constructor for an NgModule called `GreetingModule`.
408408

409409
<code-example header="src/app/greeting/greeting.module.ts (Constructor)" path="ngmodules/src/app/greeting/greeting.module.ts" region="ctor"></code-example>
410410

411-
<a id="q-entry-component-defined"></a>
412-
413-
## What is an `entry component`?
414-
415-
An entry component is any component that Angular loads *imperatively* by type.
416-
417-
A component loaded *declaratively* by way of its selector is *not* an entry component.
418-
419-
Angular loads a component declaratively when using the component's selector to locate the element in the template.
420-
Angular then creates the HTML representation of the component and inserts it into the DOM at the selected element.
421-
These aren't entry components.
422-
423-
The bootstrapped root `AppComponent` is an *entry component*.
424-
True, its selector matches an element tag in `index.html`.
425-
But `index.html` isn't a component template and the `AppComponent` selector doesn't match an element in any component template.
426-
427-
Components in route definitions are also *entry components*.
428-
A route definition refers to a component by its *type*.
429-
The router ignores a routed component's selector, if it even has one, and loads the component dynamically into a `RouterOutlet`.
430-
431-
For more information, see [Entry Components](guide/entry-components).
432-
433411
## What kinds of modules should I have and how should I use them?
434412

435413
Every application is different.

aio/content/guide/ngmodule-vs-jsmodule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ It then configures the `@NgModule` with the following arrays:
7676
* `providers`: Providers of services that components in other NgModules can use.
7777
There are no providers in a newly generated root NgModule.
7878

79-
* `bootstrap`: The [entry component](guide/entry-components "Specifying an entry component") that Angular creates and inserts into the `index.html` host web page, thereby bootstrapping the application.
80-
This entry component, `AppComponent`, appears in both the `declarations` and the `bootstrap` arrays.
79+
* `bootstrap`: The component that Angular creates and inserts into the `index.html` host web page, thereby bootstrapping the application.
80+
This component, `AppComponent`, appears in both the `declarations` and the `bootstrap` arrays.
8181

8282
## Next steps
8383

aio/content/guide/ngmodules.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ For more information on the structure of an `@NgModule`, be sure to read [Bootst
5757
You may also be interested in the following:
5858

5959
* [Feature Modules](guide/feature-modules)
60-
* [Entry Components](guide/entry-components)
6160
* [Providers](guide/providers)
6261
* [Types of NgModules](guide/module-types)
6362

aio/content/navigation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,6 @@
10281028
"title": "Types of feature modules",
10291029
"tooltip": "Description of the different types of feature modules."
10301030
},
1031-
{
1032-
"url": "guide/entry-components",
1033-
"title": "Entry components",
1034-
"tooltip": "All about entry components in Angular."
1035-
},
10361031
{
10371032
"url": "guide/feature-modules",
10381033
"title": "Feature modules",

devtools/projects/ng-devtools/src/lib/devtools-tabs/profiler/profiler.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {TimelineModule} from './timeline/timeline.module';
3434
MatTooltipModule,
3535
],
3636
exports: [ProfilerComponent],
37-
entryComponents: [ProfilerImportDialogComponent],
3837
})
3938
export class ProfilerModule {
4039
}

devtools/projects/ng-devtools/src/lib/devtools-tabs/router-tree/router-tree.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {RouterTreeComponent} from './router-tree.component';
1717
declarations: [RouterTreeComponent],
1818
imports: [CommonModule, MatDialogModule, MatSelectModule],
1919
exports: [RouterTreeComponent],
20-
entryComponents: [],
2120
})
2221
export class RouterTreeModule {
2322
}

0 commit comments

Comments
 (0)