mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-07-14 07:47:21 +02:00
cb5a531391
Accept cart/modal theme-refresh limitation per BuyButton.js docs (Option A) Looked up the actual Shopify BuyButton.js source and docs instead of guessing at API surface. Confirmed there is no documented destroy() or updateConfig() method — createComponent(type, config) is the only supported way to create or change what's rendered, and it auto-creates a separate cart + "cart toggle" component tied to that call, not a child of the node you pass in. - Revert to plain clear-and-recreate (container.innerHTML + createComponent) for both collection switches and theme toggles — the only pattern the SDK actually documents - Remove all destroy()/updateConfig()/ui.components calls added in prior revisions; they relied on unverified internal APIs and were producing empty renders more often than not - Keep the cached client (getShopifyUI(), built once) to avoid re-risking the "empty cart on page load" issue on every toggle - Keep the shopifyRenderToken guard against overlapping async renders - Document the accepted limitation in code: product grid re-themes live on every toggle; cart drawer and product modal pick up a new theme on next page load only, since there's no documented way to re-theme those singletons without a full reload Files changed: src/pages/StorePage.vue
deflock
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur).
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need Volar to make the TypeScript language service aware of .vue types.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
npm run dev
Type-Check, Compile and Minify for Production
npm run build