remove suspends_without_fallback

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

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

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

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

@ -15,9 +15,7 @@ export function SvelteHead(node, context) {
b.call(
'$.head',
b.id('$$payload'),
// same thing as elsewhere; this will create more async functions than necessary but should never be _wrong_
// 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)
b.arrow([b.id('$$payload')], block, node.fragment.metadata.is_sync)
)
)
);

@ -107,8 +107,6 @@ export interface ComponentAnalysis extends Analysis {
* Every snippet that is declared locally
*/
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>;
}

Loading…
Cancel
Save