remove suspends_without_fallback

pull/16757/head
Rich Harris 6 days ago
parent 2a7824aca3
commit c063f270e2

@ -543,7 +543,6 @@ export function analyze_component(root, source, options) {
snippet_renderers: new Map(), snippet_renderers: new Map(),
snippets: new Set(), snippets: new Set(),
async_deriveds: new Set(), async_deriveds: new Set(),
suspends_without_fallback: false,
hoisted_promises: new Map() hoisted_promises: new Map()
}; };

@ -42,8 +42,6 @@ export function AwaitExpression(node, context) {
if (!context.state.analysis.runes) { if (!context.state.analysis.runes) {
e.legacy_await_invalid(node); e.legacy_await_invalid(node);
} }
context.state.analysis.suspends_without_fallback ||= context.state.ast_type === 'instance';
} }
context.next(); context.next();

@ -243,8 +243,7 @@ export function server_component(analysis, options) {
.../** @type {Statement[]} */ (template.body) .../** @type {Statement[]} */ (template.body)
]); ]);
// TODO 'suspends_without_fallback' is probably a misnomer now if (analysis.instance.has_await) {
if (analysis.suspends_without_fallback) {
component_block = b.block([call_child_payload(component_block, true)]); component_block = b.block([call_child_payload(component_block, true)]);
} }

@ -15,9 +15,7 @@ export function SvelteHead(node, context) {
b.call( b.call(
'$.head', '$.head',
b.id('$$payload'), b.id('$$payload'),
// same thing as elsewhere; this will create more async functions than necessary but should never be _wrong_ b.arrow([b.id('$$payload')], block, node.fragment.metadata.is_sync)
// because the component rendering this head block will always be async if the head block is async
b.arrow([b.id('$$payload')], block, context.state.analysis.suspends_without_fallback)
) )
) )
); );

@ -107,8 +107,6 @@ export interface ComponentAnalysis extends Analysis {
* Every snippet that is declared locally * Every snippet that is declared locally
*/ */
snippets: Set<AST.SnippetBlock>; snippets: Set<AST.SnippetBlock>;
/** Whether the component uses `await` in a context that causes suspense outside of any boundary with a pending snippet. */
suspends_without_fallback: boolean;
hoisted_promises: Map<Expression, MemberExpression>; hoisted_promises: Map<Expression, MemberExpression>;
} }

Loading…
Cancel
Save