-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add documentation for client deactivation #176
Conversation
WalkthroughThe documentation for the Yorkie JS SDK has been updated to include a new subsection titled "Deactivate the Client." This section outlines the method Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (3)
docs/js-sdk.mdx (3)
48-51
: Enhance the introduction with specific details about resources.Consider expanding the introduction to specify the types of resources that get released (e.g., network connections, memory, event listeners) to help developers better understand the importance of proper cleanup.
When the client is no longer needed, you can deactivate it to release resources and disconnect from the server. +When the client is no longer needed, you can deactivate it to release resources (such as network connections, memory allocations, and event listeners) and disconnect from the server.
52-54
: Add error handling to the deactivation example.Consider adding error handling to demonstrate proper cleanup even when deactivation fails.
-await client.deactivate(); +try { + await client.deactivate(); +} catch (error) { + console.error('Failed to deactivate client:', error); + // Handle cleanup failure +}
56-56
: Enhance the garbage collection explanation.Consider adding a brief explanation of what garbage collection does in this context, before linking to the detailed design document.
-This will detach all documents attached to the client for efficient [garbage collection](https://github.com/yorkie-team/yorkie/blob/main/design/garbage-collection.md). +This will detach all documents attached to the client, allowing the system to clean up unused resources and CRDT tombstones through [garbage collection](https://github.com/yorkie-team/yorkie/blob/main/design/garbage-collection.md).
What this PR does / why we need it?
Add documentation for client deactivation
Any background context you want to provide?
What are the relevant tickets?
Fixes #
Checklist
Summary by CodeRabbit
beforeunload
event.keepalive
option for maintaining client activity during page closure.