@live-change/vue3-ssr 0.2.24 → 0.2.26

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 +19 -9
  2. package/package.json +4 -4
package/Api.js CHANGED
@@ -61,7 +61,7 @@ class Api extends DaoProxy {
61
61
  const api = ref()
62
62
  this.apiObservable = this.observable(['metadata', 'api'])
63
63
  console.log("API OBSERVABLE", this.apiObservable)
64
- this.apiObservable.bindProperty(api, 'value')
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
 
@@ -117,7 +126,7 @@ class Api extends DaoProxy {
117
126
  api.uidGenerator = uidGenerator(
118
127
  apiInfo.client.user || (apiInfo.client.session ? apiInfo.client.session.slice(0, 16) : randomString(10) )
119
128
  , 1, '[]')
120
- //console.log("GENERATE API DEFINITIONS", definitions)
129
+ console.log("GENERATE API DEFINITIONS", definitions)
121
130
  api.servicesApiDefinitions = definitions
122
131
  api.servicesDefinitions.value = definitions
123
132
  let globalViews = {}
@@ -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.24",
3
+ "version": "0.2.26",
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.15",
25
- "@live-change/uid": "0.7.19",
24
+ "@live-change/dao-vue3": "0.5.18",
25
+ "@live-change/uid": "0.7.22",
26
26
  "@vueuse/core": "^9.1.0",
27
27
  "debug": "^4.3.4"
28
28
  },
29
- "gitHead": "a72f13ad9250c6dceac24c17bb02f6822ca8c456"
29
+ "gitHead": "8c4483211a03c919a16eca22ee6cbcda09cf6221"
30
30
  }