-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: refactor to separate server and hocuspocus #686
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, what do we need to get this merged?
We can put it in a branch to queue for next release if there are other breaking changes we want to make.
Thanks so much for this @timoisik. Will be giving it a go shortly. |
Hey there, any news on this? Would love to deploy Hocuspocus on cloudflare :) |
* WIP: refactoring hocuspocus and moved listen function to server instead * Moved port and address from hocuspocus to server entirely * WIP Fixing tests * Fixing tests * Removed port from onConfigure test * Fixed tests * Moved destroy also to server * Updated documentation * WIP Upgrade guide * Added upgrade to listen method on server * Fixed typos * change URL of Tiptap Cloud --------- Co-authored-by: Patrick Baber <[email protected]> Co-authored-by: Jan Thurau <[email protected]>
The following PR has breaking changes and is thus intended for a major release. Feedback is highly appreciated.
With this PR we moved the server logic into it's own server class (
Server.ts
). The server class then will use hocuspocus like you would mostly also use it as a library in other frameworks. This changes the way how you use hocuspocus though.The goal is to make hocuspocus more flexible for further development. Without any server logic, hocuspocus could potentially run on edge services like cloudflare workers in the future. Also it is easier to extend the server with new functionalities such as additional APIs.
New usages
There are two ways on how you can use hocuspocus.
We also changed the parameters of the
.listen()
method:This simplifies the usage of hocuspocus while you can still reach the same behavior as before. You are also still able to configure port and callbacks within the constructor of the Server.
Breaking
.configure()
still exists on hocuspocus but not on the server. We also do not export instances anymore but only the classes. Thus, it is no longer possible to use hocuspocus like:Because the
.listen()
method was removed from hocuspocus and moved to the server, you can no longer use it like:TODO: