Breaking changes
- Vue 2 is no longer supported.
Vue.use(...)is replaced byapp.use(createSocketPlugin(...)).- Automatic Vuex
commit/dispatchhandling was removed. - Dynamic
this.$options.socketslisteners were removed.
Added
- Vue 3 plugin API via
createSocketPlugin(...). - Composition API support via
useSocket(). - TypeScript source and generated declaration files.
- Reactive socket state:
status,socket,lastMessage,lastJsonMessage,error,reconnectAttempt. connect,disconnect,send, andsendJsonhelpers.- Store-agnostic event hooks for Pinia, Vuex, or custom stores.
- Reconnect hooks and retry configuration.
- Vite + Vue 3 example app using
wss://echo.websocket.org. - GitHub Actions CI.
Changed
- Replaced webpack, Babel, Karma, and Travis with Vite, TypeScript, Vitest, ESLint flat config, and GitHub Actions.
- Package now publishes ESM, CJS, UMD, and TypeScript declaration outputs.
- Publish flow now uses
prepackto build before packaging.
Full Changelog: v2.0.15...v3.0.0