-
Notifications
You must be signed in to change notification settings - Fork 13
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
♻️Collaboration process #528
Conversation
f416aa7
to
69c2c91
Compare
Many routes were in the server.ts file, now they are in their own files in the handlers folder. The server.ts file is now AppServer that handles the routes. We split as well the tests.
Add cors middlewares to y-provider server. It will control how clients connect to the server with http requests.
When a task was already existing, we were not updating it. This commit fixes that.
We created useProviderStore, a store dedicated to managing the provider of the document. We created as well a new hook useCollaboration, it will be use to interact with the provider store. This refacto is a first step to implement the long polling.
69c2c91
to
904fd05
Compare
setTimeout(() => { | ||
isInitializing = false; | ||
}, 1000); |
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.
why ?
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.
task.observe
triggers the task lightly after you bind it to it, it seems like a bug, it is due to the architecture of y.js apparently. We want to exec the task only when we trigger it from broadcast method, so isInitializing
is a trick to blocked this initial trigger.
Purpose
It is the first step to introduce the long polling feature (see: #517)
We improve the architecture of the collaboration server, it will help us to introduce new routes without impacting the other routes.
We create
useProviderStore
on the frontend side, it will be dedicated to the provider.We add as well
useCollaboration
hook, that will manage the collaboration connections.Proposal