webui-vue
webui-vue copied to clipboard
Migrate to Vue 3
Overview
Requirements
- [ ] Update Bootstrap Vue for Vue 3
- [ ] Add emits property for custom component events
- [ ] Import nextTick
- [ ] Move child :key value in v-for loop into wrapper
<template>
- [ ] Remove global filter registration
- [ ] Remove unnecessary container elements
- [ ] Remove Vue2 transition names
- [ ] Update "this" reference in component props
- [ ] Update Vue i18n to support Vue 3
- [ ] Use new createApp API to create app instance
UI Checklist
Browser Tests (Chrome, Firefox, Safari (Mac), Edge (Windows))
- [ ] Tested responsive layout on supported viewport sizes
- [ ] Verified functionality works as expected, e.g. success and failure use cases
- [ ] Resolved any JavaScript errors thrown to the console
@edtanous's proposal/discussion: https://gerrit.openbmc.org/c/openbmc/webui-vue/+/55438
Dixsie's attempt April 4, 2021
All official libraries and tools now support Vue 3, but @vue/test-utils is still in release candidate status.
Breaking changes observed:
- The beforeDestroy lifecycle hook is deprecated. Use beforeUnmount instead
- Filters deprecated
- VueCompilerError: Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.
- VueCompilerError: v-if/else branches must use unique keys.
- Props default value factory functions no longer have access to this
BootstrapVue currently does not support Vue3
https://bootstrap-vue.org/docs
Vue.js v2.6 is required, v2.6.12 is recommended
It looks like bootstrap-vue-3 exists in an early state?
https://www.npmjs.com/package/bootstrap-vue-3
The beforeDestroy lifecycle hook is deprecated. Use beforeUnmount instead
This is handled in my patch
Filters deprecated
VueCompilerError: Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.
I didn't see this one in my tests; Maybe it was a regression that was fixed later?
VueCompilerError: v-if/else branches must use unique keys. Props default value factory functions no longer have access to this
There was one instance of this, and I think I resolved it by moving to the more common pattern (I think). I added a comment on my review on this line for someone with more knowledge to review.
what about vuetify3, it's now fully vue3 ready with MIT license.
Raised following WIP PR for Vue3 migration.
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/67959
@gtmills @Nikhil-Ashoka @Renuka9527 @sivaprabug
Pushed one commit to the https://gerrit.openbmc.org/c/openbmc/webui-vue/+/67959
1.Added Global Mixins
2.Added Global styles and sass configuration in vite config
3. Implemented Appheader with composition Api with setup attribute
Screenshot:
Header
Mixins
Styles:
@gtmills @Nikhil-Ashoka @kirankumarb07 @sivaprabug
Pushed the below changes
- Removed Mixins Folder.
- Implemented Composables.
- Implemented Date filters and eventBus( We can use event Bus for emitting the global events).
- Added Toast implementation, can be removed when we change the styling library. @gtmills @Nikhil-Ashoka @kirankumarb07 @sivaprabug
Pushed below changes to the https://gerrit.openbmc.org/c/openbmc/webui-vue/+/67959
- Search global component.
- Table cell count global component.
- Table row action global component.
- Table toolbar global component.
- Session page.
Session Page:
@kirankumarb07 @sivaprabug @gtmills @Renuka9527 @Nikhil-Ashoka
Pushed below changes. https://gerrit.openbmc.org/c/openbmc/webui-vue/+/67959
- Added CSP.
- Added build build chunksize limit, The build time is reduced from 6mins to 25 secs.Application Loads faster
- As we are sticking to the bootstrap-vue-next, added the functionlaity of Toast as-well.
Pushed below changes https://gerrit.openbmc.org/c/openbmc/webui-vue/+/55438/5..6
- The above PR is not built in the local development, fixed that issue by configuring i18n legacy as false.
- The translation function t is called using the useI18n in the Login page, Overview page, App Header, App Navigation, and respective file for those pages.
- In the script tag, we can't use this.$t() function for translation. we should use the i18n.global.t() function from i18n. So the page title issue is fixed by this function.
- Fixed the event bus error that occurred during logout.
Pushed below changes https://gerrit.openbmc.org/c/openbmc/webui-vue/+/55438/5..6
- i18n for the Login page, Overview page, and app navigation.
- Page title.
- logout error.
@suryav9724 As discussed, please explain the issues/fixes in detailed manner for the latest pushed the code changes.
Pushed below changes to https://gerrit.openbmc.org/c/openbmc/webui-vue/+/72552/3..4
- upgrade vue-router to "4.4.0", upgrade vuex to "4.1.0".
- App navigation issue fixed by index configuration for router.
- I18n implemented in the Event log page and Global component that are used in the Event log page.
Pushed below changes to PR https://gerrit.openbmc.org/c/openbmc/webui-vue/+/72701
- i18n Issues fixed in all pages that occur while navigating.
- vuelidate
$v
changed tov$
to support vuelidate in vue 3 on all pages. - Filter function for date and time format declared in main.js
- To use the filter function in Vue 3 pipe can't be used. We have to call the filter function using the $filters, that changes has been implemented in the pages that used the filters.
Cherry-pick the master commits to the vue3 branch
vue3 #PR | Master commit ID |
---|---|
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/73124 | bc49e09187cab43f8564f2adb6b8860544870641 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/73188 | 1ff8e89fd2397c468ab0237158e5aeeff2692413 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/73189 | 582e954ecff4edf58c143dc644a21b15005e8109 |
Add user validation in the user management page code changes push to the PR#73249 in Vue3 branch https://gerrit.openbmc.org/c/openbmc/webui-vue/+/73249
Cherry-pick the master commits to the vue3 branch
vue3 #PR | Master commit ID |
---|---|
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74016 | 6de03414859a6a37d0d21bb493bd444e4a308f3b |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74023 | b2acbcaa9cf7b1aa053216ca93ad2ad1f9846544 |
Cherry-pick the master commits to the vue3 branch
vue3 #PR | Master commit ID |
---|---|
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74280 | 09a3b9e0b51c8c0a4ffff29581834c5f3b69b79e |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74281 | db2940a8ea63aeaf2f31dcb45a1c17a622a726c5 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74282 | 0018592cd560059861ec2d01c83f1667012161d4 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74283 | 8876eceffa71ed8b28a856c48a8acb18167c9340 |
The below PR are posted for the functionality issue in vue 3 branch
74566: Firmware page vuelidate and form file error fix | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74566 74803: Factory reset modal popup and validation issue | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74803 74809: LDAP and server power operation page fix | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74809 74816: Invalid feedback if condition change | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74816 74864: Date and time page helper issue | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74864 74733: Network page validation and i18n issue fix | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74733 74735: Locale gets undefined in the login page | https://gerrit.openbmc.org/c/openbmc/webui-vue/+/74735
Cherry-pick the master commits to the vue3 branch
vue3 #PR | Master commit ID |
---|---|
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/75029 | e2c716a91f3cf130427600c26ae58de0f9750f2a |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/75032 | ccf5c5c83260aec703859f6e65075b3365897518 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/75035 | f4e79739d360ba47587427413dcc6e5bdf4182b7 |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/75036 | 51feb35350eee87fc5bf1d463873feb3ccf12f1e |
https://gerrit.openbmc.org/c/openbmc/webui-vue/+/75037 | 413039754779af2bb172b6ff84b646b814c48e31 |