Skip to content

Conversation

@piyushsinghgaur1
Copy link

@piyushsinghgaur1 piyushsinghgaur1 commented Dec 31, 2025

This pull request introduces significant updates to modernize the Angular codebase, improve the build and packaging process, and enhance CI/CD workflows. The most notable changes include upgrading Angular and related dependencies to v19, refactoring the custom element bundling script for compatibility with new Angular output formats, updating build configurations, and improving test and workflow reliability.

Major dependency and build system upgrades:

  • Upgraded Angular framework and related dependencies (including @angular/*, @ng-select/ng-select, lerna, rxjs, zone.js, etc.) to version 19 in both package.json and projects/workflows-creator/package.json. This also includes devDependencies and TypeScript updates for compatibility. [1] F9c4fafeL9R10, [2] [3]
  • Updated angular.json to use the new Angular v19 builder (@angular-devkit/build-angular:application), revised build options for output compatibility, and updated schematic collections. [1] [2] [3]

Element bundling and packaging improvements:

  • Refactored bundle-element.ts to support the new Angular build output structure (with hashed chunk files), improved robustness by dynamically detecting output files, and ensured correct copying of styles and README. The hash calculation and package.json update logic were also improved.
  • Adjusted elementBuild and postbuild scripts in both root and package-level package.json files to use the new bundling approach and ensure correct working directories. [1] [2]

Continuous Integration and workflow enhancements:

  • Added a new GitHub Actions workflow (trivy.yml) to run Trivy security scans on pull requests targeting the master branch.
  • Updated existing GitHub Actions workflows to use newer action versions (actions/cache@v4), and changed npm ci steps to use --ignore-scripts for improved security and reproducibility. [1] [2] [3]

Code and test modernization:

  • Removed ngx-popperjs usage from builder tests and templates, replacing popper-based overlays with Angular CDK overlays for better compatibility and maintainability. Updated test mocks and input handling accordingly. [1] [2] [3] [4] [5]
  • Updated SCSS imports to use the Angular recommended @use syntax instead of @import.

Other improvements:

  • Added overrides in package.json to pin certain transitive dependencies for security and compatibility.

Dependency and Build System Upgrades

  • Upgraded all Angular-related dependencies and devDependencies to v19, including TypeScript and related tooling, in both root and project-level package.json files. [1] F9c4fafeL9R10, [2] [3]
  • Updated angular.json build and schematic configuration to match Angular v19 requirements and output structure. [1] [2] [3]

Element Bundling and Packaging

  • Refactored bundle-element.ts to dynamically detect and concatenate Angular build output files, supporting hashed filenames and copying assets robustly.
  • Updated build scripts to use the new bundling approach and ensure correct execution context. [1] [2]

CI/CD and Workflow Improvements

  • Added a Trivy security scan workflow for pull requests to master.
  • Updated GitHub Actions to use actions/cache@v4 and run npm ci --ignore-scripts for improved reliability. [1] [2] [3]

Code and Test Modernization

  • Replaced ngx-popperjs overlays with Angular CDK overlays in builder components and tests, and updated test mocks for new Angular versions. [1] [2] [3] [4] [5]
  • Updated SCSS to use the recommended @use syntax.

Security and Dependency Management

  • Added overrides in package.json to pin specific vulnerable or problematic transitive dependencies.

@github-actions
Copy link

==== Karma Test Coverage ====
Statements: 40.8% ( 774/1897 )
Branches : 19.22% ( 124 /645 )
Functions : 38.74% ( 160 /413 )
Lines : 41.48% ( 767 /1849 )

…and add trivy workflow

replace input output decorators with signal-based inputs and add trivy workflow

BREAKING CHANGE:
Yes

GH-97
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

==== Karma Test Coverage ====
Statements: 40.8% ( 774/1897 )
Branches : 19.22% ( 124 /645 )
Functions : 38.74% ( 160 /413 )
Lines : 41.48% ( 767 /1849 )

added sandbox and fix minor bugs

GH-97
@github-actions
Copy link

==== Karma Test Coverage ====
Statements: 40.82% ( 776/1901 )
Branches : 19.04% ( 124 /651 )
Functions : 38.88% ( 161 /414 )
Lines : 41.5% ( 769 /1853 )

@piyushsinghgaur1 piyushsinghgaur1 marked this pull request as ready for review January 20, 2026 06:08
Copy link

@rohit-sourcefuse rohit-sourcefuse left a comment

Choose a reason for hiding this comment

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

🎯 APPROVE WITH CHANGES - Excellent Angular 19 Migration

This is outstanding migration work that demonstrates deep understanding of Angular 19 patterns and modern best practices. The architectural improvements are substantial and well-executed. However, there are several critical issues that need fixing before merge.

Critical Issues (Must Fix):

1. 🔴 Duplicate ngClass Binding

File: projects/workflows-creator/src/lib/builder/group/group.component.html Line: 47

Remove the duplicate [ngClass] binding (Angular will only use the last one):

<workflow-node
  [ngClass]="{'last-node': i === group().children.length - 1}"
  [node]="node"
  [ngClass]="{'last-node': i === group().children.length - 1}"  <!-- REMOVE THIS -->
  [isLast]="i === group().children.length - 1"

2. 🔴 Memory Leak: Unmanaged Overlay Subscriptions

Files: builder.component.ts:459, group.component.ts:385,520

The backdrop click subscriptions will cause memory leaks:

// Current problematic code:
this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());

// Fix Option 1: Proper cleanup
private subscription?: Subscription;

ngOnDestroy() {
  this.subscription?.unsubscribe();
}

// Fix Option 2: Auto-complete
this.overlayRef.backdropClick().pipe(take(1)).subscribe(() => this.closeOverlay());

3. 🔴 Missing Trivy Configuration File

File: .github/workflows/trivy.yml Line: 29

The workflow references a non-existent config file:

trivy-config: "${{ github.workspace }}/trivy.yaml"  # File doesn't exist

Fix: Either add the trivy.yaml file or remove this line to use Trivy defaults.

4. 🔴 Unused Import Cleanup

File: group.component.spec.ts Line: 37

import {popper} from '@popperjs/core';  // Not used - remove this

Important Issues (Should Fix):

5. Missing OnDestroy Implementation

Both BuilderComponent and GroupComponent should implement OnDestroy:

export class BuilderComponent<E> implements OnInit, OnDestroy {
  ngOnDestroy(): void {
    this.closeOverlay();
  }
}

6. Effect Error Handling

File: builder.component.ts Lines: 98-127

Consider adding error handling to the signal effect:

effect(() => {
  try {
    // existing logic
  } catch (error) {
    console.error('Effect error in BuilderComponent:', error);
    // Handle gracefully - maybe reset state or show user error
  }
});

✅ Excellent Migration Highlights:

🎉 Perfect Signal Implementation:

  • Proper use of input(), input.required(), and output()
  • Clean migration from @Input/@Output decorators
  • Correct signal reactivity patterns

🎉 Outstanding Standalone Components:

  • Well-implemented with proper imports arrays
  • Clean removal of NgModule dependencies
  • Excellent provideWorkflowCreator() provider function

🎉 Solid CDK Integration:

  • Good migration from ngx-popperjs to Angular CDK overlays
  • Proper overlay positioning and management
  • Clean template updates

🎉 Modern Build System:

  • Correct Angular 19 builder configuration (@angular-devkit/build-angular:application)
  • Smart bundle-element.ts updates for hashed output files
  • Good CI/CD improvements with --ignore-scripts

🎉 Security & Dependencies:

  • Thoughtful dependency pinning with overrides
  • Good Trivy security scanning addition (once config is fixed)
  • Clean SCSS migration to @use syntax

Test Coverage Notes:

Consider adding tests for:

  • Signal effect behavior and error handling
  • Overlay subscription cleanup verification
  • Component destruction scenarios
  • Signal reactivity edge cases

Minor Cleanup:

  • Delete the empty workflow-builder.module.ts file entirely

Overall Assessment:

This migration showcases excellent Angular expertise. The architectural improvements are significant:

  • Clean separation with standalone components
  • Modern reactive patterns with signals
  • Better maintainability with CDK overlays
  • Improved build pipeline

Once the critical issues are addressed (especially memory leaks and duplicate bindings), this will be a stellar migration that sets a great foundation for Angular 19.

Great work on tackling such a comprehensive framework upgrade! 🚀

@rohit-sourcefuse
Copy link

rohit-sourcefuse commented Jan 20, 2026

📋 Quick Action Checklist

For faster resolution, here's a prioritized checklist of the critical fixes:

Priority 1 - Breaking Issues:

  • Remove duplicate [ngClass] in group.component.html line 47
  • Add trivy.yaml config file or remove reference in .github/workflows/trivy.yml line 29
  • Remove unused popper import from group.component.spec.ts line 37

Priority 2 - Memory Management:

  • Add OnDestroy to BuilderComponent and GroupComponent
  • Fix overlay subscription cleanup in builder.component.ts line 459
  • Fix overlay subscription cleanup in group.component.ts lines 385, 520

Priority 3 - Error Handling:

  • Add try-catch to signal effect in builder.component.ts lines 98-127
  • Add error handling to overlay disposal methods

Optional Cleanup:

  • Delete empty workflow-builder.module.ts file
  • Add tests for signal effects and overlay cleanup

The Priority 1 items will cause immediate build/runtime issues, so tackle those first. The memory management fixes (Priority 2) are critical for production stability.

Excellent work on this migration - these are just polish items on an otherwise outstanding Angular 19 upgrade! 🎯

Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove the extra comments

Copy link
Author

Choose a reason for hiding this comment

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

Done

@github-actions
Copy link

==== Karma Test Coverage ====
Statements: 40.99% ( 781/1905 )
Branches : 19.04% ( 124 /651 )
Functions : 39.66% ( 165 /416 )
Lines : 41.61% ( 774 /1860 )

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

This PR modernizes the Angular codebase by upgrading to Angular 19, refactoring components to use standalone architecture and signal-based inputs, replacing ngx-popperjs with Angular CDK overlays, and enhancing CI/CD workflows with security scanning and improved dependency management.

Changes:

  • Upgraded Angular and related dependencies to v19 with standalone component architecture and signal-based inputs/outputs
  • Replaced ngx-popperjs with Angular CDK overlay system for improved maintainability
  • Added Trivy security scanning workflow and updated CI/CD workflows to use --ignore-scripts flag
  • Refactored bundling script to handle new Angular build output structure with hashed filenames

Reviewed changes

Copilot reviewed 69 out of 85 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
workflow-sandbox/* New standalone Angular 19 sandbox application with modern configuration
web-component-sandbox/* Updated web component sandbox with zone.js patches and updated styling
projects/workflows-element/package.json Updated hash for rebuilt web component bundle
projects/workflows-creator/src/lib/builder/* Converted components to standalone with signal-based inputs, replaced popper with CDK overlays
projects/workflows-creator/src/lib/provide-workflow-creator.ts New provider function replacing WorkflowBuilderModule for Angular 19
projects/workflows-creator/src/zone-flags.ts Added zone.js configuration to fix hasOwnProperty errors
projects/workflows-creator/bundle-element.ts Refactored to handle Angular 19 hashed build outputs
package.json, angular.json Updated dependencies to Angular 19 and modernized build configuration
.github/workflows/* Added Trivy scan and updated workflows with security improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

new ValueInput(),
);
expect(component.tooltipText).toBe('Select a column first');
expect(component.tooltipText).toBe('selectColumnTooltip');
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The expected value changed from 'Select a column first' to 'selectColumnTooltip', which appears to be a localization key rather than the actual displayed text. This test should verify the localized output, not the key itself.

Copilot uses AI. Check for mistakes.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
const req: any = require as any;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Using double type assertion as any suppresses type checking. Consider defining a proper interface for the require context or using a more specific type guard to maintain type safety.

Copilot uses AI. Check for mistakes.
// resul in changing its hash, so the element will also be published

const file = '../workflows-element/dist/workflows-element.js';
const distBase = './projects/workflows-creator/dist/workflows-element';
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The base path is hardcoded. Consider extracting this and other paths to constants at the top of the file or accepting them as configuration to improve maintainability and reusability.

Copilot uses AI. Check for mistakes.
break;
case window.IntervalInput.identifier:
const timescale = TIMESCALE.find(
// brekets
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'brekets' to 'brackets'.

Suggested change
// brekets
// brackets

Copilot uses AI. Check for mistakes.
padding: 5px 0;
@media screen and (max-width: 480px) {
margin-bottom: -25px;
margin-bottom: 8px;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The margin-bottom value changed from -25px to 8px for mobile screens. Ensure this change is intentional and doesn't break the mobile layout, as the negative margin may have been used for specific spacing adjustments.

Suggested change
margin-bottom: 8px;
margin-bottom: -25px;

Copilot uses AI. Check for mistakes.
<div class="workflow-group">
<div class="workflow-group-content">
<span *ngIf="!isFirst"> {{ group.name }} </span>
<span *ngIf="!isFirst() && group().children.length > 0">
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The condition now includes && group().children.length > 0, which prevents showing the group name when there are no children. Verify this is the intended behavior change and that it doesn't hide necessary labels in the UI.

Suggested change
<span *ngIf="!isFirst() && group().children.length > 0">
<span *ngIf="!isFirst()">

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to Angular 19, Remove Vulnerabilities, and Migrate to Signals & Standalone Components

4 participants