fix: treat each blocks with async dependencies as uncontrolled (#17077)

pull/17078/head
Rich Harris 3 weeks ago committed by GitHub
parent 8ebc3b1337
commit a791e9178b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: treat each blocks with async dependencies as uncontrolled

@ -105,7 +105,7 @@ export function process_children(nodes, initial, is_element, context) {
is_element && is_element &&
// In case it's wrapped in async the async logic will want to skip sibling nodes up until the end, hence we cannot make this controlled // In case it's wrapped in async the async logic will want to skip sibling nodes up until the end, hence we cannot make this controlled
// TODO switch this around and instead optimize for elements with a single block child and not require extra comments (neither for async nor normally) // TODO switch this around and instead optimize for elements with a single block child and not require extra comments (neither for async nor normally)
!(node.body.metadata.has_await || node.metadata.expression.has_await) !(node.body.metadata.has_await || node.metadata.expression.is_async())
) { ) {
node.metadata.is_controlled = true; node.metadata.is_controlled = true;
} else { } else {

Loading…
Cancel
Save