gbv / cocoda

A web-based tool for creating mappings between knowledge organization systems.
https://coli-conc.gbv.de/cocoda/
MIT License
39 stars 5 forks source link

Replace component functionality, mixins, and possibly store with Composition API #689

Open stefandesu opened 2 years ago

stefandesu commented 2 years ago

The Vue Composition API (plugin for Vue 2 which is already integrated into the project) makes reusing certain functionality very easy and easier to understand. If possible, I would like to move a lot of the current functionality in components, mixins, and the Vuex store to the Composition API. I think this would 1) reduce code duplication even further, 2) make the code easier to understand in many places, and 3) make future adjustments easier as well.

stefandesu commented 2 years ago

I've updated Vue.js to 2.7 which integrates the Composition API plugin. However, due to the upgrade, I noticed a message on the console:

[Vue warn]: Avoid using Array as root value for reactive() as it cannot be tracked in watch() or watchEffect(). Use ref() instead. This is a Vue-2-only limitation.

We're using arrays as root values for several things, including schemes and concordances. This also explains some issues I had with things not happening when schemes are updated. However, fixing this requires some more changes, so I'm noting this down here as another to-do item.