From 06a2b76aa6e85121521e583f44a06fd4fb660b63 Mon Sep 17 00:00:00 2001 From: Jakob Rosenberg Date: Fri, 13 Sep 2024 00:29:06 +0200 Subject: [PATCH] perf: large props could cause lower performance --- lib/runtime/renderer/ComposeFragments.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/runtime/renderer/ComposeFragments.svelte b/lib/runtime/renderer/ComposeFragments.svelte index dbc2acc9..37e892c9 100644 --- a/lib/runtime/renderer/ComposeFragments.svelte +++ b/lib/runtime/renderer/ComposeFragments.svelte @@ -15,10 +15,12 @@ /** @type {RenderContextOptions} */ export let options + let oldOptions = null let optionsChangeCounter = 1 $: { - const jsonOptions = JSON.stringify(options) + const { props: _props, ...optionsWithoutProps } = options + const jsonOptions = JSON.stringify(optionsWithoutProps) optionsChangeCounter = jsonOptions !== oldOptions ? optionsChangeCounter + 1 : optionsChangeCounter oldOptions = jsonOptions