Skip to content

Commit

Permalink
fix: better account for render tags when pruning CSS (#14456)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
3 people authored Nov 28, 2024
1 parent dcef8ff commit c4ac0e0
Show file tree
Hide file tree
Showing 46 changed files with 493 additions and 232 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-squids-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: better account for render tags when pruning CSS
8 changes: 6 additions & 2 deletions packages/svelte/src/compiler/phases/1-parse/state/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ function open(parser) {
name
},
parameters: function_expression.params,
body: create_fragment()
body: create_fragment(),
metadata: {
sites: new Set()
}
});
parser.stack.push(block);
parser.fragments.push(block.body);
Expand Down Expand Up @@ -605,7 +608,8 @@ function special(parser) {
metadata: {
dynamic: false,
args_with_call_expression: new Set(),
path: []
path: [],
snippets: new Set()
}
});
}
Expand Down
Loading

0 comments on commit c4ac0e0

Please sign in to comment.