Skip to content

Conversation

@eksrha
Copy link
Member

@eksrha eksrha commented Oct 18, 2025

This pull request modernizes the Angular workspace by upgrading to Angular v20 and adopting the latest framework features, along with updating project dependencies and code style to align with current Angular best practices. It also improves code maintainability and performance by leveraging standalone components, signals for state management, and new control flow syntax. Additionally, it updates project configuration files to use new Angular builders and enhances developer guidance with a comprehensive Copilot instructions file.

Framework and Dependency Upgrades:

  • Upgraded all Angular dependencies (core, material, cdk, etc.), devDependencies, and related libraries in package.json to v20.x, ensuring compatibility with Angular 20 features and APIs.
  • Updated Angular CLI and build tooling, replacing @angular-devkit/build-angular with the new @angular/build package in angular.json and adjusting builder references for build, test, serve, and extract-i18n targets. [1] [2] [3] [4] [5]

Adoption of Modern Angular Features:

  • Refactored components to use standalone imports (e.g., FsNavFrameComponent, FsCalendarPanelsComponent), signals for state management, and new control flow syntax (@for, @if) in templates, replacing legacy constructs like *ngFor and *ngIf. [1] [2] [3] [4] [5]
  • Applied ChangeDetectionStrategy.OnPush to all major components to optimize change detection and improve performance. [1] [2] [3] [4]

Configuration and Tooling Enhancements:

  • Added configuration for Angular schematics in angular.json to specify type handling for components, directives, services, guards, interceptors, modules, pipes, and resolvers, improving code generation consistency.
  • Simplified karma.conf.js by removing the now-unnecessary @angular-devkit/build-angular/plugins/karma plugin, reflecting the new Angular build system.

Developer Guidance and Best Practices:

  • Introduced a new .github/copilot-instructions.md file detailing modern Angular best practices, coding style, package management (favoring yarn), and usage examples for signals, standalone components, and new template control flow.

Code Quality and Maintainability:

  • Refactored imports and module usage to prefer importing only necessary standalone components and directives, reducing bundle size and improving clarity. [1] [2] [3] [4]
  • Updated user profile logic to use signals and service injection, improving state management and aligning with new Angular paradigms. [1] [2]

These changes collectively bring the codebase up to date with Angular 20, streamline development workflows, and ensure adherence to the latest Angular recommendations and best practices.

Copilot AI review requested due to automatic review settings October 18, 2025 19:57
@github-actions
Copy link

Possible awesome-ci commands for this Pull Request
command description
aci_patch_level: major create a major version bump
aci_version_override: 2.1.0 set the version to 2.1.0 using only semver compatible syntax!

Need more help?

Have a look at my repo

This message was created by awesome-ci and can be disabled by the env variable ACI_SILENT=true

@eksrha eksrha merged commit 44aafef into main Oct 18, 2025
2 checks passed
@eksrha eksrha deleted the major/ng-20-update branch October 18, 2025 20:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Upgrade to Angular v20 with adoption of standalone components, signals, and modern template control flow, plus configuration/tooling updates and documentation refresh.

  • Replace NgModules with standalone component composition across the library and workspace
  • Migrate state and event flows to signals/computed/effect; introduce accessibility improvements
  • Update builders (angular.json), dependencies (package.json), and testing configs (karma)

Reviewed Changes

