Features
- Reactive properties
this.$socket.connected
and this.$socket.disconnected
support (Closes #17) Docs
- ECMAScript / TypeScript
@Socket()
decorator support (Closes #357) Docs
Bug fixes
- Proper unsubscribing from dynamic listeners and non-dynamic listeners #408 #407 #400
Breaking changes
socket.io-client
instance moved from this.$socket
to this.socket.client
. Please check usages before upgrading
- this.$socket.emit('anything');
+ this.$socket.client.emit('anything');
- Dynamic socket event listeners API change (no more relies on Proxy API)
- this.$options.sockets.event_name = (payload) => {
- console.log(payload)
- });
+ this.$socket.$subscribe('event_name', (payload) => {
+ console.log(payload)
+ });
- If you are using library in CommonJS environment you might need to change the usage:
- const VueSocketIOExt = require('vue-socket.io-extended');
+ const VueSocketIOExt = require('vue-socket.io-extended').default;
const io = require('socket.io-client');
const socket = io('http://socketserver.com:1923');
Vue.use(VueSocketIOExt, socket);
Other changes
- IE 11 fully supported now
- No more security vulnerabilities in the dev dependencies
- Bundle now properly transpiled to ESM
- Stop polyfilling dead browsers (e.g. IE 10)
- Twitter feed example now lives in the repo (more examples soon)