fix: inline style source maps#383
Merged
alexander-akait merged 4 commits intowebpack:masterfrom Jul 25, 2019
Merged
Conversation
4119ed4 to
3be6b85
Compare
This change is unrelated to this PR, but is required for CI to pass
3be6b85 to
b981470
Compare
Codecov Report
@@ Coverage Diff @@
## master #383 +/- ##
========================================
- Coverage 7.38% 0% -7.39%
========================================
Files 6 5 -1
Lines 298 244 -54
Branches 90 72 -18
========================================
- Hits 22 0 -22
+ Misses 210 184 -26
+ Partials 66 60 -6
Continue to review full report at Codecov.
|
Member
alexander-akait
left a comment
There was a problem hiding this comment.
Great job! Will be merged to next release, maybe we can add couple tests?
6 tasks
|
Awesome work @jonathantneal No more FOUC on development builds. That's really sweet, thanks 👍 |
This was referenced Mar 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
convertToAbsoluteUrlsoption 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 --fixand 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