Skip to content
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

Bump up proto files to the latest #149

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Bump up proto files to the latest #149

merged 1 commit into from
Jun 4, 2024

Conversation

chacha912
Copy link
Contributor

@chacha912 chacha912 commented Jun 4, 2024

What this PR does / why we need it?

Bump up proto files to the latest

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • New Features

    • Enhanced document event handling with the addition of DOCUMENT_BROADCAST type.
    • Expanded attributes for operations, including style and tree edits.
    • Introduced DocEventBody to encapsulate event details, improving event management and tracking.
  • Bug Fixes

    • Improved accuracy in tracking document changes with new fields like createdAtMapByActor and isRemoved.

@chacha912 chacha912 requested a review from hackerwins June 4, 2024 08:19
Copy link

coderabbitai bot commented Jun 4, 2024

Walkthrough

The recent updates to the Yorkie API involve enhancements and additions across several message types and enums. Key changes include new fields in Operation, Increase, TreeStyle, and NodeAttr messages, the introduction of DOC_EVENT_TYPE_DOCUMENT_BROADCAST to the DocEventType enum, and the addition of the DocEventBody message. These updates improve the functionality and granularity of the Yorkie API.

Changes

File Path Change Summary
src/api/yorkie/v1/resources.proto Added fields to messages like Operation, Increase, TreeStyle, NodeAttr; new DocEventBody.
src/api/yorkie/v1/resources_pb.d.ts Added new fields and types to classes and enums, including DOCUMENT_BROADCAST, DocEventBody.
src/api/yorkie/v1/resources_pb.js Added new fields to message types such as created_at_map_by_actor, split_level, is_removed.

Poem

In the land of code, where data flows,
Yorkie's updates bring new glows. 🌟
With fields enhanced and messages bright,
Document events now take flight. 📜
A broadcast here, an attribute there,
Yorkie's evolving with utmost care. 🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
src/api/yorkie/v1/resources_pb.js (1)

Line range hint 20-21: Remove redundant 'use strict' directive.

- "use strict";

As per ECMAScript modules' specification, the entire contents are automatically in strict mode. The explicit declaration is redundant and can be safely removed.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between da0164d and 650125d.

Files selected for processing (3)
  • src/api/yorkie/v1/resources.proto (5 hunks)
  • src/api/yorkie/v1/resources_pb.d.ts (7 hunks)
  • src/api/yorkie/v1/resources_pb.js (8 hunks)
Additional context used
Biome
src/api/yorkie/v1/resources_pb.js

[error] 20-21: Redundant use strict directive. (lint/suspicious/noRedundantUseStrict)

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

Additional comments not posted (21)
src/api/yorkie/v1/resources.proto (7)

114-114: Added created_at_map_by_actor field to Operation_Style.

This addition aligns with the updates in the corresponding JavaScript and TypeScript files, ensuring consistency across implementations.


127-127: Added split_level field to Operation_TreeEdit.

This field is crucial for managing tree edits at different levels, enhancing the flexibility of tree operations.


136-137: Added attributes_to_remove and updated created_at_map_by_actor in Operation_TreeStyle.

These additions allow for more granular control over style attributes in tree structures, which is beneficial for dynamic styling scenarios.


229-229: Added is_removed field to NodeAttr.

This field is essential for tracking the removal status of nodes, which can be critical for rendering decisions and state management in client applications.


365-366: Added DOC_EVENT_TYPE_DOCUMENT_BROADCAST to DocEventType.

This new enum value supports a broader range of document-related events, potentially enhancing real-time collaboration features.


368-370: Introduced DocEventBody with fields topic and payload.

This new message type enriches the capabilities of document events by allowing custom data to be transmitted alongside event notifications.


376-376: Added body field to DocEvent.

This optional field allows for the inclusion of DocEventBody, providing flexibility in event handling by including additional context or data.

src/api/yorkie/v1/resources_pb.js (7)

58-58: Added DOCUMENT_BROADCAST to DocEventType enum.

This addition ensures that the enum in the JavaScript file is consistent with the proto definition, supporting the new document broadcast event type.


242-242: Added created_at_map_by_actor to Operation_Style.

This field mirrors the addition in the proto file, maintaining consistency across different implementations of the API.


271-271: Added split_level to Operation_TreeEdit.

This field is crucial for managing edits at different levels of the tree structure, aligning with the proto changes.


288-289: Added attributes_to_remove and updated created_at_map_by_actor in Operation_TreeStyle.

These changes enhance the flexibility and control over tree styling operations, consistent with the proto updates.


439-439: Added is_removed field to NodeAttr.

This addition is crucial for accurately representing the state of node attributes, particularly their removal status, aligning with the proto changes.


655-665: Introduced DocEventBody message type with fields topic and payload.

This addition enriches the event system by allowing custom data to be associated with document events, consistent with the proto updates.


674-674: Added body field to DocEvent.

This update allows for the inclusion of DocEventBody, providing flexibility in how document events are handled and what data they can carry.

src/api/yorkie/v1/resources_pb.d.ts (7)

118-121: Added new enum value DOCUMENT_BROADCAST to DocEventType.

This addition aligns with the updates in the proto files and ensures the TypeScript definitions are consistent with the backend specifications.


649-652: Added createdAtMapByActor field to Operation_Style.

This field likely tracks the creation times of styles by different actors, which could be useful for conflict resolution or history tracking in a collaborative environment.


732-735: Added splitLevel field to Operation_TreeEdit.

This field seems to be intended for managing hierarchical data structures more efficiently, possibly related to how deep the tree edits should apply.


786-794: Added attributesToRemove and createdAtMapByActor fields to Operation_TreeStyle.

These additions enhance the functionality of tree styling operations, allowing for more granular control over style attributes and tracking their creation times.


1231-1234: Added isRemoved field to NodeAttr.

This field is essential for tracking the deletion state of node attributes, which is crucial for undo/redo functionality and synchronization of document states.


1851-1877: Introduced DocEventBody class with fields topic and payload.

This new class supports the encapsulation of event data, making the event handling system more robust and flexible by allowing arbitrary data to be associated with document events.


1893-1896: Added optional body field to DocEvent.

This change allows DocEvent to carry detailed event data, enhancing the event system's capabilities to handle complex scenarios.

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

@hackerwins hackerwins merged commit 559aabf into main Jun 4, 2024
2 checks passed
@hackerwins hackerwins deleted the update-proto branch June 4, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants