-
Notifications
You must be signed in to change notification settings - Fork 11.9k
refactor(@angular/build): provide file dependencies map on compilation initialize result #31728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
clydin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution.
Overall the change looks good.
Only concern, since this is an externally usable API, is the fileDependencies name. It may be overly broad of a term here since it's only the external resource files for the components in a given source file and not all the dependencies of a given file.
31bcbf5 to
ff3d40a
Compare
|
@Deku-nattsu, since this is a feature for a private API, and shouldn’t be part of the changelog maybe we can use a refactor type instead of a feat? |
ff3d40a to
d8e72b8
Compare
|
@alan-agius4 sure thing. any suggestions on the property name? |
|
@Deku-nattsu, some ideas |
…p on compilation initialize results
d8e72b8 to
7212b97
Compare
|
@alan-agius4 done. |
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.