Skip to content

Commit 054798c

Browse files
zzzariescopybara-github
authored andcommitted
Upgrade angular for oss plugin from v14 to v15
Checked stuff: - Angular upgrade to ^15.2.9 (find avail versions at https://semver.npmjs.com/ ) - Check on https://update.angular.io/?v=14.0-15.0 - Check relative package compatibility (typescript, nodejs, ngrx, rxjs..) for angular and ngrx: https://angular.io/guide/versions#actively-supported-versions , https://ngrx.io/guide/migration/v15 - The current default node version met requirements https://github.com/bazelbuild/rules_nodejs/blob/5.7.0/docs/Core.md#node_version - Upgrade typescript to 4.8.2 - Upgrade ngrx - Fixed style discrepancy by overriding with legacy stylesheets (legacy-core, all-legacy-components-themes, legacy-typography-hierarchy). However some of the legacy sheet is going away in Q4/2023, need to figure out right next step. PiperOrigin-RevId: 538322545
1 parent f8ff528 commit 054798c

File tree

68 files changed

+1674
-745
lines changed

Some content is hidden

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

68 files changed

+1674
-745
lines changed

frontend/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ sass_binary(
7676
# need to include the node_modules path to enable sass to find the theming file
7777
include_paths = [
7878
"node_modules",
79+
# used for resolve the external @npm dependencies
7980
"external/npm/node_modules",
8081
],
8182
output_name = "styles.css",

frontend/app/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ xprof_ng_module(
1919
"@npm//@ngrx/store",
2020
"@npm//rxjs",
2121
"@org_xprof//frontend/app/common/angular:angular_common_http",
22-
"@org_xprof//frontend/app/common/angular:angular_material_progress_bar",
22+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_progress_bar",
2323
"@org_xprof//frontend/app/common/angular:angular_platform-browser_animation",
2424
"@org_xprof//frontend/app/common/constants",
2525
"@org_xprof//frontend/app/common/interfaces",

frontend/app/app_module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {HttpClientModule} from '@angular/common/http';
22
import {NgModule} from '@angular/core';
3-
import {MatProgressBarModule} from '@angular/material/progress-bar';
3+
import {MatLegacyProgressBarModule} from '@angular/material/legacy-progress-bar';
44
import {BrowserModule} from '@angular/platform-browser';
55
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
66
import {EmptyPageModule} from 'org_xprof/frontend/app/components/empty_page/empty_page_module';
@@ -18,7 +18,7 @@ import {App} from './app';
1818
imports: [
1919
BrowserModule,
2020
HttpClientModule,
21-
MatProgressBarModule,
21+
MatLegacyProgressBarModule,
2222
EmptyPageModule,
2323
MainPageModule,
2424
BrowserAnimationsModule,

frontend/app/common/angular/BUILD

+16-16
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ ts_library(
2727
)
2828

2929
ts_library(
30-
name = "angular_material_progress_bar",
30+
name = "angular_material_legacy_progress_bar",
3131
srcs = [],
3232
deps = [
3333
"@npm//@angular/material",
3434
],
3535
)
3636

3737
ts_library(
38-
name = "angular_material_form_field",
38+
name = "angular_material_legacy_form_field",
3939
srcs = [],
4040
deps = [
4141
"@npm//@angular/material",
@@ -51,15 +51,15 @@ ts_library(
5151
)
5252

5353
ts_library(
54-
name = "angular_material_input",
54+
name = "angular_material_legacy_input",
5555
srcs = [],
5656
deps = [
5757
"@npm//@angular/material",
5858
],
5959
)
6060

6161
ts_library(
62-
name = "angular_material_button",
62+
name = "angular_material_legacy_button",
6363
srcs = [],
6464
deps = [
6565
"@npm//@angular/material",
@@ -75,7 +75,7 @@ ts_library(
7575
)
7676

7777
ts_library(
78-
name = "angular_material_menu",
78+
name = "angular_material_legacy_menu",
7979
srcs = [],
8080
deps = [
8181
"@npm//@angular/material",
@@ -91,87 +91,87 @@ ts_library(
9191
)
9292

9393
ts_library(
94-
name = "angular_material_checkbox",
94+
name = "angular_material_legacy_checkbox",
9595
srcs = [],
9696
deps = [
9797
"@npm//@angular/material",
9898
],
9999
)
100100

101101
ts_library(
102-
name = "angular_material_dialog",
102+
name = "angular_material_legacy_dialog",
103103
srcs = [],
104104
deps = [
105105
"@npm//@angular/material",
106106
],
107107
)
108108

109109
ts_library(
110-
name = "angular_material_radio",
110+
name = "angular_material_legacy_radio",
111111
srcs = [],
112112
deps = [
113113
"@npm//@angular/material",
114114
],
115115
)
116116

117117
ts_library(
118-
name = "angular_material_progress_spinner",
118+
name = "angular_material_legacy_progress_spinner",
119119
srcs = [],
120120
deps = [
121121
"@npm//@angular/material",
122122
],
123123
)
124124

125125
ts_library(
126-
name = "angular_material_snack_bar",
126+
name = "angular_material_legacy_snack_bar",
127127
srcs = [],
128128
deps = [
129129
"@npm//@angular/material",
130130
],
131131
)
132132

133133
ts_library(
134-
name = "angular_material_card",
134+
name = "angular_material_legacy_card",
135135
srcs = [],
136136
deps = [
137137
"@npm//@angular/material",
138138
],
139139
)
140140

141141
ts_library(
142-
name = "angular_material_slide_toggle",
142+
name = "angular_material_legacy_slide_toggle",
143143
srcs = [],
144144
deps = [
145145
"@npm//@angular/material",
146146
],
147147
)
148148

149149
ts_library(
150-
name = "angular_material_slider",
150+
name = "angular_material_legacy_slider",
151151
srcs = [],
152152
deps = [
153153
"@npm//@angular/material",
154154
],
155155
)
156156

157157
ts_library(
158-
name = "angular_material_tooltip",
158+
name = "angular_material_legacy_tooltip",
159159
srcs = [],
160160
deps = [
161161
"@npm//@angular/material",
162162
],
163163
)
164164

165165
ts_library(
166-
name = "angular_material_core",
166+
name = "angular_material_legacy_core",
167167
srcs = [],
168168
deps = [
169169
"@npm//@angular/material",
170170
],
171171
)
172172

173173
ts_library(
174-
name = "angular_material_select",
174+
name = "angular_material_legacy_select",
175175
srcs = [],
176176
deps = [
177177
"@npm//@angular/material",

frontend/app/components/capture_profile/BUILD

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ xprof_ng_module(
1919
"@npm//@angular/forms",
2020
"@npm//@ngrx/store",
2121
"@npm//rxjs",
22-
"@org_xprof//frontend/app/common/angular:angular_material_button",
23-
"@org_xprof//frontend/app/common/angular:angular_material_dialog",
24-
"@org_xprof//frontend/app/common/angular:angular_material_progress_spinner",
25-
"@org_xprof//frontend/app/common/angular:angular_material_snack_bar",
22+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_button",
23+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_dialog",
24+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_progress_spinner",
25+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_snack_bar",
2626
"@org_xprof//frontend/app/common/interfaces",
2727
"@org_xprof//frontend/app/components/capture_profile/capture_profile_dialog",
2828
"@org_xprof//frontend/app/services/data_service",

frontend/app/components/capture_profile/capture_profile.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Component, OnDestroy} from '@angular/core';
2-
import {MatDialog} from '@angular/material/dialog';
3-
import {MatSnackBar} from '@angular/material/snack-bar';
2+
import {MatLegacyDialog} from '@angular/material/legacy-dialog';
3+
import {MatLegacySnackBar} from '@angular/material/legacy-snack-bar';
44
import {Store} from '@ngrx/store';
55
import {CaptureProfileOptions, CaptureProfileResponse} from 'org_xprof/frontend/app/common/interfaces/capture_profile';
66
import {DataService} from 'org_xprof/frontend/app/services/data_service/data_service';
@@ -27,8 +27,8 @@ export class CaptureProfile implements OnDestroy {
2727
capturingProfile: Observable<boolean>;
2828

2929
constructor(
30-
private readonly dialog: MatDialog,
31-
private readonly snackBar: MatSnackBar,
30+
private readonly dialog: MatLegacyDialog,
31+
private readonly snackBar: MatLegacySnackBar,
3232
private readonly dataService: DataService,
3333
private readonly store: Store<{}>) {
3434
this.capturingProfile = this.store.select(getCapturingProfileState);

frontend/app/components/capture_profile/capture_profile_dialog/BUILD

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ xprof_ng_module(
1818
"@npm//@angular/core",
1919
"@npm//@angular/forms",
2020
"@npm//@angular/platform-browser",
21-
"@org_xprof//frontend/app/common/angular:angular_material_button",
22-
"@org_xprof//frontend/app/common/angular:angular_material_dialog",
2321
"@org_xprof//frontend/app/common/angular:angular_material_expansion",
24-
"@org_xprof//frontend/app/common/angular:angular_material_form_field",
25-
"@org_xprof//frontend/app/common/angular:angular_material_input",
26-
"@org_xprof//frontend/app/common/angular:angular_material_radio",
27-
"@org_xprof//frontend/app/common/angular:angular_material_select",
28-
"@org_xprof//frontend/app/common/angular:angular_material_tooltip",
22+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_button",
23+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_dialog",
24+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
25+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_input",
26+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_radio",
27+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
28+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip",
2929
"@org_xprof//frontend/app/common/interfaces",
3030
],
3131
)

frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {MatDialogRef} from '@angular/material/dialog';
2+
import {MatLegacyDialogRef} from '@angular/material/legacy-dialog';
33

44
/** A capture profile dialog component. */
55
@Component({
@@ -25,7 +25,7 @@ export class CaptureProfileDialog {
2525
delay = 0;
2626

2727
constructor(private readonly dialogRef:
28-
MatDialogRef<CaptureProfileDialog>) {}
28+
MatLegacyDialogRef<CaptureProfileDialog>) {}
2929

3030
addressTypeChanged(value: string) {
3131
this.isTpuName = value === 'tpu';

frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog_module.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import {CommonModule} from '@angular/common';
22
import {NgModule} from '@angular/core';
33
import {FormsModule} from '@angular/forms';
44
import {MatExpansionModule} from '@angular/material/expansion';
5-
import {MatButtonModule} from '@angular/material/button';
6-
import {MatDialogModule} from '@angular/material/dialog';
7-
import {MatFormFieldModule} from '@angular/material/form-field';
8-
import {MatInputModule} from '@angular/material/input';
9-
import {MatRadioModule} from '@angular/material/radio';
10-
import {MatSelectModule} from '@angular/material/select';
11-
import {MatTooltipModule} from '@angular/material/tooltip';
5+
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
6+
import {MatLegacyDialogModule} from '@angular/material/legacy-dialog';
7+
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
8+
import {MatLegacyInputModule} from '@angular/material/legacy-input';
9+
import {MatLegacyRadioModule} from '@angular/material/legacy-radio';
10+
import {MatLegacySelectModule} from '@angular/material/legacy-select';
11+
import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip';
1212
import {BrowserModule} from '@angular/platform-browser';
1313

1414
import {CaptureProfileDialog} from './capture_profile_dialog';
@@ -20,14 +20,14 @@ import {CaptureProfileDialog} from './capture_profile_dialog';
2020
BrowserModule,
2121
CommonModule,
2222
FormsModule,
23-
MatButtonModule,
24-
MatDialogModule,
23+
MatLegacyButtonModule,
24+
MatLegacyDialogModule,
2525
MatExpansionModule,
26-
MatFormFieldModule,
27-
MatInputModule,
28-
MatRadioModule,
29-
MatSelectModule,
30-
MatTooltipModule,
26+
MatLegacyFormFieldModule,
27+
MatLegacyInputModule,
28+
MatLegacyRadioModule,
29+
MatLegacySelectModule,
30+
MatLegacyTooltipModule,
3131
],
3232
exports: [CaptureProfileDialog]
3333
})

frontend/app/components/capture_profile/capture_profile_module.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {CommonModule} from '@angular/common';
22
import {NgModule} from '@angular/core';
3-
import {MatButtonModule} from '@angular/material/button';
4-
import {MatDialogModule} from '@angular/material/dialog';
5-
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
6-
import {MatSnackBarModule} from '@angular/material/snack-bar';
3+
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
4+
import {MatLegacyDialogModule} from '@angular/material/legacy-dialog';
5+
import {MatLegacyProgressSpinnerModule} from '@angular/material/legacy-progress-spinner';
6+
import {MatLegacySnackBarModule} from '@angular/material/legacy-snack-bar';
77

88
import {CaptureProfile} from './capture_profile';
99
import {CaptureProfileDialog} from './capture_profile_dialog/capture_profile_dialog';
@@ -14,11 +14,11 @@ import {CaptureProfileDialogModule} from './capture_profile_dialog/capture_profi
1414
declarations: [CaptureProfile],
1515
imports: [
1616
CommonModule,
17-
MatButtonModule,
18-
MatDialogModule,
19-
MatProgressSpinnerModule,
17+
MatLegacyButtonModule,
18+
MatLegacyDialogModule,
19+
MatLegacyProgressSpinnerModule,
2020
CaptureProfileDialogModule,
21-
MatSnackBarModule,
21+
MatLegacySnackBarModule,
2222
],
2323
exports: [CaptureProfile],
2424
entryComponents: [CaptureProfileDialog],

frontend/app/components/chart/table/BUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ xprof_ng_module(
1616
deps = [
1717
"@npm//@angular/core",
1818
"@npm//@types/google.visualization",
19-
"@org_xprof//frontend/app/common/angular:angular_material_core",
20-
"@org_xprof//frontend/app/common/angular:angular_material_form_field",
21-
"@org_xprof//frontend/app/common/angular:angular_material_select",
19+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
20+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
21+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
2222
],
2323
)
2424

frontend/app/components/chart/table/table_module.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {CommonModule} from '@angular/common';
22
import {NgModule} from '@angular/core';
3-
import {MatOptionModule} from '@angular/material/core';
4-
import {MatFormFieldModule} from '@angular/material/form-field';
5-
import {MatSelectModule} from '@angular/material/select';
3+
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
4+
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
5+
import {MatLegacySelectModule} from '@angular/material/legacy-select';
66

77
import {Table} from './table';
88

@@ -11,9 +11,9 @@ import {Table} from './table';
1111
declarations: [Table],
1212
imports: [
1313
CommonModule,
14-
MatOptionModule,
15-
MatSelectModule,
16-
MatFormFieldModule,
14+
MatLegacyOptionModule,
15+
MatLegacySelectModule,
16+
MatLegacyFormFieldModule,
1717
],
1818
exports: [Table],
1919
})

frontend/app/components/controls/category_filter/BUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ xprof_ng_module(
1717
"@npm//@angular/common",
1818
"@npm//@angular/core",
1919
"@npm//@types/google.visualization",
20-
"@org_xprof//frontend/app/common/angular:angular_material_core",
21-
"@org_xprof//frontend/app/common/angular:angular_material_form_field",
22-
"@org_xprof//frontend/app/common/angular:angular_material_select",
20+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
21+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
22+
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
2323
],
2424
)
2525

frontend/app/components/controls/category_filter/category_filter_module.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {CommonModule} from '@angular/common';
22
import {NgModule} from '@angular/core';
3-
import {MatOptionModule} from '@angular/material/core';
4-
import {MatFormFieldModule} from '@angular/material/form-field';
5-
import {MatSelectModule} from '@angular/material/select';
3+
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
4+
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
5+
import {MatLegacySelectModule} from '@angular/material/legacy-select';
66

77
import {CategoryFilter} from './category_filter';
88

@@ -11,9 +11,9 @@ import {CategoryFilter} from './category_filter';
1111
declarations: [CategoryFilter],
1212
imports: [
1313
CommonModule,
14-
MatOptionModule,
15-
MatFormFieldModule,
16-
MatSelectModule,
14+
MatLegacyOptionModule,
15+
MatLegacyFormFieldModule,
16+
MatLegacySelectModule,
1717
],
1818
exports: [CategoryFilter],
1919
})

0 commit comments

Comments
 (0)