v1.1.0 — Vapor↔VDOM mode switching: tracks __vapor state during HMR reloads
so components switching between Vapor and VDOM modes preserve bus state.
v0.5.0 — State-preserving hot module replacement.
Preserves the shared command bus (handlers, plugins, hooks) across Vite HMR
updates so that application state survives component hot-reloads.
Without this plugin, each HMR update re-creates the bus from scratch,
clearing all registered handlers and registered state.
Tested against:
• Vite ≥ 7.0.0 (programmatic build API + library mode)
• @vitejs/plugin-vue ≥ 5.0.0 (Vue 3.6 Vapor SFC support — earlier
plugin-vue versions only handle 3.5 VDOM and silently skip vapor blocks)
• Vue ≥ 3.5.0 (composables) or ≥ 3.6.0-beta.11 (full Vapor surface)
If you're on plugin-vue v4 the HMR plugin still works for VDOM SFCs but
you'll miss Vapor support entirely — Vapor <script setup vapor> blocks
fall back to the VDOM compiler. Upgrade plugin-vue alongside Vue 3.6.
// main.ts — no changes required; HMR is transparent import { createCommandBus } from'vapor-chamber' constbus = createCommandBus() bus.register('cartAdd', handler) // After HMR: handler is still registered, state is preserved
vapor-chamber - Vite HMR plugin
v1.1.0 — Vapor↔VDOM mode switching: tracks __vapor state during HMR reloads so components switching between Vapor and VDOM modes preserve bus state. v0.5.0 — State-preserving hot module replacement.
Preserves the shared command bus (handlers, plugins, hooks) across Vite HMR updates so that application state survives component hot-reloads.
Without this plugin, each HMR update re-creates the bus from scratch, clearing all registered handlers and registered state.
Tested against: • Vite ≥ 7.0.0 (programmatic build API + library mode) • @vitejs/plugin-vue ≥ 5.0.0 (Vue 3.6 Vapor SFC support — earlier plugin-vue versions only handle 3.5 VDOM and silently skip vapor blocks) • Vue ≥ 3.5.0 (composables) or ≥ 3.6.0-beta.11 (full Vapor surface)
If you're on plugin-vue v4 the HMR plugin still works for VDOM SFCs but you'll miss Vapor support entirely — Vapor
<script setup vapor>blocks fall back to the VDOM compiler. Upgrade plugin-vue alongside Vue 3.6.Example
Example