Skip to content

Migrate to new angular builder (esbuild)#564

Open
sawankshrma wants to merge 23 commits into
devsecopsmaturitymodel:gsoc2026from
sawankshrma:new-angular-builder
Open

Migrate to new angular builder (esbuild)#564
sawankshrma wants to merge 23 commits into
devsecopsmaturitymodel:gsoc2026from
sawankshrma:new-angular-builder

Conversation

@sawankshrma
Copy link
Copy Markdown
Collaborator

@sawankshrma sawankshrma commented Jun 7, 2026

Migrates the build system from the legacy webpack-based browser builder
to the esbuild-based application builder introduced in Angular 17.

Changes:

  • Switch builder to @angular-devkit/build-angular:application.

  • Fix markdown-it namespace imports → default imports across 4 files:
    esbuild handles import * as a true namespace object, calling it as a function crashes at runtime unlike webpack.

  • Enable esModuleInterop in tsconfig.json. Required for the default
    import fix to compile; aligns TypeScript's module interop with the
    ECMAScript spec

  • Convert polyfills from a file reference to an explicit array:
    The application builder no longer accepts a single .ts file as polyfills entry point; entries are declared directly in angular.json

  • Remove src/polyfills.ts and its tsconfig.app.json reference.

  • Remove webpack-only options buildOptimizer and vendorChunk.

  • Remove @grafana/faro-webpack-plugin (webpack-specific plugin)

  • Flatten output path to dist/dsomm/ via outputPath.browser: ""
    The new builder defaults to dist/dsomm/browser/ which would break the existing deploy pipeline

Result: Build time drops from ~104s to ~10s.

This PR is stacked on top of #563 . It'd be easier to review this one after merging pr#563

wrap mat-icon in span with matListItemIcon to prevent MDC from overriding color=primary. After upgrading to Material 16, the icons became grey from the primary color they were
The --prod flag was deprecated in Angular CLI v12 and removed in later versions. Replaced with --configuration=production and dropped redundant --aot flag (AOT is default for production builds).
Removed eslint-config-standard-with-typescript and its peer deps (eslint-plugin-import, eslint-plugin-n, eslint-plugin-promise) — these were never referenced in .eslintrc.json and caused ERESOLVE peer dependency conflicts during the Angular 17 upgrade, as they pulled in incompatible ESLint/TypeScript version constraints that clashed with @angular-eslint v17. Also bumped eslint-config-prettier from ^8.5.0 to pinned 9.1.0 (v8.10.1 and v9.1.1 were compromised in a July 2025 supply chain attack), eslint-plugin-prettier to ^5.2.0, and prettier to ^3.3.0.
RouterTestingModule was deprecated in Angular v17 in favor of the standalone provideRouter() API.
moved MatChip from declarations to imports in circular-heatmap spec, since MatChip is now a standalone component in Angular Material 17 and cannot appear in declarations.
Ran ng lint --fix after bumping prettier from v2 to v3.
Angular 17 requires Node ≥18.13.0. Bump actions/checkout and actions/setup-node from v1 to v4 (v1 runs on deprecated Node 12).
No need to call ActivitiesBeingDisplayed every time the filter is changed as dataSource is a computed() value now which depends on other signal() values - levels, filtersTag and filtersDim
Consumers (AppComponent & SidNavButtonsCompoent) now use computed() values rather than subscribing to observables from these Services.
Switch from webpack-based browser builder to esbuild-based application builder. Fix markdown-it default imports, enable esModuleInterop, update polyfills to array format, remove webpack-only options (buildOptimizer, vendorChunk), remove polyfills.ts, and flatten output path to dist/dsomm/.
caused the duplicate color styles warning surfaced by the esbuild builder during ng serve
Copy link
Copy Markdown
Collaborator

@vbakke vbakke left a comment

Choose a reason for hiding this comment

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

Apart from my one comment, I do not have anything more to add.

Approved. :)

Comment thread package.json
"prettier-eslint": "^16.3.0",
"qs": "^6.11.0",
"typescript": "^4.8.0"
"typescript": "^5.4.5"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"typescript": "^5.4.5"
"typescript": "~5.4.5"

This is not important. And has been part of DSOMM for a while. (I.e. it was not introduced now.) This is more of a comment for to something we should look into as we progress.

The ^5.4.5 installed v5.9.3 on my machine (when using pnpm). But Angular 17.3.x requires TypeScript >=5.2 <5.5, causing the build to fail.

As we will move away from Angular 17 on next phase this should be fine. But we should probably pay attention to what typescript version is supported on each phase. :)


Also, we should look into supporting pnpm and yarn by the time we finish the upgrade.

  • pnpm has a huge disk benefit for developers, while
  • yarn apparently has some benefits in CICD pipeline
    : )

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