-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
fix(vite-plugin-angular): extract templateUrl
s using AST
#887
fix(vite-plugin-angular): extract templateUrl
s using AST
#887
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-ng-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
.getDescendantsOfKind(SyntaxKind.PropertyAssignment) | ||
.filter((property) => property.getName() === 'templateUrl') | ||
.map((property) => | ||
property.getInitializer()?.getText().replace(/['"]/g, '') |
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.
Does this handle this use case for the templateUrl
if they use templateUrl: '[param].component.html'
?
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.
Yeah, this gets the property value as-is from the object. The replace is to remove the string delimiters which are part of it.
I can add a unit test for it
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.
If you're referring to the scenario in that issue linked, that's regarding styleUrl
s. I only modified the templateUrl resolver here
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the current behavior?
Closes #797
What is the new behavior?
Uses AST instead of string matching/replacement to parse
templateUrl
sDoes this PR introduce a breaking change?
Other information
[optional] What gif best describes this PR or how it makes you feel?