From afcc3ee20982c5de6135ef058fe38cc43ce9bca5 Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Fri, 11 Oct 2024 14:35:38 +0200 Subject: [PATCH] refactor(core): Migrate modules directory with the schematic. (#58160) All components, directives and pipes will now use standalone as default. Non-standalone decorators have now . PR Close #58160 --- .../transplanted_views/transplanted_views.ts | 2 ++ .../src/class_bindings/app.component.ts | 1 + .../class_bindings/class_bindings.component.ts | 1 + .../benchmarks/src/expanding_rows/benchmark.ts | 1 + .../src/expanding_rows/benchmark_module.ts | 1 + .../benchmarkable_expanding_row.ts | 1 + .../src/expanding_rows/expanding_row.ts | 1 + .../expanding_row_details_caption.ts | 1 + .../expanding_row_details_content.ts | 1 + .../src/expanding_rows/expanding_row_host.ts | 1 + .../expanding_rows/expanding_row_summary.ts | 1 + .../expanding_row_uncollapsible.ts | 1 + .../src/js-web-frameworks/ng2/rows.ts | 1 + modules/benchmarks/src/largeform/ng2/app.ts | 1 + modules/benchmarks/src/largetable/ng2/table.ts | 1 + .../src/largetable/ng2_switch/table.ts | 1 + modules/benchmarks/src/styling/ng2/styling.ts | 1 + modules/benchmarks/src/tree/ng2/tree.ts | 1 + modules/benchmarks/src/tree/ng2_static/tree.ts | 7 ++++++- modules/benchmarks/src/tree/ng2_switch/tree.ts | 1 + .../playground/src/animate/app/animate-app.ts | 3 +-- modules/playground/src/async/index.ts | 1 + modules/playground/src/gestures/index.ts | 6 +++++- modules/playground/src/hello_world/index.ts | 6 +++++- modules/playground/src/http/app/http_comp.ts | 1 + modules/playground/src/jsonp/app/jsonp_comp.ts | 1 + modules/playground/src/key_events/index.ts | 1 + .../playground/src/model_driven_forms/index.ts | 2 ++ .../playground/src/order_management/index.ts | 4 ++++ .../playground/src/person_management/index.ts | 4 ++++ .../src/relative_assets/app/my_cmp.ts | 1 + .../playground/src/relative_assets/index.ts | 1 + .../playground/src/routing/app/inbox-app.ts | 18 +++++++++++++++--- .../playground/src/routing/app/inbox-detail.ts | 6 +++++- modules/playground/src/sourcemap/index.ts | 1 + modules/playground/src/svg/index.ts | 7 ++++++- .../src/template_driven_forms/index.ts | 8 +++++++- modules/playground/src/todo/index.ts | 7 ++++++- modules/playground/src/upgrade/index.ts | 2 ++ .../src/zippy_component/app/zippy.ts | 6 +++++- .../playground/src/zippy_component/index.ts | 1 + .../test/golden-test/cross_references.ts | 2 -- .../derived_class_meta_input_alias.ts | 1 - .../different_instantiations_of_reference.ts | 1 - .../test/golden-test/getters.ts | 4 +--- .../test/golden-test/host_bindings.ts | 3 --- .../test/golden-test/identifier_collisions.ts | 5 +---- .../signal-migration/test/golden-test/index.ts | 1 - .../test/golden-test/index_access_input.ts | 5 +---- .../test/golden-test/index_spec.ts | 1 - .../test/golden-test/inline_template.ts | 1 - .../test/golden-test/jit_true_components.ts | 2 -- .../manual_instantiations_external.ts | 4 +--- .../test/golden-test/modifier_tests.ts | 5 +---- .../golden-test/nested_template_prop_access.ts | 1 - .../test/golden-test/object_expansion.ts | 4 +--- .../golden-test/problematic_type_reference.ts | 5 +---- .../test/golden-test/safe_property_reads.ts | 1 - .../golden-test/shared_incompatible_scopes.ts | 1 - .../test/golden-test/template_ng_if.ts | 1 - .../golden-test/template_object_shorthand.ts | 1 - .../test/golden-test/template_writes.ts | 1 - 62 files changed, 108 insertions(+), 56 deletions(-) diff --git a/modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts b/modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts index a82113b9de1..16de043e37b 100644 --- a/modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts +++ b/modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts @@ -26,6 +26,7 @@ import {newArray} from '../util'; `, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class InsertionComponent { @Input() template!: TemplateRef>; @@ -49,6 +50,7 @@ export class InsertionComponent { {{ trackTemplateRefresh() }} `, + standalone: false, }) export class DeclarationComponent { @Input() viewCount = 1; diff --git a/modules/benchmarks/src/class_bindings/app.component.ts b/modules/benchmarks/src/class_bindings/app.component.ts index 246c78b7748..bff8eec8f9b 100644 --- a/modules/benchmarks/src/class_bindings/app.component.ts +++ b/modules/benchmarks/src/class_bindings/app.component.ts @@ -17,6 +17,7 @@ import {Component} from '@angular/core'; > `, + standalone: false, }) export class AppComponent { show = false; diff --git a/modules/benchmarks/src/class_bindings/class_bindings.component.ts b/modules/benchmarks/src/class_bindings/class_bindings.component.ts index fc15360ac59..c751f1c14e8 100644 --- a/modules/benchmarks/src/class_bindings/class_bindings.component.ts +++ b/modules/benchmarks/src/class_bindings/class_bindings.component.ts @@ -29,6 +29,7 @@ import {Component, Input} from '@angular/core'; `, + standalone: false, }) export class ClassBindingsComponent { @Input() msg: string = ''; diff --git a/modules/benchmarks/src/expanding_rows/benchmark.ts b/modules/benchmarks/src/expanding_rows/benchmark.ts index 34b8d2e61ec..79c5172f089 100644 --- a/modules/benchmarks/src/expanding_rows/benchmark.ts +++ b/modules/benchmarks/src/expanding_rows/benchmark.ts @@ -28,6 +28,7 @@ import {BenchmarkableExpandingRowModule} from './benchmarkable_expanding_row_mod `, + standalone: false, }) export class InitializationRoot implements AfterViewInit { @ViewChild(BenchmarkableExpandingRow, {static: true}) expandingRow!: BenchmarkableExpandingRow; diff --git a/modules/benchmarks/src/expanding_rows/benchmark_module.ts b/modules/benchmarks/src/expanding_rows/benchmark_module.ts index e64db372b4e..51c0d8d574a 100644 --- a/modules/benchmarks/src/expanding_rows/benchmark_module.ts +++ b/modules/benchmarks/src/expanding_rows/benchmark_module.ts @@ -25,6 +25,7 @@ import {Component, ErrorHandler, Injectable, NgModule} from '@angular/core'; host: { 'class': 'cfc-ng2-region', }, + standalone: false, }) export class BenchmarkArea {} diff --git a/modules/benchmarks/src/expanding_rows/benchmarkable_expanding_row.ts b/modules/benchmarks/src/expanding_rows/benchmarkable_expanding_row.ts index b2c7d5f0c9d..f3fc75c3d33 100644 --- a/modules/benchmarks/src/expanding_rows/benchmarkable_expanding_row.ts +++ b/modules/benchmarks/src/expanding_rows/benchmarkable_expanding_row.ts @@ -38,6 +38,7 @@ export interface MlbTeam { `, + standalone: false, }) export class BenchmarkableExpandingRow { // TODO(b/109816955): remove '!', see go/strict-prop-init-fix. diff --git a/modules/benchmarks/src/expanding_rows/expanding_row.ts b/modules/benchmarks/src/expanding_rows/expanding_row.ts index 77b2dc330d7..3e23e788ff1 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row.ts @@ -121,6 +121,7 @@ export interface ExpandingRowHostBase { `, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class ExpandingRow { /** diff --git a/modules/benchmarks/src/expanding_rows/expanding_row_details_caption.ts b/modules/benchmarks/src/expanding_rows/expanding_row_details_caption.ts index 6071e9e76e0..be980efd860 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row_details_caption.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row_details_caption.ts @@ -36,6 +36,7 @@ import {expanding_row_css} from './expanding_row_css'; `, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class ExpandingRowDetailsCaption implements OnDestroy { /** The background color of this component. */ diff --git a/modules/benchmarks/src/expanding_rows/expanding_row_details_content.ts b/modules/benchmarks/src/expanding_rows/expanding_row_details_content.ts index 4844dc77541..8fe2deab180 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row_details_content.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row_details_content.ts @@ -29,6 +29,7 @@ import {expanding_row_css} from './expanding_row_css'; `, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class ExpandingRowDetailsContent implements OnDestroy { /** Used for unsubscribing to changes in isExpanded parent property. */ diff --git a/modules/benchmarks/src/expanding_rows/expanding_row_host.ts b/modules/benchmarks/src/expanding_rows/expanding_row_host.ts index b62b86292d4..c6a22fb871e 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row_host.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row_host.ts @@ -58,6 +58,7 @@ type UpOrDown = 'up' | 'down';
`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{provide: EXPANDING_ROW_HOST_INJECTION_TOKEN, useExisting: ExpandingRowHost}], + standalone: false, }) export class ExpandingRowHost implements AfterViewInit, OnDestroy, ExpandingRowHostBase { /** diff --git a/modules/benchmarks/src/expanding_rows/expanding_row_summary.ts b/modules/benchmarks/src/expanding_rows/expanding_row_summary.ts index 803d9ad5b27..826428035bb 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row_summary.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row_summary.ts @@ -55,6 +55,7 @@ const KEY_CODE_TAB = 9; `, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class ExpandingRowSummary implements OnDestroy { /** diff --git a/modules/benchmarks/src/expanding_rows/expanding_row_uncollapsible.ts b/modules/benchmarks/src/expanding_rows/expanding_row_uncollapsible.ts index f940cf67639..6c4807d1150 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_row_uncollapsible.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_row_uncollapsible.ts @@ -14,5 +14,6 @@ import {Directive} from '@angular/core'; */ @Directive({ selector: '[cfcUncollapsible]', + standalone: false, }) export class ExpandingRowUncollapsible {} diff --git a/modules/benchmarks/src/js-web-frameworks/ng2/rows.ts b/modules/benchmarks/src/js-web-frameworks/ng2/rows.ts index 01f0c2aa5e6..c9bd987dd2a 100644 --- a/modules/benchmarks/src/js-web-frameworks/ng2/rows.ts +++ b/modules/benchmarks/src/js-web-frameworks/ng2/rows.ts @@ -36,6 +36,7 @@ export interface RowData { `, + standalone: false, }) export class JsWebFrameworksComponent { data: Array = []; diff --git a/modules/benchmarks/src/largeform/ng2/app.ts b/modules/benchmarks/src/largeform/ng2/app.ts index ee6e9f1f1fb..3c7697aa173 100644 --- a/modules/benchmarks/src/largeform/ng2/app.ts +++ b/modules/benchmarks/src/largeform/ng2/app.ts @@ -64,6 +64,7 @@ import {BrowserModule} from '@angular/platform-browser'; `, + standalone: false, }) export class AppComponent { copies: number[] = []; diff --git a/modules/benchmarks/src/largetable/ng2/table.ts b/modules/benchmarks/src/largetable/ng2/table.ts index 668f3ae06e2..bd14c751db4 100644 --- a/modules/benchmarks/src/largetable/ng2/table.ts +++ b/modules/benchmarks/src/largetable/ng2/table.ts @@ -28,6 +28,7 @@ let trustedGreyColor: SafeStyle; `, + standalone: false, }) export class TableComponent { @Input() data: TableCell[][] = emptyTable; diff --git a/modules/benchmarks/src/largetable/ng2_switch/table.ts b/modules/benchmarks/src/largetable/ng2_switch/table.ts index e665a4e9f4f..7da696796fd 100644 --- a/modules/benchmarks/src/largetable/ng2_switch/table.ts +++ b/modules/benchmarks/src/largetable/ng2_switch/table.ts @@ -25,6 +25,7 @@ import {emptyTable, TableCell} from '../util'; `, + standalone: false, }) export class TableComponent { @Input() data: TableCell[][] = emptyTable; diff --git a/modules/benchmarks/src/styling/ng2/styling.ts b/modules/benchmarks/src/styling/ng2/styling.ts index 2f7ee6a3e55..9f773d53e72 100644 --- a/modules/benchmarks/src/styling/ng2/styling.ts +++ b/modules/benchmarks/src/styling/ng2/styling.ts @@ -42,6 +42,7 @@ import {BrowserModule} from '@angular/platform-browser'; > `, + standalone: false, }) export class StylingComponent { data: number[] = []; diff --git a/modules/benchmarks/src/tree/ng2/tree.ts b/modules/benchmarks/src/tree/ng2/tree.ts index b290f553bbc..c6d50c5ba96 100644 --- a/modules/benchmarks/src/tree/ng2/tree.ts +++ b/modules/benchmarks/src/tree/ng2/tree.ts @@ -20,6 +20,7 @@ let trustedGreyColor: SafeStyle; template: ` {{ data.value }} `, + standalone: false, }) export class TreeComponent { data: TreeNode = emptyTree; diff --git a/modules/benchmarks/src/tree/ng2_static/tree.ts b/modules/benchmarks/src/tree/ng2_static/tree.ts index 26141d3094a..2d57c809711 100644 --- a/modules/benchmarks/src/tree/ng2_static/tree.ts +++ b/modules/benchmarks/src/tree/ng2_static/tree.ts @@ -21,7 +21,11 @@ function createTreeComponent(level: number, isLeaf: boolean) { template += `<${nextTreeEl} [data]='data.right'><${nextTreeEl} [data]='data.left'>`; } - @Component({selector: `tree${level}`, template: template}) + @Component({ + selector: `tree${level}`, + template: template, + standalone: false, + }) class TreeComponent { @Input() data: TreeNode; get bgColor() { @@ -35,6 +39,7 @@ function createTreeComponent(level: number, isLeaf: boolean) { @Component({ selector: 'tree', template: ``, + standalone: false, }) export class RootTreeComponent { @Input() data: TreeNode = emptyTree; diff --git a/modules/benchmarks/src/tree/ng2_switch/tree.ts b/modules/benchmarks/src/tree/ng2_switch/tree.ts index e2ca36c3955..757df6df7f3 100644 --- a/modules/benchmarks/src/tree/ng2_switch/tree.ts +++ b/modules/benchmarks/src/tree/ng2_switch/tree.ts @@ -19,6 +19,7 @@ import {emptyTree, TreeNode} from '../util'; `, + standalone: false, }) export class TreeComponent { @Input() data: TreeNode = emptyTree; diff --git a/modules/playground/src/animate/app/animate-app.ts b/modules/playground/src/animate/app/animate-app.ts index a3ea82fa98f..3c8fecd3ff1 100644 --- a/modules/playground/src/animate/app/animate-app.ts +++ b/modules/playground/src/animate/app/animate-app.ts @@ -45,12 +45,10 @@ import {Component} from '@angular/core'; 'active', style({'background-color': 'orange', 'color': 'white', 'font-size': '100px'}), ), - transition('active <=> start', [ animate(500, style({'transform': 'scale(2)'})), animate(500), ]), - transition('* => *', [ animate(1000, style({'opacity': 1, 'height': 300})), animate(1000, style({'background-color': 'blue'})), @@ -66,6 +64,7 @@ import {Component} from '@angular/core'; ]), ]), ], + standalone: false, }) export class AnimateApp { public items: number[] = []; diff --git a/modules/playground/src/async/index.ts b/modules/playground/src/async/index.ts index 332219a99e7..bb6a53f48e0 100644 --- a/modules/playground/src/async/index.ts +++ b/modules/playground/src/async/index.ts @@ -43,6 +43,7 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; `, + standalone: false, }) class AsyncApplication { val1: number = 0; diff --git a/modules/playground/src/gestures/index.ts b/modules/playground/src/gestures/index.ts index 0a005a50b31..f492136b62d 100644 --- a/modules/playground/src/gestures/index.ts +++ b/modules/playground/src/gestures/index.ts @@ -10,7 +10,11 @@ import {Component, NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -@Component({selector: 'gestures-app', templateUrl: 'template.html'}) +@Component({ + selector: 'gestures-app', + templateUrl: 'template.html', + standalone: false, +}) class GesturesCmp { swipeDirection: string = '-'; pinchScale: number = 1; diff --git a/modules/playground/src/hello_world/index.ts b/modules/playground/src/hello_world/index.ts index 8a322823162..d595af1884a 100644 --- a/modules/playground/src/hello_world/index.ts +++ b/modules/playground/src/hello_world/index.ts @@ -18,7 +18,10 @@ export class GreetingService { // Directives are light-weight. They don't allow new // expression contexts (use @Component for those needs). -@Directive({selector: '[red]'}) +@Directive({ + selector: '[red]', + standalone: false, +}) export class RedDec { // ElementRef is always injectable and it wraps the element on which the // directive was found by the compiler. @@ -44,6 +47,7 @@ export class RedDec { // context of the HelloCmp class below. template: `
{{ greeting }} world!
`, + standalone: false, }) export class HelloCmp { greeting: string; diff --git a/modules/playground/src/http/app/http_comp.ts b/modules/playground/src/http/app/http_comp.ts index 4b35746f345..8bf3034a815 100644 --- a/modules/playground/src/http/app/http_comp.ts +++ b/modules/playground/src/http/app/http_comp.ts @@ -17,6 +17,7 @@ import {Component} from '@angular/core';
  • hello, {{ person['name'] }}
  • `, + standalone: false, }) export class HttpCmp { people: Object[]; diff --git a/modules/playground/src/jsonp/app/jsonp_comp.ts b/modules/playground/src/jsonp/app/jsonp_comp.ts index fd392e9d6a2..7ed923aabb4 100644 --- a/modules/playground/src/jsonp/app/jsonp_comp.ts +++ b/modules/playground/src/jsonp/app/jsonp_comp.ts @@ -17,6 +17,7 @@ import {Component} from '@angular/core';
  • hello, {{ person.name }}
  • `, + standalone: false, }) export class JsonpCmp { people: Object; diff --git a/modules/playground/src/key_events/index.ts b/modules/playground/src/key_events/index.ts index 96583c07004..1cd1dedba66 100644 --- a/modules/playground/src/key_events/index.ts +++ b/modules/playground/src/key_events/index.ts @@ -24,6 +24,7 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; > {{ shiftEnter ? 'You pressed shift.enter!' : '' }} `, + standalone: false, }) export class KeyEventsApp { lastKey: string = '(none)'; diff --git a/modules/playground/src/model_driven_forms/index.ts b/modules/playground/src/model_driven_forms/index.ts index 6201a17fbd5..394919134cd 100644 --- a/modules/playground/src/model_driven_forms/index.ts +++ b/modules/playground/src/model_driven_forms/index.ts @@ -51,6 +51,7 @@ function creditCardValidator(c: AbstractControl): {[key: string]: boolean} { selector: 'show-error', inputs: ['controlPath: control', 'errorTypes: errors'], template: ` {{ errorMessage }} `, + standalone: false, }) export class ShowError { formDir: FormGroupDirective; @@ -140,6 +141,7 @@ export class ShowError { `, + standalone: false, }) export class ReactiveForms { form: UntypedFormGroup; diff --git a/modules/playground/src/order_management/index.ts b/modules/playground/src/order_management/index.ts index 6aa403e8303..4bf44f3c65b 100644 --- a/modules/playground/src/order_management/index.ts +++ b/modules/playground/src/order_management/index.ts @@ -115,6 +115,7 @@ export class DataService { `, + standalone: false, }) export class OrderListComponent { orders: Order[]; @@ -158,6 +159,7 @@ export class OrderListComponent { `, + standalone: false, }) export class OrderItemComponent { @Input() item: OrderItem; @@ -203,6 +205,7 @@ export class OrderItemComponent { > `, + standalone: false, }) export class OrderDetailsComponent { constructor(private _service: DataService) {} @@ -227,6 +230,7 @@ export class OrderDetailsComponent { `, + standalone: false, }) export class OrderManagementApplication {} diff --git a/modules/playground/src/person_management/index.ts b/modules/playground/src/person_management/index.ts index 0a40d6dbadb..99b29d328c9 100644 --- a/modules/playground/src/person_management/index.ts +++ b/modules/playground/src/person_management/index.ts @@ -124,6 +124,7 @@ export class DataService { `, + standalone: false, }) export class FullNameComponent { constructor(private _service: DataService) {} @@ -213,6 +214,7 @@ export class FullNameComponent { `, + standalone: false, }) export class PersonsDetailComponent { constructor(private _service: DataService) {} @@ -235,6 +237,7 @@ export class PersonsDetailComponent { `, + standalone: false, }) export class PersonsComponent { persons: Person[]; @@ -258,6 +261,7 @@ export class PersonsComponent { `, + standalone: false, }) export class PersonManagementApplication { mode: string; diff --git a/modules/playground/src/relative_assets/app/my_cmp.ts b/modules/playground/src/relative_assets/app/my_cmp.ts index cd41b88a393..e4542aca56e 100644 --- a/modules/playground/src/relative_assets/app/my_cmp.ts +++ b/modules/playground/src/relative_assets/app/my_cmp.ts @@ -12,5 +12,6 @@ import {Component} from '@angular/core'; selector: 'my-cmp', templateUrl: './tpl.html', styleUrls: ['./style.css'], + standalone: false, }) export class MyCmp {} diff --git a/modules/playground/src/relative_assets/index.ts b/modules/playground/src/relative_assets/index.ts index 886899d4586..a1ae649f590 100644 --- a/modules/playground/src/relative_assets/index.ts +++ b/modules/playground/src/relative_assets/index.ts @@ -15,6 +15,7 @@ import {MyCmp} from './app/my_cmp'; @Component({ selector: 'relative-app', template: `component = `, + standalone: false, }) export class RelativeApp {} diff --git a/modules/playground/src/routing/app/inbox-app.ts b/modules/playground/src/routing/app/inbox-app.ts index e5412f13b38..80469a01283 100644 --- a/modules/playground/src/routing/app/inbox-app.ts +++ b/modules/playground/src/routing/app/inbox-app.ts @@ -92,7 +92,11 @@ export class DbService { } } -@Component({selector: 'inbox', templateUrl: './inbox.html'}) +@Component({ + selector: 'inbox', + templateUrl: './inbox.html', + standalone: false, +}) export class InboxCmp { items: InboxRecord[] = []; private ready: boolean = false; @@ -119,7 +123,11 @@ export class InboxCmp { } } -@Component({selector: 'drafts', templateUrl: './drafts.html'}) +@Component({ + selector: 'drafts', + templateUrl: './drafts.html', + standalone: false, +}) export class DraftsCmp { items: InboxRecord[] = []; private ready: boolean = false; @@ -142,5 +150,9 @@ export const ROUTER_CONFIG: Routes = [ {path: 'detail', loadChildren: () => import('./inbox-detail').then((mod) => mod.default)}, ]; -@Component({selector: 'inbox-app', templateUrl: './inbox-app.html'}) +@Component({ + selector: 'inbox-app', + templateUrl: './inbox-app.html', + standalone: false, +}) export class InboxApp {} diff --git a/modules/playground/src/routing/app/inbox-detail.ts b/modules/playground/src/routing/app/inbox-detail.ts index d5fa30f0dc4..54e8916e379 100644 --- a/modules/playground/src/routing/app/inbox-detail.ts +++ b/modules/playground/src/routing/app/inbox-detail.ts @@ -11,7 +11,11 @@ import {ActivatedRoute, RouterModule} from '@angular/router'; import {DbService, InboxRecord} from './inbox-app'; -@Component({selector: 'inbox-detail', templateUrl: './inbox-detail.html'}) +@Component({ + selector: 'inbox-detail', + templateUrl: './inbox-detail.html', + standalone: false, +}) export class InboxDetailCmp { record: InboxRecord = new InboxRecord(); private ready: boolean = false; diff --git a/modules/playground/src/sourcemap/index.ts b/modules/playground/src/sourcemap/index.ts index c902728f9ef..8d09cc885cc 100644 --- a/modules/playground/src/sourcemap/index.ts +++ b/modules/playground/src/sourcemap/index.ts @@ -13,6 +13,7 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; @Component({ selector: 'error-app', template: ` `, + standalone: false, }) export class ErrorComponent { createError(): void { diff --git a/modules/playground/src/svg/index.ts b/modules/playground/src/svg/index.ts index 4f097ab0c63..1f0671e4192 100644 --- a/modules/playground/src/svg/index.ts +++ b/modules/playground/src/svg/index.ts @@ -10,7 +10,11 @@ import {Component, NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -@Component({selector: '[svg-group]', template: `Hello`}) +@Component({ + selector: '[svg-group]', + template: `Hello`, + standalone: false, +}) export class SvgGroup {} @Component({ @@ -18,6 +22,7 @@ export class SvgGroup {} template: ` `, + standalone: false, }) export class SvgApp {} diff --git a/modules/playground/src/template_driven_forms/index.ts b/modules/playground/src/template_driven_forms/index.ts index 21ad598015e..9476ab1f8a0 100644 --- a/modules/playground/src/template_driven_forms/index.ts +++ b/modules/playground/src/template_driven_forms/index.ts @@ -45,7 +45,11 @@ export const creditCardValidatorBinding = { multi: true, }; -@Directive({selector: '[credit-card]', providers: [creditCardValidatorBinding]}) +@Directive({ + selector: '[credit-card]', + providers: [creditCardValidatorBinding], + standalone: false, +}) export class CreditCardValidator {} /** @@ -67,6 +71,7 @@ export class CreditCardValidator {} selector: 'show-error', inputs: ['controlPath: control', 'errorTypes: errors'], template: ` {{ errorMessage }} `, + standalone: false, }) export class ShowError { formDir: NgForm; @@ -162,6 +167,7 @@ export class ShowError { `, + standalone: false, }) export class TemplateDrivenForms { model = new CheckoutModel(); diff --git a/modules/playground/src/todo/index.ts b/modules/playground/src/todo/index.ts index 8b3acb07dc3..f45a47440c6 100644 --- a/modules/playground/src/todo/index.ts +++ b/modules/playground/src/todo/index.ts @@ -12,7 +12,12 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {Store, Todo, TodoFactory} from './app/TodoStore'; -@Component({selector: 'todo-app', viewProviders: [Store, TodoFactory], templateUrl: 'todo.html'}) +@Component({ + selector: 'todo-app', + viewProviders: [Store, TodoFactory], + templateUrl: 'todo.html', + standalone: false, +}) export class TodoApp { todoEdit: Todo = null; diff --git a/modules/playground/src/upgrade/index.ts b/modules/playground/src/upgrade/index.ts index 340e923a2e3..a272ba43ad4 100644 --- a/modules/playground/src/upgrade/index.ts +++ b/modules/playground/src/upgrade/index.ts @@ -52,6 +52,7 @@ ng1module.directive('ng1User', function () {
    `, styles: styles, + standalone: false, }) export class Pane { @Input() title: string; @@ -70,6 +71,7 @@ export class Pane { `, styles: styles, + standalone: false, }) export class UpgradeApp { @Input() user: string; diff --git a/modules/playground/src/zippy_component/app/zippy.ts b/modules/playground/src/zippy_component/app/zippy.ts index c61887d6da5..490c57d1761 100644 --- a/modules/playground/src/zippy_component/app/zippy.ts +++ b/modules/playground/src/zippy_component/app/zippy.ts @@ -8,7 +8,11 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; -@Component({selector: 'zippy', templateUrl: './zippy.html'}) +@Component({ + selector: 'zippy', + templateUrl: './zippy.html', + standalone: false, +}) export class Zippy { visible: boolean = true; @Input() title: string = ''; diff --git a/modules/playground/src/zippy_component/index.ts b/modules/playground/src/zippy_component/index.ts index ebbe22577a1..fbd0a73939c 100644 --- a/modules/playground/src/zippy_component/index.ts +++ b/modules/playground/src/zippy_component/index.ts @@ -22,6 +22,7 @@ import {Zippy} from './app/zippy';
  • {{ log }}
  • `, + standalone: false, }) export class ZippyApp { logs: string[] = []; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/cross_references.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/cross_references.ts index 67d0d658aa5..6b485d0868f 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/cross_references.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/cross_references.ts @@ -6,7 +6,6 @@ import {Component, Input} from '@angular/core'; template: ` {{label}} `, - standalone: false, }) class Group { @Input() label!: string; @@ -20,7 +19,6 @@ class Group { {{group.label}} `, - standalone: false, }) class Option { constructor(public group: Group) {} diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/derived_class_meta_input_alias.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/derived_class_meta_input_alias.ts index 29ab65a0abc..f7d34b27ec3 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/derived_class_meta_input_alias.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/derived_class_meta_input_alias.ts @@ -10,6 +10,5 @@ class Base { @Directive({ inputs: [{name: 'bla', alias: 'matDerivedBla'}], - standalone: false, }) class Derived extends Base {} diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/different_instantiations_of_reference.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/different_instantiations_of_reference.ts index d3b4df31459..45acd13efbc 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/different_instantiations_of_reference.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/different_instantiations_of_reference.ts @@ -14,7 +14,6 @@ export class MatHint { @Component({ template: ``, - standalone: false, }) export class MatFormFieldTest { private declare _hintChildren: MatHint[]; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/getters.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/getters.ts index 5fa7083bf56..f7ad6a299fc 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/getters.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/getters.ts @@ -2,9 +2,7 @@ import {Directive, Input} from '@angular/core'; -@Directive({ - standalone: false, -}) +@Directive({}) export class WithGetters { @Input() get disabled() { diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/host_bindings.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/host_bindings.ts index c612230055a..a8c4edc75c1 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/host_bindings.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/host_bindings.ts @@ -10,7 +10,6 @@ import {Component, Input} from '@angular/core'; '[receiverNarrowing]': 'receiverNarrowing ? receiverNarrowing.id', // normal narrowing is irrelevant as we don't type check host bindings. }, - standalone: false, }) class HostBindingTestCmp { @Input() id = 'works'; @@ -29,7 +28,6 @@ const SHARED = { @Component({ template: '', host: SHARED, - standalone: false, }) class HostBindingsShared { @Input() id = false; @@ -38,7 +36,6 @@ class HostBindingsShared { @Component({ template: '', host: SHARED, - standalone: false, }) class HostBindingsShared2 { @Input() id = false; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/identifier_collisions.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/identifier_collisions.ts index 33b2ae9b78c..2959e7edb4a 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/identifier_collisions.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/identifier_collisions.ts @@ -12,10 +12,7 @@ import {Component, Input} from '@angular/core'; const complex = 'some global variable'; -@Component({ - template: '', - standalone: false, -}) +@Component({template: ''}) class MyComp { @Input() name: string | null = null; @Input() complex: string | null = null; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/index.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/index.ts index 8c8e7007b5f..3339ad35247 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/index.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/index.ts @@ -13,7 +13,6 @@ interface Audi extends Car { @Component({ selector: 'app-component', templateUrl: './template.html', - standalone: false, }) export class AppComponent { @Input() input: string | null = null; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/index_access_input.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/index_access_input.ts index 1f85edec002..fb0d715eb02 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/index_access_input.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/index_access_input.ts @@ -2,10 +2,7 @@ import {Component, Input} from '@angular/core'; -@Component({ - template: '', - standalone: false, -}) +@Component({template: ''}) class IndexAccessInput { @Input() items: string[] = []; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/index_spec.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/index_spec.ts index e256c8b7d1f..88109a41428 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/index_spec.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/index_spec.ts @@ -13,7 +13,6 @@ describe('bla', () => { {{ref.input.ok}} `, - standalone: false, }) class TestCmp {} TestBed.configureTestingModule({ diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/inline_template.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/inline_template.ts index 2f98bb9b9f5..a3575b80271 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/inline_template.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/inline_template.ts @@ -7,7 +7,6 @@ import {Component, Input} from '@angular/core';
    `, - standalone: false, }) export class InlineTmpl { @Input() justify: 'start' | 'end' = 'end'; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/jit_true_components.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/jit_true_components.ts index 2b0b7a16965..fd0b2839c6a 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/jit_true_components.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/jit_true_components.ts @@ -13,7 +13,6 @@ import {Component, Input} from '@angular/core'; @Component({ jit: true, template: '{{test}}', - standalone: false, }) class JitTrueComponent { @Input() test = true; @@ -22,7 +21,6 @@ class JitTrueComponent { @Component({ jit: true, templateUrl: './jit_true_component_external_tmpl.html', - standalone: false, }) class JitTrueComponentExternalTmpl { @Input() test = true; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/manual_instantiations_external.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/manual_instantiations_external.ts index 938eb1603e4..bdee8b4cd18 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/manual_instantiations_external.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/manual_instantiations_external.ts @@ -2,9 +2,7 @@ import {Component, Input} from '@angular/core'; -@Component({ - standalone: false, -}) +@Component({}) export class ManualInstantiation { @Input() bla: string = ''; } diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/modifier_tests.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/modifier_tests.ts index 725d1cf09b7..5c4c74bc007 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/modifier_tests.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/modifier_tests.ts @@ -6,10 +6,7 @@ function CustomDecorator() { return (a: any, b: any) => {}; } -@Component({ - template: '', - standalone: false, -}) +@Component({template: ''}) class ModifierScenarios { @Input() readonly alreadyReadonly = true; @Input() protected ImProtected = true; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/nested_template_prop_access.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/nested_template_prop_access.ts index 021b3e53314..de94c17856a 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/nested_template_prop_access.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/nested_template_prop_access.ts @@ -12,7 +12,6 @@ interface Config { Test `, - standalone: false, }) export class NestedTemplatePropAccess { @Input() config: Config = {}; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/object_expansion.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/object_expansion.ts index dd3a5a5b73d..b789ff23ee8 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/object_expansion.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/object_expansion.ts @@ -2,9 +2,7 @@ import {Component, Input} from '@angular/core'; -@Component({ - standalone: false, -}) +@Component({}) export class ObjectExpansion { @Input() bla: string = ''; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/problematic_type_reference.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/problematic_type_reference.ts index bd02b0d82df..da5eadd2a35 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/problematic_type_reference.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/problematic_type_reference.ts @@ -6,7 +6,6 @@ import {Component, Directive, QueryList, Input} from '@angular/core'; template: ` {{label}} `, - standalone: false, }) class Group { @Input() label!: string; @@ -19,9 +18,7 @@ class Base { }>(); } -@Directive({ - standalone: false, -}) +@Directive({}) class Option extends Base { _items = new QueryList(); } diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/safe_property_reads.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/safe_property_reads.ts index d2edc295e2a..0a78dde5751 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/safe_property_reads.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/safe_property_reads.ts @@ -14,7 +14,6 @@ import {Component, Input} from '@angular/core'; template: ` {{bla?.myInput}} `, - standalone: false, }) class WithSafePropertyReads { @Input() myInput = 0; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/shared_incompatible_scopes.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/shared_incompatible_scopes.ts index 64861647993..80b501e6bd6 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/shared_incompatible_scopes.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/shared_incompatible_scopes.ts @@ -9,7 +9,6 @@ class SomeDir { @Component({ template: ``, - standalone: false, }) export class ScopeMismatchTest { eachScopeRedeclared() { diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_ng_if.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_ng_if.ts index d2839e564a2..366458f0bf8 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_ng_if.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_ng_if.ts @@ -24,7 +24,6 @@ import {Component, Input} from '@angular/core'; {{notTheInput}} } `, - standalone: false, }) export class MyComp { @Input() first = true; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_object_shorthand.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_object_shorthand.ts index c151940504c..f484712a330 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_object_shorthand.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_object_shorthand.ts @@ -10,7 +10,6 @@ import {Component, Input} from '@angular/core'; host: { '[style]': '{myInput}', }, - standalone: false, }) export class TemplateObjectShorthand { @Input() myInput = true; diff --git a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_writes.ts b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_writes.ts index 54687126c7e..91cf882297f 100644 --- a/packages/core/schematics/migrations/signal-migration/test/golden-test/template_writes.ts +++ b/packages/core/schematics/migrations/signal-migration/test/golden-test/template_writes.ts @@ -11,7 +11,6 @@ import {Component, Input} from '@angular/core'; host: { '(click)': 'inputC = true', }, - standalone: false, }) class TwoWayBinding { @Input() inputA = '';