Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Dec 12, 2025

Proposed Changes

This pull request updates the build configuration and proxy setup for the dotcms-ui Angular application, improving compatibility with the Angular CLI, enhancing development server behavior, and refining TypeScript settings. The most significant changes are grouped below.

Build and Angular CLI migration:

  • Switched the build executor in project.json from @nx/angular:browser-esbuild to @angular-devkit/build-angular:application for better Angular CLI compatibility and future-proofing. Updated related build options, including the use of browser and polyfills arrays, and added inlineStyleLanguage: "scss".
  • Adjusted build and development configurations: set baseHref to /dotAdmin/ for development, added externalDependencies, and refined output and optimization options.
  • Moved tags and implicitDependencies to the end of project.json to align with Nx conventions.

Development server and proxy improvements:

  • Enhanced the proxy configuration in proxy-dev.conf.mjs by adding a dedicated WebSocket proxy for /api/ws requests, explicitly disabling WebSocket proxying for the main API proxy to avoid EPIPE errors, and adding /image to the proxied contexts. [1] [2]
  • Enabled Hot Module Replacement (hmr), continuous watch, and disabled live reload in the serve target for a better development experience.

TypeScript and Nx configuration:

  • Updated TypeScript config (tsconfig.app.json and tsconfig.json) to explicitly set module to es2022, enable esModuleInterop, use incremental builds, and resolve package exports for improved build performance and compatibility. [1] [2]
  • Increased Nx task runner parallelism from 1 to 3 for faster builds, and added a serve section in nx.json with an empty dependsOn array. [1] [2]

📊 Performance Comparison

Metric 🐢 Before (Webpack) ⚡️ After (Esbuild) Improvement
Initial Bundle 16.37 MB 2.14 MB ⬇ 87% Smaller
Dead Code 13.73 MB (Vendor.js) 0 MB Eliminated
Cold Start ~25s ~15s 40% Faster
Rebuild (HMR) ~5.6s < 1s Instant
Console Logs Thousands of warnings Clean Fixed

Screenshots

Original Updated
** original screenshot ** ** updated screenshot **

This PR fixes: #34098

This PR fixes: #34098

@semgrep-code-dotcms-test
Copy link

Legal Risk

The following dependencies were released under a license that
has been flagged by your organization for consideration.

Recommendation

While merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue.

GPL-2.0

MPL-2.0

@nicobytes nicobytes marked this pull request as ready for review December 12, 2025 23:09
@nicobytes nicobytes requested a review from Copilot December 12, 2025 23:09
Copy link
Contributor

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 build system by migrating from Nx's legacy browser-esbuild executor to Angular CLI's newer application builder, delivering significant performance improvements (87% smaller bundles, 40% faster cold starts, instant HMR rebuilds). The changes also enhance the development server configuration with proper WebSocket handling and optimize build settings.

Key Changes:

  • Migrated build executor from @nx/angular:browser-esbuild to @angular-devkit/build-angular:application with updated configuration options
  • Added dedicated WebSocket proxy configuration to prevent EPIPE errors and improved proxy routing with /image context
  • Enhanced TypeScript configuration with ES2022 modules, incremental builds, and package exports resolution
  • Increased Nx task parallelism from 1 to 3 and enabled HMR for faster development

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
core-web/yarn.lock Updated transitive dependencies including @bufbuild/protobuf patch version and lodash utilities
core-web/nx.json Increased task runner parallelism to 3 and added global serve configuration
core-web/apps/dotcms-ui/tsconfig.json Added esModuleInterop for better module compatibility
core-web/apps/dotcms-ui/tsconfig.app.json Enhanced with ES2022 module system, incremental builds, and package exports resolution
core-web/apps/dotcms-ui/proxy-dev.conf.mjs Separated WebSocket proxy configuration, disabled WS on HTTP proxy to prevent errors, added /image route
core-web/apps/dotcms-ui/project.json Migrated to application builder, removed deprecated options (vendorChunk, buildOptimizer, deployUrl), updated serve configuration with HMR and removed explicit webcomponents dependency

…nd clean up tsconfig.json by removing skipLibCheck option
…d-to-the-new-application-builder' of github.com:dotCMS/core into 34098-task-migrate-angular-projects-from-browser-esbuild-to-the-new-application-builder
@nicobytes nicobytes requested a review from fmontes December 15, 2025 19:38
@nicobytes nicobytes enabled auto-merge December 15, 2025 19:39
@nicobytes nicobytes added this pull request to the merge queue Dec 15, 2025
Merged via the queue into main with commit 6771f7e Dec 15, 2025
39 checks passed
@nicobytes nicobytes deleted the 34098-task-migrate-angular-projects-from-browser-esbuild-to-the-new-application-builder branch December 15, 2025 22:25
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.

[TASK] Migrate Angular projects from browser-esbuild to the new Application Builder

5 participants