-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(compiler): Don't strip /*# sourceURL ... */
#16088
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
8b4180d
to
6fe610a
Compare
Sorry, the network of my home is too slow, I'll resolve the CI failure tomorrow. |
971b97f
to
8ad81c3
Compare
Hi Guys, how long until this get merged in? The lack of source maps is making my job MUCH more difficult. |
Guys, did the fix make it in to 4.3.3? If not, when can you implement? |
packages/compiler/src/shadow_css.ts
Outdated
@@ -525,12 +530,10 @@ function stripComments(input: string): string { | |||
return input.replace(_commentRe, ''); | |||
} | |||
|
|||
// all comments except inline source mapping | |||
const _sourceMappingUrlRe = /\/\*\s*#\s*sourceMappingURL=[\s\S]+?\*\//; | |||
const _commentWithHashRe = /\/\*#[\s\S]+?\*\//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.
This should only match what is intended ie
/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//
packages/compiler/src/shadow_css.ts
Outdated
const matcher = input.match(_sourceMappingUrlRe); | ||
return matcher ? matcher[0] : ''; | ||
function extractCommentsWithHash(input: string): string[]|null { | ||
return input.match(_commentWithHashRe); |
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.
return input.match(...) || []
and remove the null from the return type and simplify the usage
@asnowwolf Sorry that it took so long. Could you please rebase and fix the comments so that we can merge it. Thanks. |
Hello? Don't want to hassle you. Sure you're busy. But this PR has some merge conflicts that you probably ought to resolve. |
Currently, `shimCssText` only keep `/*# sourceMappingUrl ... */` comments and strip `/*# sourceURL ... */` comments. So, Chrome can't find the source maps for component style(that's created in new `style` tags)
8ad81c3
to
783cfcd
Compare
@asnowwolf I have updated your branch to fix my comments. Thanks for your initial work on this and sorry again for the delay in merging this. |
Currently, `shimCssText` only keep `/*# sourceMappingUrl ... */` comments and strip `/*# sourceURL ... */` comments. So, Chrome can't find the source maps for component style(that's created in new `style` tags) PR Close #16088
Currently, `shimCssText` only keep `/*# sourceMappingUrl ... */` comments and strip `/*# sourceURL ... */` comments. So, Chrome can't find the source maps for component style(that's created in new `style` tags) PR Close angular#16088
Currently, `shimCssText` only keep `/*# sourceMappingUrl ... */` comments and strip `/*# sourceURL ... */` comments. So, Chrome can't find the source maps for component style(that's created in new `style` tags) PR Close angular#16088
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. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Currently,
shimCssText
only keep/*# sourceMappingUrl ... */
comments and strip/*# sourceURL ... */
comments. So, Chrome can't find the source maps for component style(that's created in newstyle
tags)What is the new behavior?
Don't strip
/*# sourceURL ...*/
comments. Chrome will find source maps for component styles properly.Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: