From 3b5a59b3854c1a37d4e859d9c3beb61f62aec857 Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Sat, 22 Feb 2025 15:04:54 +0100
Subject: [PATCH 1/9] first impl

---
 .../server/visitors/SvelteBoundary.js         | 87 ++++++++++++++++++-
 .../svelte/src/compiler/utils/builders.js     | 18 ++++
 2 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index 0d54feee11b3..37143730fbcc 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -1,6 +1,7 @@
-/** @import { BlockStatement } from 'estree' */
+/** @import { BlockStatement, Identifier, Statement, Expression } from 'estree' */
 /** @import { AST } from '#compiler' */
 /** @import { ComponentContext } from '../types' */
+import { attr } from 'svelte/internal/client';
 import { BLOCK_CLOSE, BLOCK_OPEN } from '../../../../../internal/server/hydration.js';
 import * as b from '../../../../utils/builders.js';
 
@@ -9,9 +10,91 @@ import * as b from '../../../../utils/builders.js';
  * @param {ComponentContext} context
  */
 export function SvelteBoundary(node, context) {
+	const props = b.object([]);
+
+	const nodes = [];
+
+	/** @type {AST.SnippetBlock | null} */
+	let failed_snippet = null;
+
+	/** @type {Statement[]} */
+	const statements = [];
+
+	/** @type {Expression | null} */
+	let call_expression = null;
+
+	const payload = b.id('$$payload'); // correct ?
+	const out_len = b.id('$$out_len');
+
+	statements.push(
+		b.declaration('const', [b.declarator(out_len.name, b.member(payload, 'out.length'))])
+	);
+
+	// Capture the `failed` explicit snippet prop
+	for (const attribute of node.attributes) {
+		if (attribute.type === 'Attribute' && attribute.name === 'failed' && attribute.value !== true) {
+			/** @type {Statement[]} */
+			const init = [];
+			context.visit(attribute, { ...context.state, init });
+			statements.push(...init);
+
+			const chunk = Array.isArray(attribute.value)
+				? /** @type {AST.ExpressionTag} */ (attribute.value[0])
+				: attribute.value;
+			call_expression = /** @type {Expression} */ (context.visit(chunk.expression, context.state));
+		}
+	}
+
+	// Capture the `failed` implicit snippet prop
+	for (const child of node.fragment.nodes) {
+		if (child.type === 'SnippetBlock' && child.expression.name === 'failed') {
+			failed_snippet = child;
+			call_expression = failed_snippet.expression;
+		} else if (child.type === 'ConstTag') {
+			/** @type {Statement[]} */
+			const init = [];
+			context.visit(child, { ...context.state, init });
+			statements.push(...init);
+		} else {
+			nodes.push(child);
+		}
+	}
+
+	if (failed_snippet) {
+		/** @type {Statement[]} */
+		const init = [];
+		context.visit(failed_snippet, { ...context.state, init });
+		//props.properties.push(b.prop('init', failed_snippet.expression, failed_snippet.expression));
+		statements.push(...init);
+	}
+
+	const block = /** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }));
+
+	/** @type {Identifier | null} */
+	let err_id = b.id('$$err');
+
+	/** @type {Statement[]} */
+	let catch_statements = [];
+
+	catch_statements.push(
+		b.stmt(
+			b.assignment(
+				'=',
+				b.member(payload, 'out'),
+				b.call(b.member(payload, 'out.substring'), b.literal(0), out_len)
+			)
+		)
+	);
+
+	if (call_expression) {
+		catch_statements.push(b.stmt(b.call(call_expression, payload, err_id)));
+	}
+
+	statements.push(b.try_catch(block, err_id, b.block(catch_statements)));
+
 	context.state.template.push(
 		b.literal(BLOCK_OPEN),
-		/** @type {BlockStatement} */ (context.visit(node.fragment)),
+		b.block([...statements]),
 		b.literal(BLOCK_CLOSE)
 	);
 }
diff --git a/packages/svelte/src/compiler/utils/builders.js b/packages/svelte/src/compiler/utils/builders.js
index ecb595d74dbd..91b2d6bbc2cf 100644
--- a/packages/svelte/src/compiler/utils/builders.js
+++ b/packages/svelte/src/compiler/utils/builders.js
@@ -89,6 +89,24 @@ export function block(body) {
 	return { type: 'BlockStatement', body };
 }
 
+/**
+ * @param {ESTree.BlockStatement} block
+ * @param {ESTree.Pattern | null} param
+ * @param {ESTree.BlockStatement} catch_block
+ * @returns {ESTree.TryStatement}
+ */
+export function try_catch(block, param, catch_block) {
+	return {
+		type: 'TryStatement',
+		block,
+		handler: {
+			type: 'CatchClause',
+			param,
+			body: catch_block
+		}
+	};
+}
+
 /**
  * @param {string} name
  * @param {ESTree.Statement} body

From 8c64616e8cb0456f997d5fb6e99ec15f8c4354a8 Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Sat, 22 Feb 2025 17:02:08 +0100
Subject: [PATCH 2/9] stuff

---
 .../server/visitors/SvelteBoundary.js         | 50 +++++++------------
 1 file changed, 19 insertions(+), 31 deletions(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index 37143730fbcc..c15c5a1a27d0 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -14,9 +14,6 @@ export function SvelteBoundary(node, context) {
 
 	const nodes = [];
 
-	/** @type {AST.SnippetBlock | null} */
-	let failed_snippet = null;
-
 	/** @type {Statement[]} */
 	const statements = [];
 
@@ -24,10 +21,22 @@ export function SvelteBoundary(node, context) {
 	let call_expression = null;
 
 	const payload = b.id('$$payload'); // correct ?
-	const out_len = b.id('$$out_len');
+	const out_pos = b.id('$$pos');
+	let err_id = b.id('$$err');
+
+	/** @type {Statement[]} */
+	let catch_statements = [
+		b.stmt(
+			b.assignment(
+				'=',
+				b.member(payload, 'out'),
+				b.call(b.member(payload, 'out.substring'), b.literal(0), out_pos)
+			)
+		)
+	];
 
 	statements.push(
-		b.declaration('const', [b.declarator(out_len.name, b.member(payload, 'out.length'))])
+		b.declaration('const', [b.declarator(out_pos.name, b.member(payload, 'out.length'))])
 	);
 
 	// Capture the `failed` explicit snippet prop
@@ -48,8 +57,11 @@ export function SvelteBoundary(node, context) {
 	// Capture the `failed` implicit snippet prop
 	for (const child of node.fragment.nodes) {
 		if (child.type === 'SnippetBlock' && child.expression.name === 'failed') {
-			failed_snippet = child;
-			call_expression = failed_snippet.expression;
+			/** @type {Statement[]} */
+			const init = [];
+			context.visit(child, { ...context.state, init });
+			catch_statements.push(...init);
+			call_expression = child.expression;
 		} else if (child.type === 'ConstTag') {
 			/** @type {Statement[]} */
 			const init = [];
@@ -60,32 +72,8 @@ export function SvelteBoundary(node, context) {
 		}
 	}
 
-	if (failed_snippet) {
-		/** @type {Statement[]} */
-		const init = [];
-		context.visit(failed_snippet, { ...context.state, init });
-		//props.properties.push(b.prop('init', failed_snippet.expression, failed_snippet.expression));
-		statements.push(...init);
-	}
-
 	const block = /** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }));
 
-	/** @type {Identifier | null} */
-	let err_id = b.id('$$err');
-
-	/** @type {Statement[]} */
-	let catch_statements = [];
-
-	catch_statements.push(
-		b.stmt(
-			b.assignment(
-				'=',
-				b.member(payload, 'out'),
-				b.call(b.member(payload, 'out.substring'), b.literal(0), out_len)
-			)
-		)
-	);
-
 	if (call_expression) {
 		catch_statements.push(b.stmt(b.call(call_expression, payload, err_id)));
 	}

From fc1007dad022dcd500f9ab75cb009c7afc068a5c Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Wed, 26 Feb 2025 18:17:08 +0100
Subject: [PATCH 3/9] rewrite

---
 .../server/visitors/SvelteBoundary.js         | 122 +++++++++++-------
 packages/svelte/src/internal/server/index.js  |  23 +++-
 2 files changed, 100 insertions(+), 45 deletions(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index c15c5a1a27d0..d208c8ad279d 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -1,88 +1,122 @@
-/** @import { BlockStatement, Identifier, Statement, Expression } from 'estree' */
+/** @import { BlockStatement, Identifier, Statement, Expression, MaybeNamedFunctionDeclaration, Pattern } from 'estree' */
 /** @import { AST } from '#compiler' */
 /** @import { ComponentContext } from '../types' */
 import { attr } from 'svelte/internal/client';
 import { BLOCK_CLOSE, BLOCK_OPEN } from '../../../../../internal/server/hydration.js';
 import * as b from '../../../../utils/builders.js';
+import { extract_identifiers } from '../../../../utils/ast.js';
 
 /**
  * @param {AST.SvelteBoundary} node
  * @param {ComponentContext} context
  */
 export function SvelteBoundary(node, context) {
-	const props = b.object([]);
-
-	const nodes = [];
-
 	/** @type {Statement[]} */
 	const statements = [];
 
-	/** @type {Expression | null} */
-	let call_expression = null;
+	/** @type {AST.SnippetBlock | null} */
+	let snippet = null;
+
+	/** @type {AST.ConstTag[]} */
+	let const_tags = [];
+
+	const nodes = [];
 
 	const payload = b.id('$$payload'); // correct ?
-	const out_pos = b.id('$$pos');
-	let err_id = b.id('$$err');
 
-	/** @type {Statement[]} */
-	let catch_statements = [
-		b.stmt(
-			b.assignment(
-				'=',
-				b.member(payload, 'out'),
-				b.call(b.member(payload, 'out.substring'), b.literal(0), out_pos)
-			)
-		)
-	];
-
-	statements.push(
-		b.declaration('const', [b.declarator(out_pos.name, b.member(payload, 'out.length'))])
-	);
+	/** @type {Expression | undefined} */
+	let failed;
 
 	// Capture the `failed` explicit snippet prop
 	for (const attribute of node.attributes) {
 		if (attribute.type === 'Attribute' && attribute.name === 'failed' && attribute.value !== true) {
-			/** @type {Statement[]} */
-			const init = [];
-			context.visit(attribute, { ...context.state, init });
-			statements.push(...init);
-
 			const chunk = Array.isArray(attribute.value)
 				? /** @type {AST.ExpressionTag} */ (attribute.value[0])
 				: attribute.value;
-			call_expression = /** @type {Expression} */ (context.visit(chunk.expression, context.state));
+			failed = /** @type {Expression} */ (context.visit(chunk.expression, context.state));
 		}
 	}
 
 	// Capture the `failed` implicit snippet prop
 	for (const child of node.fragment.nodes) {
 		if (child.type === 'SnippetBlock' && child.expression.name === 'failed') {
+			snippet = child;
+
 			/** @type {Statement[]} */
 			const init = [];
-			context.visit(child, { ...context.state, init });
-			catch_statements.push(...init);
-			call_expression = child.expression;
+			context.visit(snippet, { ...context.state, init });
+
+			if (init.length === 1 && init[0].type === 'FunctionDeclaration') {
+				failed = b.arrow(init[0].params, init[0].body);
+			} else {
+				statements.push(...init);
+				failed = b.id('failed');
+			}
 		} else if (child.type === 'ConstTag') {
+			const_tags.push(child);
+		} else {
+			nodes.push(child);
+		}
+	}
+
+	if (snippet && has_const_referenced(context, snippet, const_tags)) {
+		for (const tag of const_tags) {
 			/** @type {Statement[]} */
 			const init = [];
-			context.visit(child, { ...context.state, init });
+			context.visit(tag, { ...context.state, init });
 			statements.push(...init);
-		} else {
-			nodes.push(child);
 		}
+	} else if (const_tags.length) {
+		nodes.unshift(...const_tags);
 	}
 
-	const block = /** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }));
+	const body = b.arrow(
+		[b.id('$$payload')],
+		/** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }))
+	);
 
-	if (call_expression) {
-		catch_statements.push(b.stmt(b.call(call_expression, payload, err_id)));
+	statements.push(b.stmt(b.call('$.boundary', payload, body, failed)));
+
+	if (statements.length === 1) {
+		context.state.template.push(statements[0]);
+	} else {
+		context.state.template.push(b.block([...statements]));
 	}
+}
 
-	statements.push(b.try_catch(block, err_id, b.block(catch_statements)));
+/**
+ *
+ * @param {ComponentContext} context
+ * @param {AST.SnippetBlock} snippet
+ * @param {AST.ConstTag[]} const_tags
+ */
+function has_const_referenced(context, snippet, const_tags) {
+	if (const_tags.length === 0) {
+		return false;
+	}
 
-	context.state.template.push(
-		b.literal(BLOCK_OPEN),
-		b.block([...statements]),
-		b.literal(BLOCK_CLOSE)
-	);
+	const references = context.state.scopes.get(snippet)?.references;
+	if (references == null || references.size === 0) {
+		return false;
+	}
+
+	const identifiers = new Set();
+	for (const tag of const_tags) {
+		for (const declaration of tag.declaration.declarations) {
+			for (const id of extract_identifiers(declaration.id)) {
+				identifiers.add(id.name);
+			}
+		}
+	}
+
+	if (identifiers.size === 0) {
+		return false;
+	}
+
+	for (const reference of references.keys()) {
+		if (identifiers.has(reference)) {
+			return true;
+		}
+	}
+	return false;
 }
diff --git a/packages/svelte/src/internal/server/index.js b/packages/svelte/src/internal/server/index.js
index e8ffeed2fef5..184a5d84dff6 100644
--- a/packages/svelte/src/internal/server/index.js
+++ b/packages/svelte/src/internal/server/index.js
@@ -14,7 +14,7 @@ import {
 import { escape_html } from '../../escaping.js';
 import { DEV } from 'esm-env';
 import { current_component, pop, push } from './context.js';
-import { EMPTY_COMMENT, BLOCK_CLOSE, BLOCK_OPEN } from './hydration.js';
+import { EMPTY_COMMENT, BLOCK_CLOSE, BLOCK_OPEN, BLOCK_OPEN_ELSE } from './hydration.js';
 import { validate_store } from '../shared/validate.js';
 import { is_boolean_attribute, is_raw_text_element, is_void } from '../../utils.js';
 import { reset_elements } from './dev.js';
@@ -552,6 +552,27 @@ export function props_id(payload) {
 	return uid;
 }
 
+/**
+ * <svelte:boundary>
+ * @param {Payload} payload
+ * @param {(payload:Payload) => void} body
+ * @param {(payload:Payload, err: any) => void} [failed]
+ * @returns {void}
+ */
+export function boundary(payload, body, failed) {
+	var inner_payload = copy_payload(payload);
+	try {
+		inner_payload.out += BLOCK_OPEN;
+		body(inner_payload);
+	} catch (err) {
+		inner_payload = copy_payload(payload);
+		inner_payload.out += BLOCK_OPEN_ELSE;
+		failed?.(inner_payload, err);
+	}
+	inner_payload.out += BLOCK_CLOSE;
+	assign_payload(payload, inner_payload);
+}
+
 export { attr, clsx };
 
 export { html } from './blocks/html.js';

From 510443a15908dc5154465ca76da586b2cc5beb04 Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Wed, 26 Feb 2025 21:38:59 +0100
Subject: [PATCH 4/9] stuff

---
 .../server/visitors/SvelteBoundary.js         | 58 ++++++++++++++++---
 packages/svelte/src/internal/server/index.js  |  2 +-
 2 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index d208c8ad279d..99ddf2cd5900 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -20,6 +20,8 @@ export function SvelteBoundary(node, context) {
 	/** @type {AST.ConstTag[]} */
 	let const_tags = [];
 
+	/** @type {Statement[]} */
+	const init_body = [];
 	const nodes = [];
 
 	const payload = b.id('$$payload'); // correct ?
@@ -60,20 +62,60 @@ export function SvelteBoundary(node, context) {
 	}
 
 	if (snippet && has_const_referenced(context, snippet, const_tags)) {
+		const const_values = b.id(context.state.scope.generate('const_values'));
+		statements.push(b.declaration('const', [b.declarator(const_values, b.object([]))]));
 		for (const tag of const_tags) {
-			/** @type {Statement[]} */
-			const init = [];
-			context.visit(tag, { ...context.state, init });
-			statements.push(...init);
+			const identifiers = extract_identifiers(tag.declaration.declarations[0].id);
+
+			statements.push(
+				b.declaration(
+					'let',
+					identifiers.map((id) => b.declarator(id))
+				)
+			);
+			for (const id of identifiers) {
+				statements.push(b.stmt(b.call('console.log', id)));
+			}
+
+			context.visit(tag, { ...context.state, init: init_body });
+			for (const id of identifiers) {
+				init_body.push(b.stmt(b.assignment('=', const_values, id)));
+				init_body.push(b.stmt(b.call('console.log', const_values)));
+			}
+
+			// statements.push(b.declaration('const', [b.declarator(tmp, b.arrow([], b.block(init)))]));
+
+			// nodes.unshift(b.declaration('let', [b.declarator(b.array_pattern(identifiers), tmp)]));
+			// // b.declaration('let', [b.declarator(b.array_pattern(identifiers), tmp)]);
+
+			// const c = server_const(() => {
+			// 	const { t, x } = { x: name, y: 'x' };
+			// 	if (true) {
+			// 		throw new Error('badaboum');
+			// 	}
+			// 	return { t, x };
+			// });
+
+			///** @type {Statement[]} */
+			//const init = [];
+			//context.visit(tag, { ...context.state, init });
+			//statements.push(...init);
 		}
 	} else if (const_tags.length) {
 		nodes.unshift(...const_tags);
 	}
 
-	const body = b.arrow(
-		[b.id('$$payload')],
-		/** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }))
-	);
+	if (init_body.length) {
+		//nodes.unshift(...init_body);
+	}
+
+	const body_block = /** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }));
+
+	if (init_body.length) {
+		body_block.body.unshift(...init_body);
+	}
+
+	const body = b.arrow([b.id('$$payload')], body_block);
 
 	statements.push(b.stmt(b.call('$.boundary', payload, body, failed)));
 
diff --git a/packages/svelte/src/internal/server/index.js b/packages/svelte/src/internal/server/index.js
index 184a5d84dff6..d00859a4a257 100644
--- a/packages/svelte/src/internal/server/index.js
+++ b/packages/svelte/src/internal/server/index.js
@@ -553,7 +553,7 @@ export function props_id(payload) {
 }
 
 /**
- * <svelte:boundary>
+ * <svelte:boundary> for server-side
  * @param {Payload} payload
  * @param {(payload:Payload) => void} body
  * @param {(payload:Payload, err: any) => void} [failed]

From ae214cd05b6e61b3feeab462c406209d7a72466a Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Thu, 6 Mar 2025 17:51:15 +0100
Subject: [PATCH 5/9] hydration

---
 .../server/visitors/SvelteBoundary.js         | 104 +++++-------------
 .../internal/client/dom/blocks/boundary.js    |  19 +++-
 2 files changed, 44 insertions(+), 79 deletions(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index 99ddf2cd5900..3f06223d54bc 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -1,8 +1,6 @@
 /** @import { BlockStatement, Identifier, Statement, Expression, MaybeNamedFunctionDeclaration, Pattern } from 'estree' */
 /** @import { AST } from '#compiler' */
 /** @import { ComponentContext } from '../types' */
-import { attr } from 'svelte/internal/client';
-import { BLOCK_CLOSE, BLOCK_OPEN } from '../../../../../internal/server/hydration.js';
 import * as b from '../../../../utils/builders.js';
 import { extract_identifiers } from '../../../../utils/ast.js';
 
@@ -20,8 +18,6 @@ export function SvelteBoundary(node, context) {
 	/** @type {AST.ConstTag[]} */
 	let const_tags = [];
 
-	/** @type {Statement[]} */
-	const init_body = [];
 	const nodes = [];
 
 	const payload = b.id('$$payload'); // correct ?
@@ -61,60 +57,34 @@ export function SvelteBoundary(node, context) {
 		}
 	}
 
-	if (snippet && has_const_referenced(context, snippet, const_tags)) {
-		const const_values = b.id(context.state.scope.generate('const_values'));
-		statements.push(b.declaration('const', [b.declarator(const_values, b.object([]))]));
-		for (const tag of const_tags) {
-			const identifiers = extract_identifiers(tag.declaration.declarations[0].id);
-
-			statements.push(
-				b.declaration(
-					'let',
-					identifiers.map((id) => b.declarator(id))
-				)
-			);
-			for (const id of identifiers) {
-				statements.push(b.stmt(b.call('console.log', id)));
-			}
-
-			context.visit(tag, { ...context.state, init: init_body });
-			for (const id of identifiers) {
-				init_body.push(b.stmt(b.assignment('=', const_values, id)));
-				init_body.push(b.stmt(b.call('console.log', const_values)));
-			}
-
-			// statements.push(b.declaration('const', [b.declarator(tmp, b.arrow([], b.block(init)))]));
-
-			// nodes.unshift(b.declaration('let', [b.declarator(b.array_pattern(identifiers), tmp)]));
-			// // b.declaration('let', [b.declarator(b.array_pattern(identifiers), tmp)]);
+	let max_referenced_const_tag = -1;
 
-			// const c = server_const(() => {
-			// 	const { t, x } = { x: name, y: 'x' };
-			// 	if (true) {
-			// 		throw new Error('badaboum');
-			// 	}
-			// 	return { t, x };
-			// });
+	if (snippet) {
+		const references = context.state.scopes.get(snippet)?.references;
+		if (references != null && references.size) {
+			const keys = new Set(references.keys());
 
-			///** @type {Statement[]} */
-			//const init = [];
-			//context.visit(tag, { ...context.state, init });
-			//statements.push(...init);
+			const_tags.forEach((tag, index) => {
+				if (has_reference(keys, tag)) {
+					max_referenced_const_tag = index + 1;
+				}
+			});
 		}
-	} else if (const_tags.length) {
-		nodes.unshift(...const_tags);
 	}
 
-	if (init_body.length) {
-		//nodes.unshift(...init_body);
+	if (max_referenced_const_tag < 0) {
+		nodes.unshift(...const_tags);
+	} else if (max_referenced_const_tag === const_tags.length) {
+		const_tags.forEach((tag) => context.visit(tag, { ...context.state, init: statements }));
+	} else {
+		const_tags
+			.slice(0, max_referenced_const_tag)
+			.forEach((tag) => context.visit(tag, { ...context.state, init: statements }));
+		nodes.unshift(...const_tags.slice(max_referenced_const_tag));
 	}
 
 	const body_block = /** @type {BlockStatement} */ (context.visit({ ...node.fragment, nodes }));
 
-	if (init_body.length) {
-		body_block.body.unshift(...init_body);
-	}
-
 	const body = b.arrow([b.id('$$payload')], body_block);
 
 	statements.push(b.stmt(b.call('$.boundary', payload, body, failed)));
@@ -127,38 +97,16 @@ export function SvelteBoundary(node, context) {
 }
 
 /**
- *
- * @param {ComponentContext} context
- * @param {AST.SnippetBlock} snippet
- * @param {AST.ConstTag[]} const_tags
+ * @param {Set<string>} keys
+ * @param {AST.ConstTag} tag
  */
-function has_const_referenced(context, snippet, const_tags) {
-	if (const_tags.length === 0) {
-		return false;
-	}
-
-	const references = context.state.scopes.get(snippet)?.references;
-	if (references == null || references.size === 0) {
-		return false;
-	}
-
-	const identifiers = new Set();
-	for (const tag of const_tags) {
-		for (const declaration of tag.declaration.declarations) {
-			for (const id of extract_identifiers(declaration.id)) {
-				identifiers.add(id.name);
+function has_reference(keys, tag) {
+	for (const declaration of tag.declaration.declarations) {
+		for (const id of extract_identifiers(declaration.id)) {
+			if (keys.has(id.name)) {
+				return true;
 			}
 		}
 	}
-
-	if (identifiers.size === 0) {
-		return false;
-	}
-
-	for (const reference of references.keys()) {
-		if (identifiers.has(reference)) {
-			return true;
-		}
-	}
 	return false;
 }
diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js
index c1ca7a960034..cc4b9424def1 100644
--- a/packages/svelte/src/internal/client/dom/blocks/boundary.js
+++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js
@@ -1,5 +1,6 @@
 /** @import { Effect, TemplateNode, } from '#client' */
 
+import { HYDRATION_START } from '../../../../constants.js';
 import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '../../constants.js';
 import { component_context, set_component_context } from '../../context.js';
 import { block, branch, destroy_effect, pause_effect } from '../../reactivity/effects.js';
@@ -17,7 +18,8 @@ import {
 	hydrating,
 	next,
 	remove_nodes,
-	set_hydrate_node
+	set_hydrate_node,
+	set_hydrating
 } from '../hydration.js';
 import { queue_micro_task } from '../task.js';
 
@@ -119,12 +121,27 @@ export function boundary(node, props, boundary_fn) {
 			}
 		};
 
+		let mismatch = false;
+
 		if (hydrating) {
+			const data = /** @type {Comment} */ (anchor).data;
 			hydrate_next();
+			if (data !== HYDRATION_START) {
+				anchor = remove_nodes();
+
+				set_hydrate_node(anchor);
+				set_hydrating(false);
+				mismatch = true;
+			}
 		}
 
 		boundary_effect = branch(() => boundary_fn(anchor));
 		reset_is_throwing_error();
+
+		if (mismatch) {
+			// continue in hydration mode
+			set_hydrating(true);
+		}
 	}, EFFECT_TRANSPARENT | BOUNDARY_EFFECT);
 
 	if (hydrating) {

From 3cfa0fb7989a8b957c17d6eedc038b1985d41b28 Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Thu, 6 Mar 2025 17:52:17 +0100
Subject: [PATCH 6/9] merge

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 2fe545b36180..ad69bfc9cafb 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
     "prettier-plugin-svelte": "^3.1.2",
     "svelte": "workspace:^",
     "typescript": "^5.5.4",
-    "typescript-eslint": "^8.2.0",
+    "typescript-eslint": "^8.24.0",
     "v8-natives": "^1.2.5",
     "vitest": "^2.1.9"
   }

From 6eb20fd2996e7ecb4e766a53a6e1888246f1af4d Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Thu, 6 Mar 2025 17:54:03 +0100
Subject: [PATCH 7/9] merge

---
 pnpm-lock.yaml | 473 +++++++++++++++++++------------------------------
 1 file changed, 184 insertions(+), 289 deletions(-)

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f7700cd65f85..c687db12d4a9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,7 +13,7 @@ importers:
         version: 2.27.8
       '@sveltejs/eslint-config':
         specifier: ^8.1.0
-        version: 8.1.0(@stylistic/eslint-plugin-js@1.8.0(eslint@9.9.1))(eslint-config-prettier@9.1.0(eslint@9.9.1))(eslint-plugin-n@17.9.0(eslint@9.9.1))(eslint-plugin-svelte@2.38.0(eslint@9.9.1)(svelte@packages+svelte))(eslint@9.9.1)(typescript-eslint@8.2.0(eslint@9.9.1)(typescript@5.5.4))(typescript@5.5.4)
+        version: 8.1.0(@stylistic/eslint-plugin-js@1.8.0(eslint@9.9.1))(eslint-config-prettier@9.1.0(eslint@9.9.1))(eslint-plugin-n@17.16.1(eslint@9.9.1)(typescript@5.5.4))(eslint-plugin-svelte@2.38.0(eslint@9.9.1)(svelte@packages+svelte))(eslint@9.9.1)(typescript-eslint@8.26.0(eslint@9.9.1)(typescript@5.5.4))(typescript@5.5.4)
       '@svitejs/changesets-changelog-github-compact':
         specifier: ^1.1.0
         version: 1.1.0
@@ -48,8 +48,8 @@ importers:
         specifier: ^5.5.4
         version: 5.5.4
       typescript-eslint:
-        specifier: ^8.2.0
-        version: 8.2.0(eslint@9.9.1)(typescript@5.5.4)
+        specifier: ^8.24.0
+        version: 8.26.0(eslint@9.9.1)(typescript@5.5.4)
       v8-natives:
         specifier: ^1.2.5
         version: 1.2.5
@@ -65,15 +65,15 @@ importers:
       '@jridgewell/sourcemap-codec':
         specifier: ^1.5.0
         version: 1.5.0
+      '@sveltejs/acorn-typescript':
+        specifier: ^1.0.5
+        version: 1.0.5(acorn@8.14.0)
       '@types/estree':
         specifier: ^1.0.5
         version: 1.0.6
       acorn:
         specifier: ^8.12.1
-        version: 8.12.1
-      acorn-typescript:
-        specifier: ^1.4.13
-        version: 1.4.13(acorn@8.12.1)
+        version: 8.14.0
       aria-query:
         specifier: ^5.3.1
         version: 5.3.1
@@ -97,7 +97,7 @@ importers:
         version: 3.0.0
       magic-string:
         specifier: ^0.30.11
-        version: 0.30.11
+        version: 0.30.17
       zimmerframe:
         specifier: ^1.1.2
         version: 1.1.2
@@ -127,8 +127,8 @@ importers:
         specifier: ^20.11.5
         version: 20.12.7
       dts-buddy:
-        specifier: ^0.5.3
-        version: 0.5.3(typescript@5.5.4)
+        specifier: ^0.5.5
+        version: 0.5.5(typescript@5.5.4)
       esbuild:
         specifier: ^0.21.5
         version: 0.21.5
@@ -138,9 +138,9 @@ importers:
       source-map:
         specifier: ^0.7.4
         version: 0.7.4
-      tiny-glob:
-        specifier: ^0.2.9
-        version: 0.2.9
+      tinyglobby:
+        specifier: ^0.2.12
+        version: 0.2.12
       typescript:
         specifier: ^5.5.4
         version: 5.5.4
@@ -159,9 +159,9 @@ importers:
       svelte:
         specifier: workspace:*
         version: link:../../packages/svelte
-      tiny-glob:
-        specifier: ^0.2.9
-        version: 0.2.9
+      tinyglobby:
+        specifier: ^0.2.12
+        version: 0.2.12
       vite:
         specifier: ^5.4.14
         version: 5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
@@ -402,22 +402,12 @@ packages:
     cpu: [x64]
     os: [win32]
 
-  '@eslint-community/eslint-utils@4.4.0':
-    resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
-    peerDependencies:
-      eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
-
   '@eslint-community/eslint-utils@4.4.1':
     resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
       eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
 
-  '@eslint-community/regexpp@4.11.0':
-    resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==}
-    engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
-
   '@eslint-community/regexpp@4.12.1':
     resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
     engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
@@ -636,6 +626,11 @@ packages:
     peerDependencies:
       eslint: '>=8.40.0'
 
+  '@sveltejs/acorn-typescript@1.0.5':
+    resolution: {integrity: sha512-IwQk4yfwLdibDlrXVE04jTZYlLnwsTT2PIOQQGNLWfjavGifnk1JD1LcZjZaBTRcxZu2FfPfNLOE04DSu9lqtQ==}
+    peerDependencies:
+      acorn: ^8.9.0
+
   '@sveltejs/eslint-config@8.1.0':
     resolution: {integrity: sha512-cfgp4lPREYBjNd4ZzaP/jA85ufm7vfXiaV7h9vILXNogne80IbZRNhRCQ8XoOqTAOY/pChIzWTBuR8aDNMbAEA==}
     peerDependencies:
@@ -693,61 +688,51 @@ packages:
   '@types/semver@7.5.6':
     resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==}
 
-  '@typescript-eslint/eslint-plugin@8.2.0':
-    resolution: {integrity: sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==}
+  '@typescript-eslint/eslint-plugin@8.26.0':
+    resolution: {integrity: sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
       '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
       eslint: ^8.57.0 || ^9.0.0
-      typescript: '*'
-    peerDependenciesMeta:
-      typescript:
-        optional: true
+      typescript: '>=4.8.4 <5.9.0'
 
-  '@typescript-eslint/parser@8.2.0':
-    resolution: {integrity: sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==}
+  '@typescript-eslint/parser@8.26.0':
+    resolution: {integrity: sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
       eslint: ^8.57.0 || ^9.0.0
-      typescript: '*'
-    peerDependenciesMeta:
-      typescript:
-        optional: true
+      typescript: '>=4.8.4 <5.9.0'
 
-  '@typescript-eslint/scope-manager@8.2.0':
-    resolution: {integrity: sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==}
+  '@typescript-eslint/scope-manager@8.26.0':
+    resolution: {integrity: sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
-  '@typescript-eslint/type-utils@8.2.0':
-    resolution: {integrity: sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==}
+  '@typescript-eslint/type-utils@8.26.0':
+    resolution: {integrity: sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      typescript: '*'
-    peerDependenciesMeta:
-      typescript:
-        optional: true
+      eslint: ^8.57.0 || ^9.0.0
+      typescript: '>=4.8.4 <5.9.0'
 
-  '@typescript-eslint/types@8.2.0':
-    resolution: {integrity: sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==}
+  '@typescript-eslint/types@8.26.0':
+    resolution: {integrity: sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
-  '@typescript-eslint/typescript-estree@8.2.0':
-    resolution: {integrity: sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==}
+  '@typescript-eslint/typescript-estree@8.26.0':
+    resolution: {integrity: sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      typescript: '*'
-    peerDependenciesMeta:
-      typescript:
-        optional: true
+      typescript: '>=4.8.4 <5.9.0'
 
-  '@typescript-eslint/utils@8.2.0':
-    resolution: {integrity: sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==}
+  '@typescript-eslint/utils@8.26.0':
+    resolution: {integrity: sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
       eslint: ^8.57.0 || ^9.0.0
+      typescript: '>=4.8.4 <5.9.0'
 
-  '@typescript-eslint/visitor-keys@8.2.0':
-    resolution: {integrity: sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==}
+  '@typescript-eslint/visitor-keys@8.26.0':
+    resolution: {integrity: sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
   '@vitest/coverage-v8@2.0.5':
@@ -789,16 +774,6 @@ packages:
     peerDependencies:
       acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
 
-  acorn-typescript@1.4.13:
-    resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==}
-    peerDependencies:
-      acorn: '>=8.9.0'
-
-  acorn@8.12.1:
-    resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==}
-    engines: {node: '>=0.4.0'}
-    hasBin: true
-
   acorn@8.14.0:
     resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
     engines: {node: '>=0.4.0'}
@@ -877,10 +852,6 @@ packages:
   brace-expansion@2.0.1:
     resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
 
-  braces@3.0.2:
-    resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
-    engines: {node: '>=8'}
-
   braces@3.0.3:
     resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
     engines: {node: '>=8'}
@@ -945,7 +916,7 @@ packages:
     resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
 
   concat-map@0.0.1:
-    resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+    resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
 
   cross-spawn@5.1.0:
     resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==}
@@ -970,15 +941,6 @@ packages:
   dataloader@1.4.0:
     resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
 
-  debug@4.3.6:
-    resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==}
-    engines: {node: '>=6.0'}
-    peerDependencies:
-      supports-color: '*'
-    peerDependenciesMeta:
-      supports-color:
-        optional: true
-
   debug@4.4.0:
     resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
     engines: {node: '>=6.0'}
@@ -1035,11 +997,11 @@ packages:
     resolution: {integrity: sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==}
     engines: {node: '>=12'}
 
-  dts-buddy@0.5.3:
-    resolution: {integrity: sha512-wS2DC5T+F6R+sG/YNlJ21yn8CKVhy1QQlpKA34G+uO4PUXkwz+JQWbGcIryUByxoJgbH98O0dTGzE2RqsRR3KA==}
+  dts-buddy@0.5.5:
+    resolution: {integrity: sha512-Mu5PJuP7C+EqZIwDtW/bG1tVli1UFhRIyW/dERBVBYk28OviTkribu9S2LpDQ0HF2MbkqnjQIkbbE6HnepdNTQ==}
     hasBin: true
     peerDependencies:
-      typescript: '>=5.0.4 <5.6'
+      typescript: '>=5.0.4 <5.8'
 
   eastasianwidth@0.2.0:
     resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
@@ -1098,8 +1060,8 @@ packages:
   eslint-plugin-lube@0.4.3:
     resolution: {integrity: sha512-BVO83tRo090d6a04cl45Gb761SD79cOT6wKxxWrpsH7Rv8I0SJvc79ijE11vvyxxCMiGUVq/w4NqqPJAHyYfSQ==}
 
-  eslint-plugin-n@17.9.0:
-    resolution: {integrity: sha512-CPSaXDXdrT4nsrOrO4mT4VB6FMUkoySRkHWuuJJHVqsIEjIeZgMY1H7AzSwPbDScikBmLN82KeM1u7ixV7PzGg==}
+  eslint-plugin-n@17.16.1:
+    resolution: {integrity: sha512-/7FVAwjUrix9P5lycnsYRIQRwFo/DZROD+ZXWLpE+/EZWLyuLvyFaRdAPYJSz+nlAdZIZp+LAzlBerQSVYUNFg==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
       eslint: '>=8.23.0'
@@ -1126,8 +1088,8 @@ packages:
     resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
 
-  eslint-visitor-keys@4.0.0:
-    resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==}
+  eslint-visitor-keys@4.2.0:
+    resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
   eslint@9.9.1:
@@ -1208,8 +1170,8 @@ packages:
   fastq@1.16.0:
     resolution: {integrity: sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==}
 
-  fdir@6.3.0:
-    resolution: {integrity: sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==}
+  fdir@6.4.3:
+    resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==}
     peerDependencies:
       picomatch: ^3 || ^4
     peerDependenciesMeta:
@@ -1220,10 +1182,6 @@ packages:
     resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==}
     engines: {node: '>=16.0.0'}
 
-  fill-range@7.0.1:
-    resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
-    engines: {node: '>=8'}
-
   fill-range@7.1.1:
     resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
     engines: {node: '>=8'}
@@ -1299,20 +1257,10 @@ packages:
     resolution: {integrity: sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==}
     engines: {node: '>=18'}
 
-  globals@15.9.0:
-    resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==}
-    engines: {node: '>=18'}
-
-  globalyzer@0.1.0:
-    resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
-
   globby@11.1.0:
     resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
     engines: {node: '>=10'}
 
-  globrex@0.1.2:
-    resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
-
   graceful-fs@4.2.11:
     resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
 
@@ -1585,9 +1533,6 @@ packages:
   lru-cache@4.1.5:
     resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
 
-  magic-string@0.30.11:
-    resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==}
-
   magic-string@0.30.17:
     resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
 
@@ -1614,6 +1559,10 @@ packages:
     resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
     engines: {node: '>= 0.6'}
 
+  minimatch@10.0.1:
+    resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
+    engines: {node: 20 || >=22}
+
   minimatch@3.1.2:
     resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
 
@@ -1633,17 +1582,9 @@ packages:
     resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==}
     engines: {node: '>=10'}
 
-  ms@2.1.2:
-    resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
-
   ms@2.1.3:
     resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
 
-  nanoid@3.3.7:
-    resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
-    engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
-    hasBin: true
-
   nanoid@3.3.8:
     resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==}
     engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -1753,9 +1694,6 @@ packages:
   perfect-debounce@1.0.0:
     resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
 
-  picocolors@1.1.0:
-    resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==}
-
   picocolors@1.1.1:
     resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
 
@@ -1813,10 +1751,6 @@ packages:
     resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}
     engines: {node: '>=4'}
 
-  postcss@8.4.47:
-    resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==}
-    engines: {node: ^10 || ^12 || >=14}
-
   postcss@8.5.1:
     resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==}
     engines: {node: ^10 || ^12 || >=14}
@@ -1922,11 +1856,6 @@ packages:
     resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
     engines: {node: '>=v12.22.7'}
 
-  semver@7.6.3:
-    resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}
-    engines: {node: '>=10'}
-    hasBin: true
-
   semver@7.7.1:
     resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==}
     engines: {node: '>=10'}
@@ -1996,9 +1925,6 @@ packages:
   stackback@0.0.2:
     resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
 
-  std-env@3.7.0:
-    resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==}
-
   std-env@3.8.0:
     resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==}
 
@@ -2066,15 +1992,16 @@ packages:
   text-table@0.2.0:
     resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
 
-  tiny-glob@0.2.9:
-    resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
-
   tinybench@2.9.0:
     resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
 
   tinyexec@0.3.2:
     resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
 
+  tinyglobby@0.2.12:
+    resolution: {integrity: sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==}
+    engines: {node: '>=12.0.0'}
+
   tinypool@1.0.2:
     resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}
     engines: {node: ^18.0.0 || >=20.0.0}
@@ -2131,18 +2058,27 @@ packages:
     peerDependencies:
       typescript: '>=4.2.0'
 
+  ts-api-utils@2.0.1:
+    resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==}
+    engines: {node: '>=18.12'}
+    peerDependencies:
+      typescript: '>=4.8.4'
+
+  ts-declaration-location@1.0.5:
+    resolution: {integrity: sha512-WqmlO9IoeYwCqJ2E9kHMcY9GZhhfLYItC3VnHDlPOrg6nNdUWS4wn4hhDZUPt60m1EvtjPIZyprTjpI992Bgzw==}
+    peerDependencies:
+      typescript: '>=4.0.0'
+
   type-check@0.4.0:
     resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
     engines: {node: '>= 0.8.0'}
 
-  typescript-eslint@8.2.0:
-    resolution: {integrity: sha512-DmnqaPcML0xYwUzgNbM1XaKXpEb7BShYf2P1tkUmmcl8hyeG7Pj08Er7R9bNy6AufabywzJcOybQAtnD/c9DGw==}
+  typescript-eslint@8.26.0:
+    resolution: {integrity: sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==}
     engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      typescript: '*'
-    peerDependenciesMeta:
-      typescript:
-        optional: true
+      eslint: ^8.57.0 || ^9.0.0
+      typescript: '>=4.8.4 <5.9.0'
 
   typescript@5.5.4:
     resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==}
@@ -2375,7 +2311,7 @@ snapshots:
       outdent: 0.5.0
       prettier: 2.8.8
       resolve-from: 5.0.0
-      semver: 7.6.3
+      semver: 7.7.1
 
   '@changesets/assemble-release-plan@6.0.4':
     dependencies:
@@ -2384,7 +2320,7 @@ snapshots:
       '@changesets/should-skip-package': 0.1.1
       '@changesets/types': 6.0.0
       '@manypkg/get-packages': 1.1.3
-      semver: 7.6.3
+      semver: 7.7.1
 
   '@changesets/changelog-git@0.2.0':
     dependencies:
@@ -2417,9 +2353,9 @@ snapshots:
       outdent: 0.5.0
       p-limit: 2.3.0
       package-manager-detector: 0.2.0
-      picocolors: 1.1.0
+      picocolors: 1.1.1
       resolve-from: 5.0.0
-      semver: 7.6.3
+      semver: 7.7.1
       spawndamnit: 2.0.0
       term-size: 2.2.1
 
@@ -2441,8 +2377,8 @@ snapshots:
     dependencies:
       '@changesets/types': 6.0.0
       '@manypkg/get-packages': 1.1.3
-      picocolors: 1.1.0
-      semver: 7.6.3
+      picocolors: 1.1.1
+      semver: 7.7.1
 
   '@changesets/get-github-info@0.5.2':
     dependencies:
@@ -2472,7 +2408,7 @@ snapshots:
 
   '@changesets/logger@0.1.1':
     dependencies:
-      picocolors: 1.1.0
+      picocolors: 1.1.1
 
   '@changesets/parse@0.4.0':
     dependencies:
@@ -2494,7 +2430,7 @@ snapshots:
       '@changesets/types': 6.0.0
       fs-extra: 7.0.1
       p-filter: 2.1.0
-      picocolors: 1.1.0
+      picocolors: 1.1.1
 
   '@changesets/should-skip-package@0.1.1':
     dependencies:
@@ -2581,18 +2517,11 @@ snapshots:
   '@esbuild/win32-x64@0.21.5':
     optional: true
 
-  '@eslint-community/eslint-utils@4.4.0(eslint@9.9.1)':
-    dependencies:
-      eslint: 9.9.1
-      eslint-visitor-keys: 3.4.3
-
   '@eslint-community/eslint-utils@4.4.1(eslint@9.9.1)':
     dependencies:
       eslint: 9.9.1
       eslint-visitor-keys: 3.4.3
 
-  '@eslint-community/regexpp@4.11.0': {}
-
   '@eslint-community/regexpp@4.12.1': {}
 
   '@eslint/config-array@0.18.0':
@@ -2700,9 +2629,9 @@ snapshots:
       '@rollup/pluginutils': 5.1.0(rollup@4.22.4)
       commondir: 1.0.1
       estree-walker: 2.0.2
-      fdir: 6.3.0(picomatch@4.0.2)
+      fdir: 6.4.3(picomatch@4.0.2)
       is-reference: 1.2.1
-      magic-string: 0.30.11
+      magic-string: 0.30.17
       picomatch: 4.0.2
     optionalDependencies:
       rollup: 4.22.4
@@ -2794,21 +2723,25 @@ snapshots:
       eslint-visitor-keys: 3.4.3
       espree: 9.6.1
 
-  '@sveltejs/eslint-config@8.1.0(@stylistic/eslint-plugin-js@1.8.0(eslint@9.9.1))(eslint-config-prettier@9.1.0(eslint@9.9.1))(eslint-plugin-n@17.9.0(eslint@9.9.1))(eslint-plugin-svelte@2.38.0(eslint@9.9.1)(svelte@packages+svelte))(eslint@9.9.1)(typescript-eslint@8.2.0(eslint@9.9.1)(typescript@5.5.4))(typescript@5.5.4)':
+  '@sveltejs/acorn-typescript@1.0.5(acorn@8.14.0)':
+    dependencies:
+      acorn: 8.14.0
+
+  '@sveltejs/eslint-config@8.1.0(@stylistic/eslint-plugin-js@1.8.0(eslint@9.9.1))(eslint-config-prettier@9.1.0(eslint@9.9.1))(eslint-plugin-n@17.16.1(eslint@9.9.1)(typescript@5.5.4))(eslint-plugin-svelte@2.38.0(eslint@9.9.1)(svelte@packages+svelte))(eslint@9.9.1)(typescript-eslint@8.26.0(eslint@9.9.1)(typescript@5.5.4))(typescript@5.5.4)':
     dependencies:
       '@stylistic/eslint-plugin-js': 1.8.0(eslint@9.9.1)
       eslint: 9.9.1
       eslint-config-prettier: 9.1.0(eslint@9.9.1)
-      eslint-plugin-n: 17.9.0(eslint@9.9.1)
+      eslint-plugin-n: 17.16.1(eslint@9.9.1)(typescript@5.5.4)
       eslint-plugin-svelte: 2.38.0(eslint@9.9.1)(svelte@packages+svelte)
-      globals: 15.9.0
+      globals: 15.14.0
       typescript: 5.5.4
-      typescript-eslint: 8.2.0(eslint@9.9.1)(typescript@5.5.4)
+      typescript-eslint: 8.26.0(eslint@9.9.1)(typescript@5.5.4)
 
   '@sveltejs/vite-plugin-svelte-inspector@3.0.0-next.2(@sveltejs/vite-plugin-svelte@4.0.0-next.6(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))':
     dependencies:
       '@sveltejs/vite-plugin-svelte': 4.0.0-next.6(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))
-      debug: 4.3.6
+      debug: 4.4.0
       svelte: link:packages/svelte
       vite: 5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
     transitivePeerDependencies:
@@ -2817,10 +2750,10 @@ snapshots:
   '@sveltejs/vite-plugin-svelte@4.0.0-next.6(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))':
     dependencies:
       '@sveltejs/vite-plugin-svelte-inspector': 3.0.0-next.2(@sveltejs/vite-plugin-svelte@4.0.0-next.6(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))
-      debug: 4.3.6
+      debug: 4.4.0
       deepmerge: 4.3.1
       kleur: 4.1.5
-      magic-string: 0.30.11
+      magic-string: 0.30.17
       svelte: link:packages/svelte
       vite: 5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
       vitefu: 0.2.5(vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))
@@ -2857,99 +2790,95 @@ snapshots:
 
   '@types/semver@7.5.6': {}
 
-  '@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4)':
+  '@typescript-eslint/eslint-plugin@8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4)':
     dependencies:
-      '@eslint-community/regexpp': 4.11.0
-      '@typescript-eslint/parser': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
-      '@typescript-eslint/scope-manager': 8.2.0
-      '@typescript-eslint/type-utils': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
-      '@typescript-eslint/utils': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
-      '@typescript-eslint/visitor-keys': 8.2.0
+      '@eslint-community/regexpp': 4.12.1
+      '@typescript-eslint/parser': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/scope-manager': 8.26.0
+      '@typescript-eslint/type-utils': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/utils': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/visitor-keys': 8.26.0
       eslint: 9.9.1
       graphemer: 1.4.0
       ignore: 5.3.2
       natural-compare: 1.4.0
-      ts-api-utils: 1.3.0(typescript@5.5.4)
-    optionalDependencies:
+      ts-api-utils: 2.0.1(typescript@5.5.4)
       typescript: 5.5.4
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/parser@8.2.0(eslint@9.9.1)(typescript@5.5.4)':
+  '@typescript-eslint/parser@8.26.0(eslint@9.9.1)(typescript@5.5.4)':
     dependencies:
-      '@typescript-eslint/scope-manager': 8.2.0
-      '@typescript-eslint/types': 8.2.0
-      '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
-      '@typescript-eslint/visitor-keys': 8.2.0
+      '@typescript-eslint/scope-manager': 8.26.0
+      '@typescript-eslint/types': 8.26.0
+      '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.5.4)
+      '@typescript-eslint/visitor-keys': 8.26.0
       debug: 4.4.0
       eslint: 9.9.1
-    optionalDependencies:
       typescript: 5.5.4
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/scope-manager@8.2.0':
+  '@typescript-eslint/scope-manager@8.26.0':
     dependencies:
-      '@typescript-eslint/types': 8.2.0
-      '@typescript-eslint/visitor-keys': 8.2.0
+      '@typescript-eslint/types': 8.26.0
+      '@typescript-eslint/visitor-keys': 8.26.0
 
-  '@typescript-eslint/type-utils@8.2.0(eslint@9.9.1)(typescript@5.5.4)':
+  '@typescript-eslint/type-utils@8.26.0(eslint@9.9.1)(typescript@5.5.4)':
     dependencies:
-      '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
-      '@typescript-eslint/utils': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.5.4)
+      '@typescript-eslint/utils': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
       debug: 4.4.0
-      ts-api-utils: 1.3.0(typescript@5.5.4)
-    optionalDependencies:
+      eslint: 9.9.1
+      ts-api-utils: 2.0.1(typescript@5.5.4)
       typescript: 5.5.4
     transitivePeerDependencies:
-      - eslint
       - supports-color
 
-  '@typescript-eslint/types@8.2.0': {}
+  '@typescript-eslint/types@8.26.0': {}
 
-  '@typescript-eslint/typescript-estree@8.2.0(typescript@5.5.4)':
+  '@typescript-eslint/typescript-estree@8.26.0(typescript@5.5.4)':
     dependencies:
-      '@typescript-eslint/types': 8.2.0
-      '@typescript-eslint/visitor-keys': 8.2.0
+      '@typescript-eslint/types': 8.26.0
+      '@typescript-eslint/visitor-keys': 8.26.0
       debug: 4.4.0
-      globby: 11.1.0
+      fast-glob: 3.3.2
       is-glob: 4.0.3
       minimatch: 9.0.5
-      semver: 7.6.3
-      ts-api-utils: 1.3.0(typescript@5.5.4)
-    optionalDependencies:
+      semver: 7.7.1
+      ts-api-utils: 2.0.1(typescript@5.5.4)
       typescript: 5.5.4
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/utils@8.2.0(eslint@9.9.1)(typescript@5.5.4)':
+  '@typescript-eslint/utils@8.26.0(eslint@9.9.1)(typescript@5.5.4)':
     dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1)
-      '@typescript-eslint/scope-manager': 8.2.0
-      '@typescript-eslint/types': 8.2.0
-      '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
+      '@eslint-community/eslint-utils': 4.4.1(eslint@9.9.1)
+      '@typescript-eslint/scope-manager': 8.26.0
+      '@typescript-eslint/types': 8.26.0
+      '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.5.4)
       eslint: 9.9.1
+      typescript: 5.5.4
     transitivePeerDependencies:
       - supports-color
-      - typescript
 
-  '@typescript-eslint/visitor-keys@8.2.0':
+  '@typescript-eslint/visitor-keys@8.26.0':
     dependencies:
-      '@typescript-eslint/types': 8.2.0
-      eslint-visitor-keys: 3.4.3
+      '@typescript-eslint/types': 8.26.0
+      eslint-visitor-keys: 4.2.0
 
   '@vitest/coverage-v8@2.0.5(vitest@2.1.9(@types/node@20.12.7)(jsdom@25.0.1)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))':
     dependencies:
       '@ampproject/remapping': 2.3.0
       '@bcoe/v8-coverage': 0.2.3
-      debug: 4.3.6
+      debug: 4.4.0
       istanbul-lib-coverage: 3.2.2
       istanbul-lib-report: 3.0.1
       istanbul-lib-source-maps: 5.0.6
       istanbul-reports: 3.1.7
-      magic-string: 0.30.11
+      magic-string: 0.30.17
       magicast: 0.3.4
-      std-env: 3.7.0
+      std-env: 3.8.0
       test-exclude: 7.0.1
       tinyrainbow: 1.2.0
       vitest: 2.1.9(@types/node@20.12.7)(jsdom@25.0.1)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
@@ -2996,20 +2925,10 @@ snapshots:
       loupe: 3.1.3
       tinyrainbow: 1.2.0
 
-  acorn-jsx@5.3.2(acorn@8.12.1):
-    dependencies:
-      acorn: 8.12.1
-
   acorn-jsx@5.3.2(acorn@8.14.0):
     dependencies:
       acorn: 8.14.0
 
-  acorn-typescript@1.4.13(acorn@8.12.1):
-    dependencies:
-      acorn: 8.12.1
-
-  acorn@8.12.1: {}
-
   acorn@8.14.0: {}
 
   agent-base@7.1.1:
@@ -3077,14 +2996,9 @@ snapshots:
     dependencies:
       balanced-match: 1.0.2
 
-  braces@3.0.2:
-    dependencies:
-      fill-range: 7.0.1
-
   braces@3.0.3:
     dependencies:
       fill-range: 7.1.1
-    optional: true
 
   buffer-from@1.1.2: {}
 
@@ -3171,10 +3085,6 @@ snapshots:
 
   dataloader@1.4.0: {}
 
-  debug@4.3.6:
-    dependencies:
-      ms: 2.1.2
-
   debug@4.4.0:
     dependencies:
       ms: 2.1.3
@@ -3209,16 +3119,15 @@ snapshots:
 
   dotenv@16.3.2: {}
 
-  dts-buddy@0.5.3(typescript@5.5.4):
+  dts-buddy@0.5.5(typescript@5.5.4):
     dependencies:
       '@jridgewell/source-map': 0.3.6
       '@jridgewell/sourcemap-codec': 1.5.0
-      globrex: 0.1.2
       kleur: 4.1.5
       locate-character: 3.0.0
-      magic-string: 0.30.11
+      magic-string: 0.30.17
       sade: 1.8.1
-      tiny-glob: 0.2.9
+      tinyglobby: 0.2.12
       ts-api-utils: 1.3.0(typescript@5.5.4)
       typescript: 5.5.4
 
@@ -3290,9 +3199,10 @@ snapshots:
 
   eslint-plugin-lube@0.4.3: {}
 
-  eslint-plugin-n@17.9.0(eslint@9.9.1):
+  eslint-plugin-n@17.16.1(eslint@9.9.1)(typescript@5.5.4):
     dependencies:
       '@eslint-community/eslint-utils': 4.4.1(eslint@9.9.1)
+      '@typescript-eslint/utils': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
       enhanced-resolve: 5.18.1
       eslint: 9.9.1
       eslint-plugin-es-x: 7.8.0(eslint@9.9.1)
@@ -3301,6 +3211,10 @@ snapshots:
       ignore: 5.3.2
       minimatch: 9.0.5
       semver: 7.7.1
+      ts-declaration-location: 1.0.5(typescript@5.5.4)
+    transitivePeerDependencies:
+      - supports-color
+      - typescript
 
   eslint-plugin-svelte@2.38.0(eslint@9.9.1)(svelte@packages+svelte):
     dependencies:
@@ -3335,12 +3249,12 @@ snapshots:
 
   eslint-visitor-keys@3.4.3: {}
 
-  eslint-visitor-keys@4.0.0: {}
+  eslint-visitor-keys@4.2.0: {}
 
   eslint@9.9.1:
     dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1)
-      '@eslint-community/regexpp': 4.11.0
+      '@eslint-community/eslint-utils': 4.4.1(eslint@9.9.1)
+      '@eslint-community/regexpp': 4.12.1
       '@eslint/config-array': 0.18.0
       '@eslint/eslintrc': 3.1.0
       '@eslint/js': 9.9.1
@@ -3350,10 +3264,10 @@ snapshots:
       ajv: 6.12.6
       chalk: 4.1.2
       cross-spawn: 7.0.3
-      debug: 4.3.6
+      debug: 4.4.0
       escape-string-regexp: 4.0.0
       eslint-scope: 8.0.2
-      eslint-visitor-keys: 4.0.0
+      eslint-visitor-keys: 4.2.0
       espree: 10.1.0
       esquery: 1.5.0
       esutils: 2.0.3
@@ -3380,9 +3294,9 @@ snapshots:
 
   espree@10.1.0:
     dependencies:
-      acorn: 8.12.1
-      acorn-jsx: 5.3.2(acorn@8.12.1)
-      eslint-visitor-keys: 4.0.0
+      acorn: 8.14.0
+      acorn-jsx: 5.3.2(acorn@8.14.0)
+      eslint-visitor-keys: 4.2.0
 
   espree@9.6.1:
     dependencies:
@@ -3442,7 +3356,7 @@ snapshots:
     dependencies:
       reusify: 1.0.4
 
-  fdir@6.3.0(picomatch@4.0.2):
+  fdir@6.4.3(picomatch@4.0.2):
     optionalDependencies:
       picomatch: 4.0.2
 
@@ -3450,14 +3364,9 @@ snapshots:
     dependencies:
       flat-cache: 4.0.1
 
-  fill-range@7.0.1:
-    dependencies:
-      to-regex-range: 5.0.1
-
   fill-range@7.1.1:
     dependencies:
       to-regex-range: 5.0.1
-    optional: true
 
   find-up@4.1.0:
     dependencies:
@@ -3538,10 +3447,6 @@ snapshots:
 
   globals@15.14.0: {}
 
-  globals@15.9.0: {}
-
-  globalyzer@0.1.0: {}
-
   globby@11.1.0:
     dependencies:
       array-union: 2.1.0
@@ -3551,8 +3456,6 @@ snapshots:
       merge2: 1.4.1
       slash: 3.0.0
 
-  globrex@0.1.2: {}
-
   graceful-fs@4.2.11: {}
 
   graphemer@1.4.0: {}
@@ -3816,10 +3719,6 @@ snapshots:
       pseudomap: 1.0.2
       yallist: 2.1.2
 
-  magic-string@0.30.11:
-    dependencies:
-      '@jridgewell/sourcemap-codec': 1.5.0
-
   magic-string@0.30.17:
     dependencies:
       '@jridgewell/sourcemap-codec': 1.5.0
@@ -3832,13 +3731,13 @@ snapshots:
 
   make-dir@4.0.0:
     dependencies:
-      semver: 7.6.3
+      semver: 7.7.1
 
   merge2@1.4.1: {}
 
   micromatch@4.0.5:
     dependencies:
-      braces: 3.0.2
+      braces: 3.0.3
       picomatch: 2.3.1
 
   mime-db@1.52.0: {}
@@ -3847,6 +3746,10 @@ snapshots:
     dependencies:
       mime-db: 1.52.0
 
+  minimatch@10.0.1:
+    dependencies:
+      brace-expansion: 2.0.1
+
   minimatch@3.1.2:
     dependencies:
       brace-expansion: 1.1.11
@@ -3861,12 +3764,8 @@ snapshots:
 
   mrmime@2.0.0: {}
 
-  ms@2.1.2: {}
-
   ms@2.1.3: {}
 
-  nanoid@3.3.7: {}
-
   nanoid@3.3.8: {}
 
   natural-compare@1.4.0: {}
@@ -3955,8 +3854,6 @@ snapshots:
 
   perfect-debounce@1.0.0: {}
 
-  picocolors@1.1.0: {}
-
   picocolors@1.1.1: {}
 
   picomatch@2.3.1: {}
@@ -3998,12 +3895,6 @@ snapshots:
       cssesc: 3.0.0
       util-deprecate: 1.0.2
 
-  postcss@8.4.47:
-    dependencies:
-      nanoid: 3.3.7
-      picocolors: 1.1.0
-      source-map-js: 1.2.1
-
   postcss@8.5.1:
     dependencies:
       nanoid: 3.3.8
@@ -4110,8 +4001,6 @@ snapshots:
     dependencies:
       xmlchars: 2.2.0
 
-  semver@7.6.3: {}
-
   semver@7.7.1: {}
 
   serialize-javascript@6.0.2:
@@ -4166,8 +4055,6 @@ snapshots:
 
   stackback@0.0.2: {}
 
-  std-env@3.7.0: {}
-
   std-env@3.8.0: {}
 
   string-width@4.2.3:
@@ -4219,7 +4106,7 @@ snapshots:
   terser@5.27.0:
     dependencies:
       '@jridgewell/source-map': 0.3.6
-      acorn: 8.12.1
+      acorn: 8.14.0
       commander: 2.20.3
       source-map-support: 0.5.21
 
@@ -4231,15 +4118,15 @@ snapshots:
 
   text-table@0.2.0: {}
 
-  tiny-glob@0.2.9:
-    dependencies:
-      globalyzer: 0.1.0
-      globrex: 0.1.2
-
   tinybench@2.9.0: {}
 
   tinyexec@0.3.2: {}
 
+  tinyglobby@0.2.12:
+    dependencies:
+      fdir: 6.4.3(picomatch@4.0.2)
+      picomatch: 4.0.2
+
   tinypool@1.0.2: {}
 
   tinyrainbow@1.2.0: {}
@@ -4282,19 +4169,27 @@ snapshots:
     dependencies:
       typescript: 5.5.4
 
+  ts-api-utils@2.0.1(typescript@5.5.4):
+    dependencies:
+      typescript: 5.5.4
+
+  ts-declaration-location@1.0.5(typescript@5.5.4):
+    dependencies:
+      minimatch: 10.0.1
+      typescript: 5.5.4
+
   type-check@0.4.0:
     dependencies:
       prelude-ls: 1.2.1
 
-  typescript-eslint@8.2.0(eslint@9.9.1)(typescript@5.5.4):
+  typescript-eslint@8.26.0(eslint@9.9.1)(typescript@5.5.4):
     dependencies:
-      '@typescript-eslint/eslint-plugin': 8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4)
-      '@typescript-eslint/parser': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
-      '@typescript-eslint/utils': 8.2.0(eslint@9.9.1)(typescript@5.5.4)
-    optionalDependencies:
+      '@typescript-eslint/eslint-plugin': 8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/parser': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
+      '@typescript-eslint/utils': 8.26.0(eslint@9.9.1)(typescript@5.5.4)
+      eslint: 9.9.1
       typescript: 5.5.4
     transitivePeerDependencies:
-      - eslint
       - supports-color
 
   typescript@5.5.4: {}
@@ -4335,12 +4230,12 @@ snapshots:
     dependencies:
       '@antfu/utils': 0.7.8
       '@rollup/pluginutils': 5.1.0(rollup@4.22.4)
-      debug: 4.3.6
+      debug: 4.4.0
       error-stack-parser-es: 0.1.1
       fs-extra: 11.2.0
       open: 10.1.0
       perfect-debounce: 1.0.0
-      picocolors: 1.1.0
+      picocolors: 1.1.1
       sirv: 2.0.4
       vite: 5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
     transitivePeerDependencies:
@@ -4350,7 +4245,7 @@ snapshots:
   vite@5.4.14(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0):
     dependencies:
       esbuild: 0.21.5
-      postcss: 8.4.47
+      postcss: 8.5.1
       rollup: 4.22.4
     optionalDependencies:
       '@types/node': 20.12.7

From 133598a4962f95b9a536a4dd97336f19de81cc44 Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Thu, 6 Mar 2025 17:55:11 +0100
Subject: [PATCH 8/9] remove unused

---
 packages/svelte/src/compiler/utils/builders.js | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/packages/svelte/src/compiler/utils/builders.js b/packages/svelte/src/compiler/utils/builders.js
index 91b2d6bbc2cf..ecb595d74dbd 100644
--- a/packages/svelte/src/compiler/utils/builders.js
+++ b/packages/svelte/src/compiler/utils/builders.js
@@ -89,24 +89,6 @@ export function block(body) {
 	return { type: 'BlockStatement', body };
 }
 
-/**
- * @param {ESTree.BlockStatement} block
- * @param {ESTree.Pattern | null} param
- * @param {ESTree.BlockStatement} catch_block
- * @returns {ESTree.TryStatement}
- */
-export function try_catch(block, param, catch_block) {
-	return {
-		type: 'TryStatement',
-		block,
-		handler: {
-			type: 'CatchClause',
-			param,
-			body: catch_block
-		}
-	};
-}
-
 /**
  * @param {string} name
  * @param {ESTree.Statement} body

From f64f43f22c2675ac50eb908c56b8a75ecc9aacca Mon Sep 17 00:00:00 2001
From: adiguba <frederic.martini@gmail.com>
Date: Thu, 6 Mar 2025 17:57:31 +0100
Subject: [PATCH 9/9] clean

---
 .../phases/3-transform/server/visitors/SvelteBoundary.js        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
index 3f06223d54bc..84c368e0791a 100644
--- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
+++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js
@@ -1,4 +1,4 @@
-/** @import { BlockStatement, Identifier, Statement, Expression, MaybeNamedFunctionDeclaration, Pattern } from 'estree' */
+/** @import { BlockStatement, Statement, Expression } from 'estree' */
 /** @import { AST } from '#compiler' */
 /** @import { ComponentContext } from '../types' */
 import * as b from '../../../../utils/builders.js';