Skip to content

Commit d3bffdd

Browse files
authored
Bump angular to v19 (#1155)
1 parent 2425b3b commit d3bffdd

File tree

11 files changed

+3172
-1983
lines changed

11 files changed

+3172
-1983
lines changed

mesop/tests/e2e/focus_component_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test('focus select', async ({page}) => {
5151
await page.goto('/focus_component');
5252
await page.locator('//mat-select[@id="mat-select-0"]').click();
5353
await page.getByRole('option', {name: 'Select'}).click();
54-
await expectIsFocused(page, 'mat-select[id="mat-select-2"]');
54+
await expectIsFocused(page, 'mat-select[id="mat-select-1"]');
5555
});
5656

5757
test('focus slider', async ({page}) => {

mesop/web/src/app/styles.scss

+7
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ $_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);
139139

140140
$primary: $_primary;
141141
$tertiary: $_tertiary;
142+
// Use "sys" instead of "mat-sys" because
143+
// "sys" used to be the default and is still used
144+
// in downstream angular.
145+
// https://github.com/angular/components/pull/29908
146+
$system_variables_prefix: sys;
142147

143148
@function create-theme($density: 0) {
144149
@return mat.define-theme(
@@ -148,6 +153,7 @@ $tertiary: $_tertiary;
148153
primary: $_primary,
149154
tertiary: $_tertiary,
150155
use-system-variables: true,
156+
system-variables-prefix: $system_variables_prefix,
151157
),
152158
density: (
153159
scale: $density,
@@ -164,6 +170,7 @@ $dark-theme: mat.define-theme(
164170
primary: $_primary,
165171
tertiary: $_tertiary,
166172
use-system-variables: true,
173+
system-variables-prefix: $system_variables_prefix,
167174
),
168175
)
169176
);

mesop/web/src/component_renderer/component_loader.ts

-8
This file was deleted.

mesop/web/src/component_renderer/component_renderer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
UserEvent,
1818
WebComponentType,
1919
} from 'mesop/mesop/protos/ui_jspb_proto_pb/mesop/protos/ui_pb';
20-
import {ComponentLoader} from './component_loader';
2120
import {BoxType} from 'mesop/mesop/components/box/box_jspb_proto_pb/mesop/components/box/box_pb';
2221
import {
2322
BaseComponent,
@@ -39,7 +38,7 @@ const WEB_COMPONENT_PREFIX = '<web>';
3938
templateUrl: 'component_renderer.ng.html',
4039
styleUrl: 'component_renderer.css',
4140
standalone: true,
42-
imports: [CommonModule, ComponentLoader],
41+
imports: [CommonModule],
4342
})
4443
export class ComponentRenderer {
4544
@ViewChild('childrenTemplate', {static: true})

mesop/web/src/editor/editor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const routes: Routes = [{path: '**', component: Editor}];
5353
@Component({
5454
selector: 'mesop-editor-app',
5555
template: '<router-outlet></router-outlet>',
56-
imports: [Editor, RouterOutlet],
56+
imports: [RouterOutlet],
5757
standalone: true,
5858
})
5959
class MesopEditorApp {}

mesop/web/src/error/error_box.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from 'mesop/mesop/protos/ui_jspb_proto_pb/mesop/protos/ui_pb';
77

88
import {CommonModule} from '@angular/common';
9-
import {ComponentRenderer} from '../component_renderer/component_renderer';
109
import {Channel} from '../services/channel';
1110
import {marked} from '../../external/marked';
1211
import {MatIconModule} from '@angular/material/icon';
@@ -20,7 +19,6 @@ import {MatButtonModule} from '@angular/material/button';
2019
standalone: true,
2120
imports: [
2221
CommonModule,
23-
ComponentRenderer,
2422
MatProgressBarModule,
2523
MatIconModule,
2624
MatDialogModule,

mesop/web/src/shell/shell.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {provideAnimations} from '@angular/platform-browser/animations';
2828
import {bootstrapApplication} from '@angular/platform-browser';
2929
import {MatIconModule, MatIconRegistry} from '@angular/material/icon';
3030
import {MatSidenavModule} from '@angular/material/sidenav';
31-
import {ErrorBox, ServerErrorBoxDialogComponent} from '../error/error_box';
31+
import {ServerErrorBoxDialogComponent} from '../error/error_box';
3232
import {GlobalErrorHandlerService} from '../services/global_error_handler';
3333
import {getViewportSize} from '../utils/viewport_size';
3434
import {createCustomElement} from '@angular/elements';
@@ -54,7 +54,6 @@ import {MatDialog} from '@angular/material/dialog';
5454
MatProgressBarModule,
5555
MatIconModule,
5656
MatSidenavModule,
57-
ErrorBox,
5857
],
5958
providers: [{provide: ErrorHandler, useClass: GlobalErrorHandlerService}],
6059
styleUrl: 'shell.css',
@@ -265,7 +264,7 @@ const routes: Routes = [{path: '**', component: Shell}];
265264
@Component({
266265
selector: 'mesop-app',
267266
template: '<router-outlet></router-outlet>',
268-
imports: [Shell, RouterOutlet],
267+
imports: [RouterOutlet],
269268
standalone: true,
270269
})
271270
class MesopApp {}

package.json

+23-22
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@
4646
"ci-docs-monitor-test": "ts-node --esm --project scripts/tsconfig.json scripts/docs-deploy/monitoring/ci-test.mts",
4747
"ci-notify-slack-failure": "ts-node --esm --project scripts/tsconfig.json scripts/circleci/notify-slack-job-failure.mts"
4848
},
49-
"version": "^18.0.0",
49+
"version": "^19.0.0",
5050
"dependencies": {
51-
"@angular/animations": "^18.0.0",
52-
"@angular/cdk": "^18.0.0",
53-
"@angular/common": "^18.0.0",
54-
"@angular/compiler": "^18.0.0",
55-
"@angular/core": "^18.0.0",
51+
"@angular/animations": "^19.0.0",
52+
"@angular/cdk": "^19.0.0",
53+
"@angular/common": "^19.0.0",
54+
"@angular/compiler": "^19.0.0",
55+
"@angular/core": "^19.0.0",
5656
"@angular/elements": "^18.0.3",
57-
"@angular/forms": "^18.0.0",
58-
"@angular/material": "^18.0.0",
59-
"@angular/material-experimental": "^18.0.0",
60-
"@angular/platform-browser": "^18.0.0",
57+
"@angular/forms": "^19.0.0",
58+
"@angular/material": "^19.0.0",
59+
"@angular/material-experimental": "^19.0.0",
60+
"@angular/platform-browser": "^19.0.0",
6161
"@codemirror/lang-python": "^6.1.6",
6262
"@codemirror/merge": "^6.7.0",
6363
"@codemirror/theme-one-dark": "^6.1.2",
@@ -71,18 +71,19 @@
7171
"zone.js": "~0.14.0"
7272
},
7373
"devDependencies": {
74-
"@angular-devkit/build-angular": "18.0.0",
75-
"@angular-devkit/core": "^18.0.0",
76-
"@angular-devkit/schematics": "^18.0.0",
77-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469",
78-
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a11e93b01708684827af3873e9232b437c209237",
79-
"@angular/cli": "^18.0.0",
80-
"@angular/compiler-cli": "^18.0.0",
81-
"@angular/localize": "^18.0.0",
74+
"@angular-devkit/build-angular": "19.0.0",
75+
"@angular-devkit/core": "^19.0.0",
76+
"@angular-devkit/schematics": "^19.0.0",
77+
"@angular/bazel": "https://github.com/angular/bazel-builds.git#d9a8ea4f9e62cb475eff89519426a38631b2704d",
78+
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#74e0e7b090c6e16056290836b2d936ca7820b86f",
79+
"@angular/build": "^19.0.0",
80+
"@angular/cli": "^19.0.0",
81+
"@angular/compiler-cli": "^19.0.0",
82+
"@angular/localize": "^19.0.0",
8283
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#36946be4df61f6549ae3829c026022e47674eae2",
83-
"@angular/platform-browser-dynamic": "^18.0.0",
84-
"@angular/platform-server": "^18.0.0",
85-
"@angular/router": "^18.0.0",
84+
"@angular/platform-browser-dynamic": "^19.0.0",
85+
"@angular/platform-server": "^19.0.0",
86+
"@angular/router": "^19.0.0",
8687
"@babel/core": "^7.16.12",
8788
"@babel/helper-explode-assignable-expression": "^7.18.6",
8889
"@babel/helper-string-parser": "^7.22.5",
@@ -227,7 +228,7 @@
227228
"tsickle": "0.39.1",
228229
"tslint": "^6.1.3",
229230
"tsutils": "^3.21.0",
230-
"typescript": "5.4.2",
231+
"typescript": "5.6.3",
231232
"vrsource-tslint-rules": "6.0.0",
232233
"yaml": "^2.4.3",
233234
"yargs": "^17.3.1",

packages.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _CDK_ENTRY_POINTS = [
1717
"layout",
1818
"bidi",
1919
"portal",
20+
"private",
2021
]
2122

2223
_MATERIAL_ENTRY_POINTS = [

tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch

+26-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/@angular/bazel/src/ng_module/ng_module.bzl b/node_modules/@angular/bazel/src/ng_module/ng_module.bzl
2-
index 99d7f6d..3ea60ea 100755
2+
index 5e82bcb..3c239f8 100755
33
--- a/node_modules/@angular/bazel/src/ng_module/ng_module.bzl
44
+++ b/node_modules/@angular/bazel/src/ng_module/ng_module.bzl
55
@@ -18,6 +18,7 @@ load(
@@ -22,7 +22,7 @@ index 99d7f6d..3ea60ea 100755
2222

2323
if not ctx.attr.type_check and ctx.attr.strict_templates:
2424
fail("Cannot set type_check = False and strict_templates = True for ng_module()")
25-
@@ -359,11 +360,11 @@ def _compile_action(
25+
@@ -355,11 +356,11 @@ def _compile_action(
2626

2727
def _prodmode_compile_action(ctx, inputs, outputs, tsconfig_file, node_opts):
2828
outs = _expected_outs(ctx)
@@ -36,7 +36,7 @@ index 99d7f6d..3ea60ea 100755
3636
_compile_action(ctx, inputs, compile_action_outputs, tsconfig_file, node_opts, "devmode")
3737

3838
# Note: We need to define `label` and `srcs_files` as `tsc_wrapped` passes
39-
@@ -417,9 +418,13 @@ def _ng_module_impl(ctx):
39+
@@ -413,9 +414,13 @@ def _ng_module_impl(ctx):
4040
# and issue https://github.com/bazelbuild/rules_nodejs/issues/57 for more details.
4141
ts_providers["providers"].extend([
4242
js_module_info(
@@ -51,7 +51,7 @@ index 99d7f6d..3ea60ea 100755
5151
js_ecma_script_module_info(
5252
sources = ts_providers["typescript"]["es6_sources"],
5353
deps = ctx.attr.deps,
54-
@@ -435,7 +440,7 @@ def _ng_module_impl(ctx):
54+
@@ -431,7 +436,7 @@ def _ng_module_impl(ctx):
5555
package_name = ctx.attr.package_name,
5656
package_path = ctx.attr.package_path,
5757
path = path,
@@ -60,20 +60,33 @@ index 99d7f6d..3ea60ea 100755
6060
))
6161

6262
return ts_providers_dict_to_struct(ts_providers)
63+
diff --git a/node_modules/@angular/bazel/src/ng_package/packager.mjs b/node_modules/@angular/bazel/src/ng_package/packager.mjs
64+
index 7184fd9..ef3e508 100755
65+
--- a/node_modules/@angular/bazel/src/ng_package/packager.mjs
66+
+++ b/node_modules/@angular/bazel/src/ng_package/packager.mjs
67+
@@ -7,7 +7,7 @@
68+
*/
69+
import * as fs from 'fs';
70+
import * as path from 'path';
71+
-import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports';
72+
+import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports.mjs';
73+
/**
74+
* List of known `package.json` fields which provide information about
75+
* supported package formats and their associated entry paths.
6376
diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs
64-
index 8681a4c..e3b497a 100755
77+
index def2972..3de33ba 100755
6578
--- a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs
6679
+++ b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs
67-
@@ -13,7 +13,7 @@ import * as fs from 'fs';
80+
@@ -12,7 +12,7 @@ import tscw from '@bazel/concatjs/internal/tsc_wrapped/index.js';
81+
import * as fs from 'fs';
6882
import * as path from 'path';
69-
import * as tsickle from 'tsickle';
7083
import ts from 'typescript';
7184
-import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils';
7285
+import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils.mjs';
7386
// FIXME: we should be able to add the assets to the tsconfig so FileLoader
7487
// knows about them
7588
const NGC_ASSETS = /\.(css|html)$/;
76-
@@ -351,6 +351,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) {
89+
@@ -349,6 +349,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) {
7790
}
7891
return diagnostics;
7992
}
@@ -87,15 +100,15 @@ index 8681a4c..e3b497a 100755
87100
* @deprecated
88101
* Kept here just for compatibility with 1P tools. To be removed soon after 1P update.
89102
diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs
90-
index 3649c11..0f4af3c 100755
103+
index 8efba56..d420348 100755
91104
--- a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs
92105
+++ b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs
93106
@@ -5,7 +5,7 @@
94107
* Use of this source code is governed by an MIT-style license that can be
95-
* found in the LICENSE file at https://angular.io/license
108+
* found in the LICENSE file at https://angular.dev/license
96109
*/
97110
-import { main } from './index';
98111
+import { main } from './index.mjs';
99-
main(process.argv.slice(2)).then(exitCode => process.exitCode = exitCode).catch(e => {
100-
console.error(e);
101-
process.exitCode = 1;
112+
main(process.argv.slice(2))
113+
.then((exitCode) => (process.exitCode = exitCode))
114+
.catch((e) => {

0 commit comments

Comments
 (0)