Skip to content
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

Preserve source maps for generated CSS #7588

Merged
merged 5 commits into from Feb 23, 2022
Merged

Conversation

thecrypticace
Copy link
Contributor

Source maps were not preserved for CSS in many cases because:

  1. We needed to recursively associate CSS nodes with the appropriate input source
  2. Defaults expansion didn't preserve source maps
  3. Apply didn't correctly override source maps leading to generated rules having no associated source
  4. Some but not all preflight rules didn't have source maps because of the recursive copying problem.

This should fix all of those and we now have tests to verify that source maps are properly generated as well.

Apply source maps could be better. For instance it may make sense that the individual rules generated for @apply text-black font-mono would point to the columns for text-black and font-mono respectively. However, that is a lot of bookkeeping for not much gain. Having them all point to the apply line that generated them seems like a reasonable tradeoff.

Fixes #7583
Fixes #5043
Closes #7369

@thecrypticace thecrypticace force-pushed the fix/apply-source-maps branch 2 times, most recently from e0c71bf to ab0c9db Compare February 23, 2022 16:20
@thecrypticace thecrypticace marked this pull request as ready for review February 23, 2022 16:24
@thecrypticace thecrypticace merged commit b94d565 into master Feb 23, 2022
@thecrypticace thecrypticace deleted the fix/apply-source-maps branch February 23, 2022 16:24
@evenfrost
Copy link
Contributor

@thecrypticace do you have an idea when it can be released?

@thecrypticace
Copy link
Contributor Author

We moved some stuff around today just so we could get a patch release out with a whole slew of bug fixes! You can upgrade to v3.0.24!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants