From adae9667699e91bee7df0a2a97a62350c666a974 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 6 Dec 2021 17:59:23 +0000 Subject: [PATCH] Remove legacy performance hack of remove _revs from component definitions as this was sometimes leading to invalid JSON, preventing the app from loading --- .../design/AppPreview/CurrentItemPreview.svelte | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 2bfed936dd..3dac5838aa 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -69,15 +69,7 @@ previewDevice: $store.previewDevice, messagePassing: $store.clientFeatures.messagePassing, } - - // Saving pages and screens to the DB causes them to have _revs. - // These revisions change every time a save happens and causes - // these reactive statements to fire, even though the actual - // definition hasn't changed. - // By deleting all _rev properties we can avoid this and increase - // performance. $: json = JSON.stringify(previewData) - $: strippedJson = json.replace(/"_rev":\s*"[^"]+"/g, `"_rev":""`) // Update the iframe with the builder info to render the correct preview const refreshContent = message => { @@ -87,7 +79,7 @@ } // Refresh the preview when required - $: refreshContent(strippedJson) + $: refreshContent(json) function receiveMessage(message) { const handlers = { @@ -102,7 +94,7 @@ if (!$store.clientFeatures.intelligentLoading) { loading = false } - refreshContent(strippedJson) + refreshContent(json) }, [MessageTypes.ERROR]: event => { // Catch any app errors