refactor(@angular/build): eliminate circular dependencies in bundler context#33123
refactor(@angular/build): eliminate circular dependencies in bundler context#33123clydin wants to merge 1 commit intoangular:mainfrom
Conversation
2e6d8e7 to
33f014d
Compare
…context Relocate foundational bundler file types and creation utilities to a new, standalone module to resolve multiple recursive dependencies centered around the utilities implementation. By decoupling the core output file definitions from the heavier build contexts, the overall module graph is streamlined, ensuring cleaner isolation and enabling the removal of several longstanding circular paths from the package golden file.
33f014d to
aff4d52
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the build system by centralizing file-related types and utilities into a new file, bundler-files.ts. Specifically, it moves BuildOutputFile, BuildOutputFileType, InitialFileRecord, and the helper functions createOutputFile and convertOutputFile from their previous locations in bundler-context.ts and utils.ts. Additionally, SERVER_GENERATED_EXTERNALS has been moved to the server-rendering manifest utility. Review feedback identified critical issues in the new implementations of createOutputFile and convertOutputFile, where the file hash is not invalidated when contents are modified. This could lead to stale hashes and broken incremental builds. Suggestions were provided to consolidate the logic and ensure proper hash recomputation.
Relocate foundational bundler file types and creation utilities to a new, standalone module to resolve multiple recursive dependencies centered around the utilities implementation. By decoupling the core output file definitions from the heavier build contexts, the overall module graph is streamlined, ensuring cleaner isolation and enabling the removal of several longstanding circular paths from the package golden file.