GenieFramework / Stipple.jl

The reactive UI library for interactive data applications with pure Julia.
MIT License
321 stars 27 forks source link

switch to Vue 3 #263

Closed hhaensel closed 4 months ago

hhaensel commented 7 months ago

This is the next effort to switch to Vue 3

I've built on top of previous commits by @AbhimanyuAryan and @essenciary, I included a new version for $withoutWatchers() from https://github.com/vuejs/vue/issues/1829#issuecomment-1468020315 and went through some additional migration changes. This version seems to work. I've not yet fully tested all details of the watcher but it's a next step.

The only part that I could not solve are the two components dashboard and big-numbers in stipplecore.js. It seems that Vue.component() needs to be replaced by app.component() or in our case window.GENIEMODEL.component(), however, at the point where this is called, the app has not yet been created.

@essenciary I think you should be pretty quick in finding the correct place to move these definitions to.

Happy to continue the Vue-3 journey. Next step is certainly Quasar-2 😄 - finally!

hhaensel commented 7 months ago

We may want to have a switch to chose the Vue version. Therefore I kept the old vue.js and vue.min.js in place.

hhaensel commented 7 months ago

Seems that the watchers solution doesn't work any longer, I'll dig a bit deeper.

hhaensel commented 7 months ago

I finally solved the watcher problem with this hint: https://github.com/vuejs/vue/issues/1829#issuecomment-1233817643. Should be even faster than the previous solution as we have direct ignoreUpdates functions for each watcher and don't have to filter the array of existing watchers for the name. Moreover, we can remove the manual addition of expressions to the watchers in prod-mode.

hhaensel commented 7 months ago

Finally moved the numberformat filter to a mixin, so we should be set.

AbhimanyuAryan commented 7 months ago

looks good @hhaensel I read "vue2 is dead" few days ago. I was worried about this myself :)

hhaensel commented 7 months ago

This PR works successfully with StippleUI#hh-vue3 and the latest Quasar 2, so the PR is open for review 😄