Copilot reviewed 47 out of 50 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
projects/ngx-mat-components/styles/fs-calendar/_theming.scss Switch MDC card CSS vars to Material v20 card vars for month container styling
projects/ngx-mat-components/src/fs-theme-menu/fs-theme-menu.ts Refactor to signals; DOM updates via DOCUMENT; OnPush; input/output signals
projects/ngx-mat-components/src/fs-theme-menu/fs-theme-menu.scss Minor whitespace cleanup
projects/ngx-mat-components/src/fs-theme-menu/fs-theme-menu.html Add ARIA labels and menu semantics
projects/ngx-mat-components/src/fs-theme-menu/fs-theme-icon/fs-theme-icon.ts Convert to input() and OnPush
projects/ngx-mat-components/src/fs-theme-menu/fs-theme-icon/fs-theme-icon.html Adjust template to call input signal
projects/ngx-mat-components/src/fs-theme-menu/fs-check-svg.ts Convert to input() and OnPush; use new control flow
projects/ngx-mat-components/src/fs-nav-frame/services/fs-nav-frame.service.ts Replace EventEmitters with signals; expose readonly state and actions
projects/ngx-mat-components/src/fs-nav-frame/public-api.ts Remove module export; export service
projects/ngx-mat-components/src/fs-nav-frame/nav-frame-toolbar/fs-nav-frame-toolbar.component.ts Signals-based open state; NgTemplateOutlet in imports; OnPush
projects/ngx-mat-components/src/fs-nav-frame/nav-frame-toolbar/directives/* Remove standalone: false flags
projects/ngx-mat-components/src/fs-nav-frame/fs-nav-user-profile/fs-nav-user-profile.component.ts Convert inputs/outputs to signals; OnPush
projects/ngx-mat-components/src/fs-nav-frame/fs-nav-user-profile/fs-nav-user-profile.component.html New control flow and bindings; ARIA
projects/ngx-mat-components/src/fs-nav-frame/fs-nav-frame.module.ts Remove NgModule (migrating to standalone)
projects/ngx-mat-components/src/fs-nav-frame/fs-nav-frame.component.ts Signals-based sizing/menu state; OnPush; providers; effects
projects/ngx-mat-components/src/fs-nav-frame/fs-nav-frame.component.html New control flow; bindings updated to signal APIs; ARIA
projects/ngx-mat-components/src/fs-nav-frame/directives/fs-nav-frame-content.directive.ts Remove standalone: false flag
projects/ngx-mat-components/src/fs-nav-frame/components/fs-nav-frame-sidebar-item/* Convert to input signals; routerLink/ARIA support; OnPush
projects/ngx-mat-components/src/fs-calendar/public-api.ts Remove module export
projects/ngx-mat-components/src/fs-calendar/fs-calendar.module.ts Remove NgModule (migrating to standalone)
projects/ngx-mat-components/src/fs-calendar/directives/fs-calendar-table-name.directive.ts Remove standalone: false flag
projects/ngx-mat-components/src/fs-calendar/calendar-table/* Signals for inputs/state; new control flow; OnPush
projects/ngx-mat-components/src/fs-calendar/calendar-panels/* Signals for inputs/selection; computed calendar; new control flow; OnPush
projects/ngx-mat-components/karma.conf.js Drop @Angular-devkit plugin; align with new builder
projects/lib-workspace/src/app/services/mockuser.service.ts Add signal-based mock user service
projects/lib-workspace/src/app/content/showcase-nav-frame/* OnPush; demo imports updated to standalone usage
projects/lib-workspace/src/app/content/showcase-calendar-table/* OnPush; demo imports updated to standalone usage
projects/lib-workspace/src/app/content/showcase-calendar-panels/* OnPush; demo imports updated to standalone usage and templates updated
projects/lib-workspace/src/app/content/home/home.component.ts OnPush
projects/lib-workspace/src/app/app.ts Switch to importing standalone components; OnPush; inject mock user service
projects/lib-workspace/src/app/app.html Update templates to @for/@if; ARIA; profile bindings
projects/lib-workspace/karma.conf.js Drop @Angular-devkit plugin; align with new builder
package.json Upgrade Angular/material and tooling to v20; update other deps
docs/theme-menu.md Rewrite to “standalone component” docs with accessibility and theming notes
docs/fs-nav-frame.md Rewrite to “standalone” docs with API and examples
docs/calendar.md Rewrite calendar docs to modernized APIs and usage
angular.json Migrate builders to @angular/build; add schematics defaults
.github/copilot-instructions.md Add project-wide Copilot guidelines favoring signals and standalone

Comment on lines 7 to 18
@Component({
selector: 'fs-nav-frame',
imports: [MatButtonModule],
templateUrl: './fs-nav-frame.component.html',
styleUrls: ['./fs-nav-frame.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [FsNavFrameService],
host: {
class: 'fs-nav-frame',
'data-component-id': 'fs-nav-frame-unique',
},
standalone: false,
})
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component uses the imports array and the NgModule was removed, but standalone: true is not set. Without standalone: true (or declaration in an NgModule), the component cannot be imported/used in other components and the app will fail to compile. Add standalone: true here (and in all other library components/directives now intended for standalone usage).

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 17
@Component({
selector: 'fs-calendar-table',
imports: [MatButtonModule],
templateUrl: './fs-calendar-table.component.html',
styleUrls: ['./fs-calendar-table.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
class: 'fs-calendar-table mat-mdc-card mdc-card mat-mdc-card-outlined mdc-card--outlined',
'data-component-id': 'fs-calendar-table-unique',
},
standalone: false,
})
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is intended to be used standalone (imports is used and FsCalendarModule was removed) but standalone: true is not provided. Add standalone: true to the @component metadata.

Copilot uses AI. Check for mistakes.
Comment on lines 5 to 17
@Component({
selector: 'fs-nav-frame-toolbar',
imports: [NgTemplateOutlet],
templateUrl: './fs-nav-frame-toolbar.component.html',
styleUrls: ['./fs-nav-frame-toolbar.component.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
class: 'fs-nav-frame-toolbar',
'data-component-id': 'fs-nav-frame-toolbar-unique',
'[class.opened]': 'isOpened()',
},
standalone: false,
})
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component uses imports and is consumed as a standalone dependency, but standalone: true is missing. Add standalone: true to avoid compilation/runtime errors.

Copilot uses AI. Check for mistakes.
private profileContentElement: HTMLElement | null = null;

// Computed from service
protected readonly isClosed = computed(() => this.frameService.isMenuClosed());
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isClosed wraps the signal function instead of its value. computed(() => this.frameService.isMenuClosed()) returns the signal function, so isClosed() in the template will be truthy and the UI will never open. Use the service's signal directly or call it: either assign isClosed = this.frameService.isMenuClosed; or computed(() => this.frameService.isMenuClosed()).

Suggested change
protected readonly isClosed = computed(() => this.frameService.isMenuClosed());
protected readonly isClosed = this.frameService.isMenuClosed;

Copilot uses AI. Check for mistakes.
body = document.querySelector('body');
profileContentElement!: HTMLElement | null;
isClosed: boolean = true;
private readonly body = document.querySelector('body');
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing document at property initialization breaks on SSR and during hydration. Inject DOCUMENT and only access body in a browser-safe context (e.g., in ngAfterViewInit or by checking isPlatformBrowser), then move the style updates there or guard inside the effect.

Copilot uses AI. Check for mistakes.
Comment on lines 36 to +40
constructor(
private elementRef: ElementRef,
private frameService: FsNavFrameService,
protected frameService: FsNavFrameService,
private titleService: Title
) {}
) {
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

titleService is no longer used in this component after the refactor. Remove the Title import and constructor parameter to avoid dead code.

Copilot uses AI. Check for mistakes.
Import the component directly:

```typescript
import { FsThemeMenuComponent } from '@fullstack-devops/ngx-mat-components';
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs reference FsThemeMenuComponent and a fs-theme-menu.component.ts path, but the code exports FsThemeMenu from fs-theme-menu.ts. Update the component name and path in the documentation to match the actual exported API.

Copilot uses AI. Check for mistakes.
## Component

- [`FsThemeMenu`](../projects/ngx-mat-components/src/fs-theme-menu/fs-theme-menu.ts)
- [`FsThemeMenuComponent`](../projects/ngx-mat-components/src/fs-theme-menu/fs-theme-menu.component.ts) - Theme switcher menu
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs reference FsThemeMenuComponent and a fs-theme-menu.component.ts path, but the code exports FsThemeMenu from fs-theme-menu.ts. Update the component name and path in the documentation to match the actual exported API.

Copilot uses AI. Check for mistakes.
@include fsc.core();
```
toggleSidebar() {
this.navFrameService.toggleOpened();
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service API uses switchMenuState(), openMenu(), and changeMenuStateToClosed(), not toggleOpened(). Update the example to use switchMenuState() (or add a toggle method to the service to match the docs).

Suggested change
this.navFrameService.toggleOpened();
this.navFrameService.switchMenuState();

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +32
FsCalendarTableComponent,
CalendarDay,
DayStatus
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs introduce CalendarDay and DayStatus types that are not exported by the library. Either: (a) implement and export these types, and update components to accept them; or (b) update the docs to reflect the current public API (CalendarPanels/CalendarExtendedDay/CalendarEvent).

Suggested change
FsCalendarTableComponent,
CalendarDay,
DayStatus
FsCalendarTableComponent

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants