alpheios-project / alpheios-core

Alpheios Core Javascript Packages and Libraries
15 stars 2 forks source link

Vue 3 upgrade #471

Open kirlat opened 4 years ago

kirlat commented 4 years ago

I've tried to upgrade components to use Vue 3 and I would like to share my findings.

The Vue code requires some changes, but those are mostly minimal. Vue.extend() does not exist any more, but, for our purposes, we can probably replace it with createApp() (this is how a root Vue instance, now called App, is created in Vue 3). Instead of Vue.nextTick() we have to use nextTick(), a function that is exported by Vue 3. Not a big deal.

A little more involved is the new Vue compiler requirement that a v-model can only be used on <input>, <textarea> and <select> elements.

We're using a v-model on ul lists in word-filter-panel.vue. This would affect app logic in a more significant way, but probably is doable too.

The biggest issue I've found so far is with transformer plugins for webpack. While there is a beta version of vue-loader and @vue/compiler-sfc that both were updated to support Vue 3, there seems to be an issue with other plugins, such as vue-svg-loader. I'm not sure all the Vue webpack plugins are now ready for Vue 3, and I'm afraid we can loose a lot of time making them work.

There is also very little reference material on how to configure webpack and its plugins to build Vue 3, so it may be very time consuming to figure out.

So while an upgrade to webpack 5 went quite smoothly with very little changes required, Vue 3 seems to be a slightly different story. Since Vue 3 does not provide us with any new "killer" features (there is a Composition API and better performance but I think it's not the most important things for us right now), maybe we can postpone an upgrade until the final version will be out and all the tooling will be updated to work with it? @balmas, @irina060981: What do you think?

irina060981 commented 4 years ago

We're using a v-model on ul lists in word-filter-panel.vue. This would affect app logic in a more significant way, but probably is doable too.

I believe that v-model here is redundant, it is not used and it could be simply removed. I think that it was to be removed on previous steps of logic update.

But any way I don't see any real advantages of upgrading to Vue 3 in nearest time.

balmas commented 4 years ago

is an upgrade to Vue 3 required to support web components, if we want to do so?

kirlat commented 4 years ago

is an upgrade to Vue 3 required to support web components, if we want to do so?

No, I think we can use web components with Vue 2 without any issues.