From b82a34d7e14d06db72fb896f867c5ea29d0be81e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 25 Jul 2023 15:35:58 +0100 Subject: [PATCH] Tidy up --- packages/client/src/components/Component.svelte | 10 ++-------- packages/client/src/components/context/Provider.svelte | 2 -- packages/client/src/stores/context.js | 3 --- packages/client/src/utils/enrichDataBinding.js | 1 - packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index a17d637279..d55c23161c 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -499,15 +499,9 @@ // Check if we already know if this key is used let used = knownContextKeyMap[key] - // If we don't know, check + // If we don't know, check and cache if (used == null) { - // Check HBS - if (bindingString.indexOf(`[${key}]`) !== -1) { - used = true - } else { - used = false - } - // Cache result + used = bindingString.indexOf(`[${key}]`) !== -1 knownContextKeyMap[key] = used } diff --git a/packages/client/src/components/context/Provider.svelte b/packages/client/src/components/context/Provider.svelte index d0145da54b..b3e9d1e9fc 100644 --- a/packages/client/src/components/context/Provider.svelte +++ b/packages/client/src/components/context/Provider.svelte @@ -8,10 +8,8 @@ export let actions export let key - // Clone and create new data context for this component tree const context = getContext("context") const component = getContext("component") - const providerKey = key || $component.id // Generate a permanent unique ID for this component and use it to register diff --git a/packages/client/src/stores/context.js b/packages/client/src/stores/context.js index c1a2f67a8d..0363fbf7a6 100644 --- a/packages/client/src/stores/context.js +++ b/packages/client/src/stores/context.js @@ -9,12 +9,10 @@ export const createContextStore = () => { if (!providerId || data === undefined) { return } - // console.log(`[${providerId}]`, data) context.update(state => { state[providerId] = data return state }) - broadcastChange(providerId) } @@ -31,7 +29,6 @@ export const createContextStore = () => { const observeChanges = callback => { observers.push(callback) - return () => { observers = observers.filter(cb => cb !== callback) } diff --git a/packages/client/src/utils/enrichDataBinding.js b/packages/client/src/utils/enrichDataBinding.js index 9025a505d9..0f142ab297 100644 --- a/packages/client/src/utils/enrichDataBinding.js +++ b/packages/client/src/utils/enrichDataBinding.js @@ -24,6 +24,5 @@ export const enrichDataBinding = async (input, context) => { * Props are deeply cloned so that no mutation is done to the source object. */ export const enrichDataBindings = (props, context) => { - console.log("enrich") return processObjectSync(Helpers.cloneDeep(props), context, { cache: true }) } diff --git a/packages/server/package.json b/packages/server/package.json index 52f209a403..41a11008b8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -48,7 +48,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "0.0.0", "@budibase/client": "0.0.0", - "@budibase/pro": "0.0.0", + "@budibase/pro": "develop", "@budibase/shared-core": "0.0.0", "@budibase/string-templates": "0.0.0", "@budibase/types": "0.0.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 8d4844fa12..130713bbd5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -39,7 +39,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "0.0.0", - "@budibase/pro": "0.0.0", + "@budibase/pro": "develop", "@budibase/string-templates": "0.0.0", "@budibase/types": "0.0.0", "@koa/router": "8.0.8",