1.4 KiB
1.4 KiB
Design: mobile H5 (add-mobile-h5)
Decision: Nuxt 3 H5 now, Taro deferred
Chosen: a first-party Nuxt 3 H5 app (apps/mobile) reusing @vmall/shared,
theme.css, and @vmall/ui.
Considered and deferred: Taro (Vue 3) for H5 + WeChat mini-program from one
codebase. Taro is only worth its cost when the mini-program is a committed
target: @vmall/ui is DOM-based and does not run in a mini-program, Tailwind
needs plugin+rpx workarounds there, createApi needs a transport adapter
(fetch does not exist in MP), and MP login needs a wx.login → openid
backend endpoint. For H5 alone, Nuxt is strictly better. Deferring Taro later
loses little: it would share neither the UI kit nor page code with the Nuxt
app anyway.
If the mini-program becomes a target later
Split into three changes instead of one big-bang:
add-mobile-taro-scaffold— Taro 4 + Vue 3 workspace app,createApitransport injection (fetch on H5,Taro.requeston MP), tab-bar shell, account+password login (works on both, no wx APIs). Acts as the compatibility spike (Taro 4 + pnpm monorepo + CSS variables in WXSS).add-mobile-h5-flows— the page inventory from this change, delivered on the Taro H5 build.add-mobile-miniprogram— MP build target, wx.login session exchange endpoint, share/subscribe messages. Payments can ride the existing wallet (balance payment) to avoidwx.requestPaymentmerchant onboarding; top-up stays on H5/PC.