Migration guide and changelog for v0.14.0 #345
Pinned
Totodore
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Migration guide
With v0.14.0, multiple breaking changes have been introduced. Here is a little migration guide to help migrating from v0.13 to v0.14.
The end of storing
SocketIo
handle as a static to access it from inside a handlerStarting from v0.14 you can use the
SocketIo
type as an extractor. For example to emit data on another namespace.The global state feature
In v0.13 it was not required for the state types to be cloneable. Because this is now the case if you want to share common behavior with your state you should store it in an
Arc
:react-rooms-chat
example:The extension feature
In v0.13 it was not required for any set extensions to be cloneable. Because it is now the case you should either make your extension type
Clone
if it is cheaply cloneable or wrap it with anArc
if it a heavy clone or that you want to share the underlying memory.chat
example:Changelog
socketioxide
Clone
and will be cloned for each handler where the state is used.Send
+Sync
requirements on extensions (issue #295). They are now extracted byCloning
. Therefore all the type must implementClone
. AnExtension
extractor is available to get an extension directly without callingsocket.extensions.get()
.HttpExtension
types to extract extensions from the http request.SocketIo
can now be used as an extractor. So you can now easily access the entire socket.io context from your handlers.dyn_ns
function. You can specify patterns with the{name}
syntax thanks to the matchit crate. The dynamic namespace will create a child namespace for any path that matches the given pattern with the given handler.What's Changed
Extension
decorator and anHttpExtension
decorator by @Totodore in feat(socketio/extensions): rework extensions and add anExtension
decorator and anHttpExtension
decorator #309Str
type for ns path storage by @Totodore in feat(socketio/packet): switch toStr
type for ns path storage #334.into()
everywhere in packet by @Totodore in fix: add generic ns path to avoid.into()
everywhere in packet #340Str
by @Totodore in feat: Namespace key in map asStr
#342Str
by @Totodore in feat: Namespace key in map asStr
#343Full Changelog: v0.13.1...v0.14.0
Beta Was this translation helpful? Give feedback.
All reactions