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

[refactor] DRY out whitespace handling #7496

Closed
wants to merge 2 commits into from

Conversation

bayre
Copy link

@bayre bayre commented Apr 29, 2022

Spurred on by a few outstanding issues (#3168, #7493) I've just been looking into how whitespace is handled in the Svelte compiler. It seems like there's a fair bit of repetition, with some functions being copied almost directly between render_dom and render_ssr. This PR is a bid to reconcile this in the hope that it'll be easier to maintain and easier to identify the source of any discrepancies between DOM and SSR outputs. That said, it's also my first foray into the Svelte source code so there may well be something I have overlooked!

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

  • Run the tests with npm test and lint the project with npm run lint

@bayre
Copy link
Author

bayre commented May 17, 2022

Binning this for fear that it's unwarranted noise

@bayre bayre closed this May 17, 2022
@dummdidumm
Copy link
Member

No worries! Refactorings like this are generally received well, it just may take some time until it's merged.

@bayre bayre deleted the dry-whitespace branch May 24, 2022 17: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
Development

Successfully merging this pull request may close these issues.

2 participants