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

chore: source maps for preprocessors + tests #10459

Merged
merged 26 commits into from
Feb 15, 2024
Merged

chore: source maps for preprocessors + tests #10459

merged 26 commits into from
Feb 15, 2024

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Feb 12, 2024

Add source map merging for preprocessors and get tests passing.

  • fixed some issues around the sources array where they weren't calculated relative to the input correctly
  • adjusted some CSS tests because due to our own CSS parser the AST is less granular, so there are less mappings now. Don't think this is a problem, but worth thinking about
  • need to decide what to do about enableSourcemap, it was needed at some point, not sure if anymore, and not sure how much hassle it would be to bring back. In the spirit of "as little breaking changes as possible" probably ok to bring back if not too much hassle? Edit: We decided to remove it but only log a warning, the reason this was introduced was to mitigate a bug in Vite which occured when having the source map inlined into the SSR'd output. Since SSR doesn't contain inlined CSS anymore (and if it did, we would omit the source map) the reason for which it was introduced no longer exists
  • right now some things aren't mapped. Namely something like bind:x isn't mapped anymore, not sure if this is a problem in Svelte or in esrap. Edit: It seems this never worked for the bind:x shorthand and that test is skipped in Svelte 4. Svelte 4 adds loc entries to a handful of locations by hand for things that should be mapped.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Copy link

changeset-bot bot commented Feb 12, 2024

🦋 Changeset detected

Latest commit: 86f2de6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
Copy link
Member Author

Alright, the only thing left is the test that was added in order to address #6092, which we can always tackle later if we chose to reimplement it. Gonna merge this as soon as it's green.

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

Successfully merging this pull request may close these issues.

None yet

1 participant