scottyaslan commented on code in PR #8053: URL: https://github.com/apache/nifi/pull/8053#discussion_r1407950728
########## nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/loading.service.ts: ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Injectable } from '@angular/core'; +import { BehaviorSubject, delay, Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class LoadingService { + status$: Observable<boolean>; + + loading: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); Review Comment: @mcgilman, huge thanks for your contribution with this PR! It's fantastic to witness the community coming together to enhance the UI. I noticed that you're incorporating rxjs and leveraging Angular 16+—great choices! I wanted to share a resource with you that delves into a new feature of Angular 16, which I believe could significantly benefit our UI modernization efforts: [Link to the video](https://www.youtube.com/watch?v=iA6iyoantuo). In my opinion, Angular signals bring a more developer-friendly approach to the table: - Using signals helps avoid various pitfalls associated with an exclusive rxjs approach, making it easier for new developers to contribute to Nifi. Issues like the diamond problem, hot/cold observables, multiple change detection cycles for transitional states, and debugging complex combinations of observable streams can be alleviated. - Signal syntax is more concise, and allows for the removal of the necessity to create private Subjects—followed by creating public Observables, each requiring an unsubscribe strategy—which reduces the overall amount of code in the codebase. - If we can eliminate rxjs entirely, it means fewer dependencies to maintain, reducing the potential for CVE and simplifying version upgrades. I'm eager to hear your thoughts and insights on this suggestion. While I haven't had the chance to use Angular signals extensively, I've been exploring opportunities to do so, and this situation seems particularly applicable. Looking forward to collaborating on this! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org