chore: remove reactive_statements from state ()

pull/15380/head
Rich Harris 2 months ago committed by GitHub
parent bfeb9ad448
commit 1b882fb1b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -269,8 +269,7 @@ export function analyze_module(ast, options) {
has_props_rune: false,
options: /** @type {ValidatedCompileOptions} */ (options),
parent_element: null,
reactive_statement: null,
reactive_statements: new Map()
reactive_statement: null
},
visitors
);
@ -619,8 +618,7 @@ export function analyze_component(root, source, options) {
expression: null,
derived_state: [],
function_depth: scope.function_depth,
reactive_statement: null,
reactive_statements: new Map()
reactive_statement: null
};
walk(/** @type {AST.SvelteNode} */ (ast), state, visitors);
@ -683,7 +681,6 @@ export function analyze_component(root, source, options) {
has_props_rune: false,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',
reactive_statement: null,
reactive_statements: analysis.reactive_statements,
component_slots: new Set(),
expression: null,
derived_state: [],

@ -1,7 +1,6 @@
import type { Scope } from '../scope.js';
import type { ComponentAnalysis, ReactiveStatement } from '../types.js';
import type { AST, ExpressionMetadata, ValidatedCompileOptions } from '#compiler';
import type { LabeledStatement } from 'estree';
export interface AnalysisState {
scope: Scope;
@ -24,7 +23,6 @@ export interface AnalysisState {
// legacy stuff
reactive_statement: null | ReactiveStatement;
reactive_statements: Map<LabeledStatement, ReactiveStatement>;
}
export type Context<State extends AnalysisState = AnalysisState> = import('zimmerframe').Context<

@ -64,7 +64,7 @@ export function LabeledStatement(node, context) {
}
}
context.state.reactive_statements.set(node, reactive_statement);
context.state.analysis.reactive_statements.set(node, reactive_statement);
if (
node.body.type === 'ExpressionStatement' &&

Loading…
Cancel
Save