github nathantsoi/vue-native-websocket v3.0.0

8 hours ago

Breaking changes

  • Vue 2 is no longer supported.
  • Vue.use(...) is replaced by app.use(createSocketPlugin(...)).
  • Automatic Vuex commit / dispatch handling was removed.
  • Dynamic this.$options.sockets listeners 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, and sendJson helpers.
  • 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 prepack to build before packaging.

Full Changelog: v2.0.15...v3.0.0

Don't miss a new vue-native-websocket release

NewReleases is sending notifications on new releases.