feat(build): migrate to Vue 3 + bootstrap-vue-next#773
feat(build): migrate to Vue 3 + bootstrap-vue-next#773TimeToBuildBob wants to merge 1 commit intoActivityWatch:masterfrom
Conversation
Phase 1 of Vue 3 migration (aw-webui#772): - vue 2.7 -> 3.5, vue-router 3 -> 4 - bootstrap-vue -> bootstrap-vue-next (bootstrap 4 -> 5) - chart.js 3 -> 4 (required by vue-chartjs v5) - @vitejs/plugin-vue2 -> @vitejs/plugin-vue - Remove webpack/@vue/cli-* packages entirely - Remove Vue 2-only packages: vue-datetime, vue-color, vue-awesome, vuedraggable v2 - Add vuedraggable v4, @fullcalendar/vue3 v6 - Update main.js: createApp() + createBootstrap() (bootstrap-vue-next API) - Update route.js: createRouter() + createWebHashHistory() (Vue Router 4 API) - Update stores/index.js: remove PiniaVuePlugin (Vue 2 only) - Update filters.js: export functions instead of Vue.filter() (removed in Vue 3) - Fix Vue.extend() -> defineComponent() in 3 components - Fix Calendar.vue: @fullcalendar/vue -> @fullcalendar/vue3 - Fix TimelineBarChart.vue: vue-chartjs/legacy -> vue-chartjs (v5 API) - Add vite.config.js stub plugin for Vue 2-only packages - Disable transformAssetUrls to allow runtime-served assets (logo.png) - Add IconPlaceholder.vue stub for vue-awesome icon component - Fix Header/Footer component names (reserved in Vue 3 ESLint rules) Build: 2191 modules transformed, dist generated successfully. Components still use Vue 2 Options API - individual migration in follow-up commits.
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 5500d9b in 16 seconds. Click for details.
- Reviewed
729lines of code in14files - Skipped
1files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_jGB2URIKIUFsDPmO
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Greptile SummaryThis PR successfully migrates the codebase from Vue 2 to Vue 3 as Phase 1 of the migration. The core Vue 3 APIs are properly adopted: Key accomplishments:
Issue found:
As documented in PR description, Phase 2 will:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Vue 2 App] --> B[Create Vue 3 App]
B --> C[createApp from vue]
B --> D[createRouter from vue-router]
B --> E[createBootstrap from bootstrap-vue-next]
C --> F[Register Plugins]
F --> G[app.use createBootstrap]
F --> H[app.use router]
F --> I[app.use pinia]
F --> J[Set Global Properties]
J --> K[PRODUCTION, COMMIT_HASH, $isAndroid]
J --> L[**$aw should be here**]
J --> M[Register Components]
M --> N[defineAsyncComponent for all components]
M --> O[app.mount #app]
O --> P[**$aw currently set here - WRONG**]
D --> Q[Vue Router 4 API]
Q --> R[createWebHashHistory]
Q --> S[Catch-all: :pathMatch.*.*]
E --> T[Bootstrap 5 + bootstrap-vue-next]
style P fill:#ff6b6b
style L fill:#51cf66
Last reviewed commit: 5500d9b |
| app.mount('#app'); | ||
|
|
||
| // Set the $aw global property | ||
| app.config.globalProperties.$aw = getClient(); |
There was a problem hiding this comment.
$aw set after app.mount() — move before line 167
In Vue 3, global properties should be set before mounting. Components accessing this.$aw during setup/initialization may fail.
| app.mount('#app'); | |
| // Set the $aw global property | |
| app.config.globalProperties.$aw = getClient(); | |
| app.config.globalProperties.$aw = getClient(); | |
| app.mount('#app'); | |
| // Set the $aw global property |
Summary
Phase 1 of Vue 3 migration (requested in #772):
@vue/cli-*/ webpack deps, keep Vite only@fullcalendar/vue→@fullcalendar/vue3(v6)Key changes
src/main.js:new Vue(...).$mount()→createApp(App).mount()src/route.js:new VueRouter()→createRouter()src/util/filters.js: Vue 2Vue.filter()→ named function exportsvue-awesome,vue-color,vue-datetime,vue-d3-sunburst) — renders placeholder components until proper Vue 3 alternatives are addedVue.extend()→defineComponent()Build status
Build succeeds:
✓ 2191 modules transformed, built in 26sWhat's left (Phase 2+)
bootstrap-vuecomponent names (<b-button>, etc.) tobootstrap-vue-nextequivalents{{ value | filterName }}template filter syntaxvuedraggable@2usageTest plan
npm run buildsucceedsImportant
Migrate from Vue 2 to Vue 3, updating components, routing, and build tools, while stubbing Vue 2-only packages.
src/main.jsto usecreateApp()instead ofnew Vue().Vue.filter()with named function exports insrc/util/filters.js.defineComponent()instead ofVue.extend()in components likeQueryOptions.vueandSelectCategories.vue.vue-awesome,vue-color,vue-datetime,vue-d3-sunburstinvite.config.js.vue-routerto 4.x and updatesrc/route.jsto usecreateRouter().@fullcalendar/vuewith@fullcalendar/vue3inCalendar.vue.vue-chartjsto 5.x inTimelineBarChart.vue.@vue/cli-*and webpack dependencies, use Vite exclusively.package.jsonscripts to use Vite for serving and building.vue2StubPlugininvite.config.jsto handle Vue 2-only packages.HeaderandFootercomponents toAwHeaderandAwFooter.vue-awesomeicons withIconPlaceholder.vue.src/main.jsusingdefineAsyncComponent().vite.config.jsto handle CSP and auto-inject scripts.src/route.jsfor Vue Router 4.x syntax.src/stores/index.jsto use Pinia withoutPiniaVuePlugin.This description was created by
for 5500d9b. You can customize this summary. It will automatically update as commits are pushed.