Closed viniarck closed 1 month ago
Feb 10th meeting notes:
On 2024.1
the migration is expected to happen, regarding the plan @rmotitsuki will share with us. Feel free to consolidate it wherever its best, whether it's on a issue discussion or lightweight blueprint, thanks, Rogerio.
For the first phase of migration to Vue3 Kytos will use Vue3 libraries with Vue2 compatibility. Most Vue2 code will work with warning messages.
https://v3-migration.vuejs.org/
Some libraries were replaced to be compatible with Vue3:
For debugging purposes, Kytos UI must be compiled using a new pre-production profile. $ npm run preprod
This profile will create a compiled webpacket file with debug mode enabled. Copy the ./dist/build.js into Kytos installation ./kytos/web-ui/dist/build.js to replace the production UI.
Kytos will display any compatibility warning/error messages in the browser log window. (press F12 to activate the developer window inside the browser)
The following NApps must be updated with the new UI:
The rest of the napps in this list will not be updated:
Common UI code used in NApps that need to be changed for UI compatibility.
beforeDestroy is replaced for beforeUnmount
Object value synchronization
Replace:
<k-input-auto id="source" :value.sync="source"
for:
<k-input-auto id="source" v-model:value="source"
Click Event Click events must be triggered using @click
Replace:
<k-button icon="search" title="Search" v-on:click.native="get_paths">
for:
<k-button icon="search" title="Search" @click="get_paths">
Replace:
<k-button icon="search" title="Search" v-on:click="get_paths">
for:
<k-button icon="search" title="Search" @click="get_paths">
Replace:
<k-button icon="search" title="Search" :on_click="get_paths">
for:
<k-button icon="search" title="Search" @click="get_paths">
Kytos events Custom events are deprecated. Now Kytos has an eventBus with global access called eventBus to implement the communication among the NApps. The eventBus function is defined on src/event-bus.js
Replace:
this.$kytos.$emit("showInfoPanel", content)
for:
this.$kytos.eventBus.$emit("showInfoPanel", content)
Replace:
this.$kytos.$on
for:
this.$kytos.eventbus.$on
filters are deprecated
Replace:
{{content | orNone}}
for:
methods: { orNone: function(value) { ... } }
{{ orNone(content) }}
For global filter replace:
{{ tx_bytes | humanize_bytes }}
for:
{{ $filters.humanize_types(tx_bytes) }}
icon. New parameter to bind the icon name:
Replace:
<icon v-bind:name=iconName>
for
<icon :icon=iconName>
icon. Icon names don´t have "regular" prefix anymore:
Replace:
<icon name="regular/clock" />
for:
<icon icon="clock" />
v-if and v-for can´t be combined in same tag due to syntax ambiguity.
https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html
Replace:
<k-property v-if="..." v-for="..." >
for:
`
For the first phase of migration to Vue3 Kytos will use Vue3 libraries with Vue2 compatibility. Most Vue2 code will work with warning messages.
https://v3-migration.vuejs.org/
Some libraries were replaced to be compatible with Vue3:
For debugging purposes, Kytos UI must be compiled using a new pre-production profile. $ npm run preprod
This profile will create a compiled webpacket file with debug mode enabled. Copy the ./dist/build.js into Kytos installation ./kytos/web-ui/dist/build.js to replace the production UI.
Kytos will display any compatibility warning/error messages in the browser log window. (press F12 to activate the developer window inside the browser)
Common UI code used in NApps that need to be changed for UI compatibility.
beforeDestroy is replaced for beforeUnmount
Object value synchronization Replace: <k-input-auto id="source" :value.sync="source" for: <k-input-auto id="source" v-model:value="source"
Click Event Click events must be triggered using @click
Replace:
Kytos events Custom events are deprecated. Now Kytos has an eventBus with global access called eventBus to implement the communication among the NApps. The eventBus function is defined on src/event-bus.js
Replace: this.$kytos.$emit("showInfoPanel", content) for: this.$kytos.eventBus.$emit("showInfoPanel", content)
Replace: this.$kytos.$on for: this.$kytos.eventbus.$on
filters are deprecated Replace: {{content | orNone}} for:
For global filter replace: {{ tx_bytes | humanize_bytes }} for: {{ $filters.humanize_types(tx_bytes) }}
icon. New parameter to bind the icon name: Replace:
icon. Icon names don´t have "regular" prefix anymore: Replace:
for:
v-if and v-for can´t be combined in same tag due to syntax ambiguity. https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html Replace:
All the related PRs have landed and 2024.1.0-b1
version has been released https://github.com/kytos-ng/ui/releases/tag/2024.1.0-b1.
The rest of upcoming changes such as handling the async funcs issue #68 and eventually removing compat layer will be mapped as new issues for future versions.
Nicely done, Rogerio.
https://v2.vuejs.org/lts/
Objective
Define an incremental plan to upgrade towards Vue.js 3, just so
ui
core doesn't not accumulate technical debt and other vulnerabilities.ui
is a core part ofkytos-ng
as a product, it's important for network operators. We don't necessarily need an full blown blueprint for this, having the discussion on this issue is sufficient.At the moment, our goal is to try to maintain most of the
ui
functionality as it is, we don't immediately need new functionalities, better perf, TypeScript support from Vue3. So, when choosing and strategy let's keep that in mind, and then later on we also decide if it's worth trying to adopt the composition API over the options API.This issue here is partly related to https://github.com/kytos-ng/kytos/issues/183, but we have reduced the scope to only deal with Vue 2 EOL situation.
Initial Information
As highlighted on Vue2 js website, the options are:
Is
@vue/compat
an option for us (do our dependencies break)? or should we go with the intermediary Vue 2.7 at least that's recommended?cc'ing @rmotitsuki @Niehaus if you'd like to contribute to what strategy we should go for (other core members and contributors will also participate but if you'd like to lead the discussion and which approaches we should go for).
Barbara, thanks for initially brainstorming about overall strategies.