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

Svelte 5: Warn when whitespace handling would differ from Svelte 4 #11313

Open
Conduitry opened this issue Apr 24, 2024 · 2 comments
Open

Svelte 5: Warn when whitespace handling would differ from Svelte 4 #11313

Conduitry opened this issue Apr 24, 2024 · 2 comments

Comments

@Conduitry
Copy link
Member

Describe the problem

The changes in whitespace handling between Svelte 4 and Svelte 5 are some of the most insidious breaking changes, in that you may not even notice them until a while after upgrading your app because they may only affect one specific part of it, and possibly in a subtle way.

Describe the proposed solution

It would be nice to (probably just in non-runes mode) have compile-time warnings about components that contain whitespace that is now being removed in Svelte 5 but which was preserved in Svelte 4.

I realize this effectively means reimplementing Svelte 4's insane whitespace rules just for the sake of a warning, but I do think this would help people (myself included) feel more comfortable with migrating.

Importance

nice to have

@gterras
Copy link

gterras commented Apr 28, 2024

Could this be directly handled in the migration script as a warning? So that users that don't migrate a Svelte4 codebase don't ever see it?

@Conduitry
Copy link
Member Author

The migration script is intended to help people convert their (still-working) Svelte 4 components into Svelte 5 runes/snippets/etc. syntax.

This change in whitespace handling affects everyone upgrading to Svelte 5, even if their components are still using Svelte 4 syntax, so the compiler seems to me like the right place for this to live, not the migration script.

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

No branches or pull requests

2 participants