Repository navigation
perf(@angular/build): overlap library asset resolution with bundling and disk emission - #34424
Draft
alan-agius4 wants to merge 3 commits into
Draft
alan-agius4 wants to merge 3 commits into
alan-agius4 wants to merge 3 commits into
Conversation
…e output mkdir calls
- Start `buildState.collectAssets(options, modifiedFiles)` before `compileLibrary` so asset globbing overlaps with TypeScript/Angular compilation, Rolldown bundling, and manifest generation.
- Execute `deleteFilesFromDisk` and `emitFilesToDisk` concurrently via `Promise.all` since deleted and emitted paths are disjoint.
- Cache ancestor directory promises created by `mkdir(..., { recursive: true })` in `emitFilesToDisk` so parent directories (such as `outputPath`) do not incur redundant `mkdir` syscalls when subdirectories (`fesm2022`, `types`) are created first.
- Return early when `result.hasErrors` is true before adding `bundleOutput.warnings` so secondary bundler warnings are not logged alongside compilation errors.
- Include `options.packageJsonPath` in the error message when `verifyAllowedDependencies` fails.
…uplicate output mkdir calls
…uplicate output mkdir calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
collectedAssets ?? buildState.collectAssets(options, modifiedFiles)insidePromise.allalongsidebundleEntryPointsanddiagnosePromise, overlappinglstatandtinyglobbyasset resolution with Rolldown's native Rust bundling threads (bundleAllEsm/bundleAllDts) and worker-thread diagnostics (diagnosePromise) while the main Node.js event loop andlibuvthreadpool are idle.collectAssetsbeforecompileLibrarypreviously contended withParallelCompilation's 100+stylesheetChannelIPC round-trips andesbuild/SassWorkerPooldispatches on the main thread andlibuvthreadpool.deleteFilesFromDiskbefore emitting new files withemitFilesToDiskso case-only renames or overlapping paths on case-insensitive filesystems never delete newly emitted files.if (result.hasErrors) { return result; }beforeresult.addWarnings(bundleOutput.warnings)to suppress secondary bundler warnings when TypeScript compilation has errors.options.packageJsonPathin the disallowed dependency error message inverifyAllowedDependencies.Benchmark
main