Skip to content

Conversation

@jasonlyu123
Copy link
Member

Currently, renaming on slot let would result in invalid code because the svelte2tsx transform it into a destructured variable declaration

<Component let:a>
</Component>

become

<Component let:a: newName>
</Component>

This PR uses the logic in the shorthand props and transform it into

<Component let:a={newName}>
</Component>

Also, fix a sourcemap issue with multiple slot-let. Currently it would the generated code would source map back with extra whitespace. When renaming it now, the whitespace would be present in the new name input. After rename, the white space might be removed.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dummdidumm dummdidumm merged commit 530ec78 into sveltejs:master Nov 13, 2021
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