-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
feat(ivy): support inline <style> and <link> tags in components #28997
Conversation
As part of this PR, could you please enable the |
5b02ae3
to
a891a1d
Compare
Angular supports using <style> and <link> tags inline in component templates, but previously such tags were not implemented within the ngtsc compiler. This commit introduces that support. FW-1069 #resolve
a891a1d
to
8c0f040
Compare
@@ -319,7 +317,10 @@ function getE2eSpecs(basePath, filter) { | |||
// Find all e2e specs in a given example folder. | |||
function getE2eSpecsFor(basePath, specFile, filter) { | |||
// Only get spec file at the example root. | |||
// The formatter doesn't understand nested template string expressions (honestly, neither do I). | |||
// clang-format off |
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 (ts.isStringLiteral(templateExpr) || ts.isNoSubstitutionTemplateLiteral(templateExpr)) { | ||
// the start and end of the `templateExpr` node includes the quotation marks, which we | ||
// must | ||
// strip |
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.
O.P. formatter
const jsContents = env.getContents('test.js'); | ||
expect(jsContents).toContain('styles: ["h1[_ngcontent-%COMP%] {font-size: larger}"]'); | ||
}); | ||
}); |
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.
Should there be similar tests for templateUrl
components?
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.
We already have tests that verify templateUrl
works correctly. The logic is such that the origin of the template doesn't matter by the time we extract <style>
and <link>
.
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.
LGTM
Caretaker: I am the approver for fw-compiler, so this is good to go. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Angular supports using <style> and tags inline in component
templates, but previously such tags were not implemented within the ngtsc
compiler. This commit introduces that support.