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

@ -9,7 +9,6 @@ export interface AnalysisState {
options: ValidatedCompileOptions; options: ValidatedCompileOptions;
ast_type: 'instance' | 'template' | 'module'; ast_type: 'instance' | 'template' | 'module';
fragment: AST.Fragment | null; 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. * 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. * 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; suspend = true;
} }
if (context.state.title) {
context.state.title.metadata.has_await = true;
}
// disallow top-level `await` or `await` in template expressions // disallow top-level `await` or `await` in template expressions
// unless a) in runes mode and b) opted into `experimental.async` // unless a) in runes mode and b) opted into `experimental.async`
if (suspend) { 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>')); template.push(b.literal('</title>'));
context.state.init.push( context.state.init.push(
b.stmt( b.stmt(b.call('$.build_title', b.id('$$payload'), b.thunk(b.block(build_template(template)))))
b.call(
'$.build_title',
b.id('$$payload'),
b.thunk(b.block(build_template(template)), node.metadata.has_await)
)
)
); );
} }

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

Loading…
Cancel
Save