-
-
Notifications
You must be signed in to change notification settings - Fork 471
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: inline style source maps #383
fix: inline style source maps #383
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.
|
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.
Great job! Will be merged to next release, maybe we can add couple tests?
Awesome work @jonathantneal No more FOUC on development builds. That's really sweet, thanks 👍 |
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