This commit is contained in:
Andrew Kingston 2023-07-25 15:35:58 +01:00
parent b8bc25a39a
commit b82a34d7e1
6 changed files with 4 additions and 16 deletions

View File

@ -499,15 +499,9 @@
// Check if we already know if this key is used // Check if we already know if this key is used
let used = knownContextKeyMap[key] let used = knownContextKeyMap[key]
// If we don't know, check // If we don't know, check and cache
if (used == null) { if (used == null) {
// Check HBS used = bindingString.indexOf(`[${key}]`) !== -1
if (bindingString.indexOf(`[${key}]`) !== -1) {
used = true
} else {
used = false
}
// Cache result
knownContextKeyMap[key] = used knownContextKeyMap[key] = used
} }

View File

@ -8,10 +8,8 @@
export let actions export let actions
export let key export let key
// Clone and create new data context for this component tree
const context = getContext("context") const context = getContext("context")
const component = getContext("component") const component = getContext("component")
const providerKey = key || $component.id const providerKey = key || $component.id
// Generate a permanent unique ID for this component and use it to register // Generate a permanent unique ID for this component and use it to register

View File

@ -9,12 +9,10 @@ export const createContextStore = () => {
if (!providerId || data === undefined) { if (!providerId || data === undefined) {
return return
} }
// console.log(`[${providerId}]`, data)
context.update(state => { context.update(state => {
state[providerId] = data state[providerId] = data
return state return state
}) })
broadcastChange(providerId) broadcastChange(providerId)
} }
@ -31,7 +29,6 @@ export const createContextStore = () => {
const observeChanges = callback => { const observeChanges = callback => {
observers.push(callback) observers.push(callback)
return () => { return () => {
observers = observers.filter(cb => cb !== callback) observers = observers.filter(cb => cb !== callback)
} }

View File

@ -24,6 +24,5 @@ export const enrichDataBinding = async (input, context) => {
* Props are deeply cloned so that no mutation is done to the source object. * Props are deeply cloned so that no mutation is done to the source object.
*/ */
export const enrichDataBindings = (props, context) => { export const enrichDataBindings = (props, context) => {
console.log("enrich")
return processObjectSync(Helpers.cloneDeep(props), context, { cache: true }) return processObjectSync(Helpers.cloneDeep(props), context, { cache: true })
} }

View File

@ -48,7 +48,7 @@
"@apidevtools/swagger-parser": "10.0.3", "@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "0.0.0", "@budibase/backend-core": "0.0.0",
"@budibase/client": "0.0.0", "@budibase/client": "0.0.0",
"@budibase/pro": "0.0.0", "@budibase/pro": "develop",
"@budibase/shared-core": "0.0.0", "@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0", "@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0", "@budibase/types": "0.0.0",

View File

@ -39,7 +39,7 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "0.0.0", "@budibase/backend-core": "0.0.0",
"@budibase/pro": "0.0.0", "@budibase/pro": "develop",
"@budibase/string-templates": "0.0.0", "@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0", "@budibase/types": "0.0.0",
"@koa/router": "8.0.8", "@koa/router": "8.0.8",