wegue
wegue copied to clipboard
Upgrade to Vue 3
Since "Vue 2 will reach End of Life (EOL) on December 31st, 2023" (see https://v2.vuejs.org/lts/) we should tackle the upgrade of the code base to Vue 3. Even tough offering different new concepts in Vue 3 one could stay at the classic component approach of Vue 2. So the upgrade effort should be OK besides the normal upgrade madness, but no complete re-write.
Hi team,
I have to tell I already looked at this last year as this was some sort of natural follow-up of migrating to the latest Vue-CLI
but what stopped me was the lack of compatibility of Vuetify
at that time.
From a completely personal point of view, I'm not looking at it for now neither because Vuetify3
still lacks some components which were available in V2. This would force me to stop upgrading Wegue
inside my main project which unfortunately makes use of some of those.
After some reading though, it seems there can be a possibility to upgrade Vue
only using the compat migration build
which could potentially still work with Vuetify2
. The migration build could then be entirely replaced by Vue3
once Vuetify
will be complete enough to be migrated too...
For the rest, as @chrismayer said, we should be able to stay with the Options API
and migrate without too much trouble, the main difficulty will be to replace the WguEventBus
as this way of working is not possible as is anymore. There exists some possibilities to reach the same behaviour like the excellent mitt for example.
the main difficulty will be to replace the
WguEventBus
in Vue 3 it is possible to store state like a map in composables or with the "official" state management library "pinia"
For sharing the map state across components in Vue 3, I find composables quite useful. Here a library with included demo project, that could be of interest of the next generation of Wegue:
- Repo: https://github.com/JakobMiksch/vue-ol-comp
- Demo App: https://jakobmiksch.github.io/vue-ol-comp/
- npm: https://www.npmjs.com/package/vue-ol-comp