chore: remove analysis.state.title (#16771)

* chore: remove analysis.state.title

* unused
pull/16780/head
Rich Harris 4 weeks ago committed by GitHub
parent cf3ea69b7a
commit 9d8f259db3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -303,7 +303,6 @@ export function analyze_module(source, options) {
has_props_rune: false,
options: /** @type {ValidatedCompileOptions} */ (options),
fragment: null,
title: null,
parent_element: null,
reactive_statement: null
},
@ -694,7 +693,6 @@ export function analyze_component(root, source, options) {
options,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',
fragment: ast === template.ast ? ast : null,
title: null,
parent_element: null,
has_props_rune: false,
component_slots: new Set(),
@ -761,7 +759,6 @@ export function analyze_component(root, source, options) {
analysis,
options,
fragment: ast === template.ast ? ast : null,
title: null,
parent_element: null,
has_props_rune: false,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',

@ -9,7 +9,6 @@ export interface AnalysisState {
options: ValidatedCompileOptions;
ast_type: 'instance' | 'template' | 'module';
fragment: AST.Fragment | null;
title: AST.TitleElement | null;
/**
* Tag name of the parent element. `null` if the parent is `svelte:element`, `#snippet`, a component or the root.
* Parent doesn't necessarily mean direct path predecessor because there could be `#each`, `#if` etc in-between.

@ -20,10 +20,6 @@ export function AwaitExpression(node, context) {
suspend = true;
}
if (context.state.title) {
context.state.title.metadata.has_await = true;
}
// disallow top-level `await` or `await` in template expressions
// unless a) in runes mode and b) opted into `experimental.async`
if (suspend) {

@ -17,5 +17,5 @@ export function TitleElement(node, context) {
}
}
context.visit(node.fragment, { ...context.state, title: node });
context.visit(node.fragment);
}

@ -14,12 +14,6 @@ export function TitleElement(node, context) {
template.push(b.literal('</title>'));
context.state.init.push(
b.stmt(
b.call(
'$.build_title',
b.id('$$payload'),
b.thunk(b.block(build_template(template)), node.metadata.has_await)
)
)
b.stmt(b.call('$.build_title', b.id('$$payload'), b.thunk(b.block(build_template(template)))))
);
}

@ -327,10 +327,6 @@ export namespace AST {
export interface TitleElement extends BaseElement {
type: 'TitleElement';
name: 'title';
/** @internal */
metadata: {
has_await: boolean;
};
}
export interface SlotElement extends BaseElement {

Loading…
Cancel
Save