@live-change/vue3-ssr 0.2.25 → 0.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Api.js +20 -10
  2. package/package.json +4 -4
package/Api.js CHANGED
@@ -60,8 +60,8 @@ class Api extends DaoProxy {
60
60
  setupMetadata() {
61
61
  const api = ref()
62
62
  this.apiObservable = this.observable(['metadata', 'api'])
63
- console.log("API OBSERVABLE", this.apiObservable)
64
- this.apiObservable.bindProperty(api, 'value')
63
+ //console.log("API OBSERVABLE", this.apiObservable)
64
+ //this.apiObservable.bindProperty(api, 'value')
65
65
  const version = ref()
66
66
  this.versionObservable = this.observable(['version', 'version'])
67
67
  this.versionObservable.bindProperty(version, 'value')
@@ -77,19 +77,28 @@ class Api extends DaoProxy {
77
77
  const client = computed(() => {
78
78
  return api?.value?.client
79
79
  })
80
- watch(() => api.value, (api) => {
81
- //console.log("API CHANGE!", api)
82
- if(!api) return
83
- console.log("API CHANGE!"/*, api*/)
84
- this.generateServicesApi()
85
- })
86
- console.log("SETUP API", api.value)
87
80
  this.metadata = {
88
81
  api, version,
89
82
  softwareVersion,
90
83
  versionMismatch,
91
84
  client
92
85
  }
86
+ let lastApiJson = ''
87
+ this.apiObservable.observe((signal, ...args) => {
88
+ if(signal != 'set') return
89
+ //console.log("API OBSERVE SIGNAL", signal, ...args)
90
+ const newApi = args[0]
91
+ //console.log("NEW API", newApi)
92
+ if(JSON.stringify(newApi) == lastApiJson) {
93
+ console.log("API NOT CHANGED")
94
+ return
95
+ }
96
+ lastApiJson = JSON.stringify(newApi)
97
+ console.log("API CHANGED")
98
+ api.value = JSON.parse(lastApiJson)
99
+ this.generateServicesApi()
100
+ })
101
+ //console.log("SETUP API", api.value)
93
102
  this.afterPreFetch.push(() => this.generateServicesApi())
94
103
  }
95
104
 
@@ -110,7 +119,7 @@ class Api extends DaoProxy {
110
119
  }
111
120
  }
112
121
  //console.trace("GENERATE API SERVICES!")
113
- console.log("GENERATE SERVICES API", apiInfo)
122
+ //console.log("GENERATE SERVICES API", apiInfo)
114
123
  const definitions = [...(apiInfo?.services ?? []), ...(this.settings.localDefinitions ?? [])]
115
124
  if(JSON.stringify(definitions) == JSON.stringify(api.servicesApiDefinitions)) return
116
125
  if(!definitions) throw new Error("API DEFINITIONS NOT FOUND! UNABLE TO GENERATE API!")
@@ -127,6 +136,7 @@ class Api extends DaoProxy {
127
136
  let views = { }
128
137
  globalViews[serviceDefinition.name] = views
129
138
  for(const viewName in serviceDefinition.views) {
139
+ //console.log("GENERATE VIEW", serviceDefinition.name, viewName)
130
140
  views[viewName] = (params) => [serviceDefinition.name, viewName, params]
131
141
  views[viewName].definition = serviceDefinition.views[viewName]
132
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/vue3-ssr",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "description": "Live Change Framework - vue components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "homepage": "https://github.com/live-change/live-change-framework-vue3",
23
23
  "dependencies": {
24
- "@live-change/dao-vue3": "0.5.17",
25
- "@live-change/uid": "0.7.21",
24
+ "@live-change/dao-vue3": "0.5.20",
25
+ "@live-change/uid": "0.7.26",
26
26
  "@vueuse/core": "^9.1.0",
27
27
  "debug": "^4.3.4"
28
28
  },
29
- "gitHead": "78f33443348a3a1136e415226f130ce43277151d"
29
+ "gitHead": "26dd186b61f60f45ce683ee763c1d5cd369e977f"
30
30
  }