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.
This PR contains a:
Motivation / Use-Case
Currently, if source maps are enabled, style-loader uses Blob URLs within
<link>
tags, instead of<style>
tags with inline CSS. These Blobs URLs were used to workaround a bug that preventing source maps in<style>
tag from working in Chrome, but that bug was fixed in 2015. 🤔Unfortunately, using
<link>
to load CSS is asynchronous, which causes the FOUC. These issues were resolved by #219, which was approved, merged, and then “lost”; mostly likely due to a mistake in branch management. 🤷♂There have continued to be issues with the Blob URL implementation. As a result, Create React App has removed the ability to use CSS source maps in development. 😢
But now I have work to do. And that work involves CSS. And when I work with CSS, I want to use source maps. So I’ve done my research, discovered the preexisting work of others, and restored the fix for you in this PR. 🙏
If this is merged, the code will be shorter, faster, and
peacesource maps may be restored tothe galaxyCreate React App. 😂Breaking Changes
Yes, the breaking change is that the
convertToAbsoluteUrls
option is removed because it is no longer needed. That removal might be the reason Codecov reports that this PR reduces coverage by 7.38%.However, I would consider this an unbreaking change. 🤓
Additional Info
In order for this PR to pass, I had to run
npm audit --fix
and thennpm install --save-dev @commitlint/cli@8.1.0
.Also, this PR incidentally fixes these issues related to Blob:
<link>
tag when settingsourceMap: true
#265