feat(@angular/build): provide file dependencies map on compilation initialize result #31728
+56
−45
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.
I am writing a rsbuild plugin that compiles angular, it uses the compilation classes underneath and thanks to the exposure of createAngularCompilation its been fairly smooth to implement.
however I’ve encountered a blocker when wiring up a dev server that correctly associates component TypeScript files with their html template resources. for this a dependency map is needed and that's what getResourceDependencies provides. but it isn’t publicly accessible from the compilation which is fair.
so right now, the only option seems to be creating a second Angular compiler instance in my plugin solely to access that API, which isn’t ideal. (i could be missing something?)
the PR change stores the dependencies map and returns it in initialization result which worked well in my case, but i am not sure if this is the right approach or what overhead it could introduce.