Skip to content

Commit cb1e274

Browse files
authored
NIFI-15700, NIFI-15701, NIFI-15702, NIFI-15703: Upgrade Nx 22, Angular 21, NgRx 21, TypeScript (#11018)
Upgrade the nifi-frontend workspace to Nx 22.5.4, Angular 21.1.6, Angular Material/CDK 21.1.6, and NgRx 21.0.1. This combines the Nx, Angular, and NgRx upgrades as the Nx migration required all framework upgrades to land together. Key changes: - Nx 21 -> 22.5.4, Angular 20 -> 21.1.6, NgRx 20 -> 21.0.1 - TypeScript 5.9.2 -> 5.9.3, Jest 29 -> 30.3.0, Zone.js 0.15 -> 0.16.1 - Third-party upgrades: ngx-markdown 21, ngx-skeleton-loader 12, marked 17 - Fix @HostListener type signatures for Angular 21 stricter typing - Remove emitDecoratorMetadata (unused, all DI uses inject()) - Fix migration-introduced lint issues (prettier formatting, require -> import type) - Add eslint-disable for resizable component attribute selector - Add ng-mocks Angular 21 peer dep override - Remove redundant lodash-es override s
1 parent ff1473a commit cb1e274

41 files changed

Lines changed: 12944 additions & 17643 deletions

Some content is hidden

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

nifi-frontend/src/main/frontend/apps/nifi-jolt-transform-ui/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ const config: Config = {
4848
transformIgnorePatterns: []
4949
};
5050

51-
export default config;
51+
module.exports = config;

nifi-frontend/src/main/frontend/apps/nifi-jolt-transform-ui/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* limitations under the License.
1616
*/
1717

18+
import { provideZoneChangeDetection } from '@angular/core';
1819
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
1920

2021
import { AppModule } from './app/app.module';
2122

2223
platformBrowserDynamic()
23-
.bootstrapModule(AppModule)
24+
.bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] })
2425
.catch((err) => console.error(err));

nifi-frontend/src/main/frontend/apps/nifi-jolt-transform-ui/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"noPropertyAccessFromIndexSignature": true,
88
"noImplicitReturns": true,
99
"noFallthroughCasesInSwitch": true,
10-
"useDefineForClassFields": false
10+
"useDefineForClassFields": false,
11+
"module": "preserve",
12+
"moduleResolution": "bundler"
1113
},
1214
"angularCompilerOptions": {
1315
"enableI18nLegacyMessageIdFormat": false,
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
21
{
32
"extends": "./tsconfig.json",
43
"compilerOptions": {
54
"outDir": "../../out-tsc/spec",
65
"types": ["jest"],
7-
"module": "ES2022",
8-
"esModuleInterop": true
6+
"module": "preserve",
7+
"esModuleInterop": true,
8+
"moduleResolution": "bundler",
9+
"isolatedModules": true
910
},
1011
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
1112
}

nifi-frontend/src/main/frontend/apps/nifi-registry/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
export default {
18+
module.exports = {
1919
displayName: 'NiFi Registry',
2020
clearMocks: true,
2121
coverageDirectory: '../../coverage/apps/nifi-registry',

nifi-frontend/src/main/frontend/apps/nifi-registry/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* limitations under the License.
1616
*/
1717

18+
import { provideZoneChangeDetection } from '@angular/core';
1819
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
1920

2021
import { AppModule } from './app/app.module';
2122

2223
platformBrowserDynamic()
23-
.bootstrapModule(AppModule)
24+
.bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] })
2425
.catch((err) => console.error(err));

nifi-frontend/src/main/frontend/apps/nifi-registry/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"noPropertyAccessFromIndexSignature": true,
88
"noImplicitReturns": true,
99
"noFallthroughCasesInSwitch": true,
10-
"useDefineForClassFields": false
10+
"useDefineForClassFields": false,
11+
"module": "preserve",
12+
"moduleResolution": "bundler"
1113
},
1214
"extends": "../../tsconfig.base.json",
1315
"angularCompilerOptions": {
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
21
{
32
"extends": "./tsconfig.json",
43
"compilerOptions": {
54
"outDir": "../../out-tsc/spec",
65
"types": ["jest"],
7-
"module": "ES2022",
8-
"esModuleInterop": true
6+
"module": "preserve",
7+
"esModuleInterop": true,
8+
"moduleResolution": "bundler",
9+
"isolatedModules": true
910
},
1011
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
1112
}

nifi-frontend/src/main/frontend/apps/nifi/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ const config: Config = {
4848
transformIgnorePatterns: []
4949
};
5050

51-
export default config;
51+
module.exports = config;

nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/canvas.component.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ export class Canvas implements OnInit, OnDestroy {
648648
this.canvasView.destroy();
649649
}
650650

651-
private processKeyboardEvents(event: KeyboardEvent | ClipboardEvent): boolean {
651+
private processKeyboardEvents(event: Event): boolean {
652652
const source = event.target as any;
653653
let searchFieldIsEventSource = false;
654654
if (source) {
@@ -658,7 +658,7 @@ export class Canvas implements OnInit, OnDestroy {
658658
return this.dialog.openDialogs.length === 0 && !searchFieldIsEventSource;
659659
}
660660

661-
private executeAction(actionId: string, event: KeyboardEvent, bypassCondition?: boolean): boolean {
661+
private executeAction(actionId: string, event: Event, bypassCondition?: boolean): boolean {
662662
if (this.processKeyboardEvents(event)) {
663663
const selection = this.canvasUtils.getSelection();
664664
const canvasAction = this.canvasActionsService.getAction(actionId);
@@ -672,37 +672,39 @@ export class Canvas implements OnInit, OnDestroy {
672672
return false;
673673
}
674674

675+
// Typed as Event (not KeyboardEvent) because Angular 21's typeCheckHostBindings
676+
// infers $event as Event for key-specific bindings (angular/angular#40778).
675677
@HostListener('window:keydown.delete', ['$event'])
676-
handleKeyDownDelete(event: KeyboardEvent) {
678+
handleKeyDownDelete(event: Event) {
677679
this.executeAction('delete', event);
678680
}
679681

680682
@HostListener('window:keydown.backspace', ['$event'])
681-
handleKeyDownBackspace(event: KeyboardEvent) {
683+
handleKeyDownBackspace(event: Event) {
682684
this.executeAction('delete', event);
683685
}
684686

685687
@HostListener('window:keydown.control.r', ['$event'])
686-
handleKeyDownCtrlR(event: KeyboardEvent) {
688+
handleKeyDownCtrlR(event: Event) {
687689
if (this.executeAction('refresh', event, true)) {
688690
event.preventDefault();
689691
}
690692
}
691693

692694
@HostListener('window:keydown.meta.r', ['$event'])
693-
handleKeyDownMetaR(event: KeyboardEvent) {
695+
handleKeyDownMetaR(event: Event) {
694696
if (this.executeAction('refresh', event, true)) {
695697
event.preventDefault();
696698
}
697699
}
698700

699701
@HostListener('window:keydown.escape', ['$event'])
700-
handleKeyDownEsc(event: KeyboardEvent) {
702+
handleKeyDownEsc(event: Event) {
701703
this.executeAction('leaveGroup', event);
702704
}
703705

704706
@HostListener('window:keydown.control.c', ['$event'])
705-
handleKeyDownCtrlC(event: KeyboardEvent) {
707+
handleKeyDownCtrlC(event: Event) {
706708
if (!this.canvasUtils.isClipboardAvailable()) {
707709
return;
708710
}
@@ -713,20 +715,20 @@ export class Canvas implements OnInit, OnDestroy {
713715
}
714716

715717
@HostListener('window:keydown.meta.c', ['$event'])
716-
handleKeyDownMetaC(event: KeyboardEvent) {
718+
handleKeyDownMetaC(event: Event) {
717719
if (this.executeAction('copy', event)) {
718720
event.preventDefault();
719721
}
720722
}
721723

722724
@HostListener('window:paste', ['$event'])
723-
handlePasteEvent(event: ClipboardEvent) {
725+
handlePasteEvent(event: Event) {
724726
if (!this.processKeyboardEvents(event) || !this.canvasUtils.isPastable()) {
725727
// don't attempt to paste flow content
726728
return;
727729
}
728730

729-
const textToPaste = event.clipboardData?.getData('text/plain');
731+
const textToPaste = (event as ClipboardEvent).clipboardData?.getData('text/plain');
730732
if (textToPaste) {
731733
const copyResponse: CopyResponseEntity | null = this.toCopyResponseEntity(textToPaste);
732734
if (copyResponse) {
@@ -743,14 +745,14 @@ export class Canvas implements OnInit, OnDestroy {
743745
}
744746

745747
@HostListener('window:keydown.control.a', ['$event'])
746-
handleKeyDownCtrlA(event: KeyboardEvent) {
748+
handleKeyDownCtrlA(event: Event) {
747749
if (this.executeAction('selectAll', event)) {
748750
event.preventDefault();
749751
}
750752
}
751753

752754
@HostListener('window:keydown.meta.a', ['$event'])
753-
handleKeyDownMetaA(event: KeyboardEvent) {
755+
handleKeyDownMetaA(event: Event) {
754756
if (this.executeAction('selectAll', event)) {
755757
event.preventDefault();
756758
}

0 commit comments

Comments
 (0)