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

sibling selectors involving {#key ...}/{@render ...} are incorrectly marked as unused #14399

Closed
Rich-Harris opened this issue Nov 21, 2024 · 7 comments · Fixed by #14456
Closed
Labels

Comments

@Rich-Harris
Copy link
Member

Rich-Harris commented Nov 21, 2024

Describe the bug

Because of this line...

} else if (prev.type === 'EachBlock' || prev.type === 'IfBlock' || prev.type === 'AwaitBlock') {
...and this line...
} else if (prev.type === 'EachBlock' || prev.type === 'IfBlock' || prev.type === 'AwaitBlock') {
...we incorrectly prune sibling selectors when things other than if/each/await blocks are involved. Discovered while working on #14395

Reproduction

Logs

No response

System Info

latest

Severity

annoyance

@Rich-Harris Rich-Harris changed the title sibling selectors involving {#key ...}/`{@render ...} are incorrectly marked as unused sibling selectors involving {#key ...}/{@render ...} are incorrectly marked as unused Nov 21, 2024
@Rich-Harris
Copy link
Member Author

Rich-Harris added a commit that referenced this issue Nov 22, 2024
@Rich-Harris
Copy link
Member Author

and another

@Rich-Harris
Copy link
Member Author

yet another

@Rich-Harris
Copy link
Member Author

and another

@Rich-Harris
Copy link
Member Author

and another

@harrisi
Copy link

harrisi commented Nov 28, 2024

and another

Sorry, what's wrong with this one? I don't see why the child component would be green.

dummdidumm added a commit that referenced this issue Nov 28, 2024
Fixes #14399

Add a mechanism to connect render tags to snippets to know where to walk when coming across render tags

---------

Co-authored-by: Simon H <[email protected]>
Co-authored-by: Simon Holthausen <[email protected]>
@Rich-Harris
Copy link
Member Author

because the <z> is not an immediate child of a <y> inside App.svelte

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

Successfully merging a pull request may close this issue.

2 participants