-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor package structure #210
Conversation
WalkthroughThe primary change involves refactoring the handling of presence information within the Yorkie project. Presence-related classes and imports have been moved from the 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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- examples/texteditor/src/main/java/com/example/texteditor/EditorViewModel.kt (1 hunks)
- yorkie/src/androidTest/kotlin/dev/yorkie/core/PresenceTest.kt (1 hunks)
- yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeTest.kt (2 hunks)
- yorkie/src/main/kotlin/dev/yorkie/api/ElementConverter.kt (2 hunks)
- yorkie/src/main/kotlin/dev/yorkie/api/PresenceConverter.kt (1 hunks)
- yorkie/src/main/kotlin/dev/yorkie/core/Client.kt (1 hunks)
- yorkie/src/main/kotlin/dev/yorkie/document/Document.kt (2 hunks)
- yorkie/src/main/kotlin/dev/yorkie/document/change/Change.kt (1 hunks)
- yorkie/src/main/kotlin/dev/yorkie/document/change/ChangeContext.kt (1 hunks)
- yorkie/src/main/kotlin/dev/yorkie/document/presence/Presence.kt (1 hunks)
- yorkie/src/main/kotlin/dev/yorkie/document/presence/Presences.kt (1 hunks)
- yorkie/src/test/kotlin/dev/yorkie/api/ConverterTest.kt (2 hunks)
- yorkie/src/test/kotlin/dev/yorkie/core/ClientTest.kt (1 hunks)
Files skipped from review due to trivial changes (3)
- yorkie/src/main/kotlin/dev/yorkie/api/PresenceConverter.kt
- yorkie/src/main/kotlin/dev/yorkie/core/Client.kt
- yorkie/src/main/kotlin/dev/yorkie/document/change/Change.kt
Additional comments not posted (14)
yorkie/src/main/kotlin/dev/yorkie/document/presence/Presence.kt (2)
1-1
: Package Declaration CorrectnessThe package declaration
package dev.yorkie.document.presence
aligns with the PR's objective of restructuring presence-related classes. This is a good practice for maintaining a modular and organized codebase.
Line range hint
1-22
: Class Definition and Method ImplementationThe
Presence
class and its methodsput
andclear
are well-defined. The use ofinternal
visibility forPresenceChange
ensures encapsulation within the module. The methods manipulate the presence data and register changes using theChangeContext
, which is a clean and effective way to handle state changes.
[APROVED]yorkie/src/main/kotlin/dev/yorkie/document/presence/Presences.kt (2)
1-1
: Package Declaration CorrectnessThe package declaration
package dev.yorkie.document.presence
is correct and reflects the new structure intended by the PR.
Line range hint
1-40
: Class Definition and Method ImplementationThe
Presences
class and its methods are well-implemented. The use of theMap
delegation (by map
) is a Kotlin idiomatic way to provide map functionalities directly through thePresences
class, enhancing code readability and maintainability.yorkie/src/main/kotlin/dev/yorkie/document/change/ChangeContext.kt (2)
8-8
: Import Statement UpdateThe import statement
import dev.yorkie.document.presence.PresenceChange
correctly reflects the new package structure. This ensures that theChangeContext
class can properly utilize thePresenceChange
class.
Line range hint
8-56
: Class Functionality and StructureThe
ChangeContext
class is well-structured. It effectively handles operations and presence changes, ensuring that all modifications are tracked and can be reverted or committed as needed. The methods are clear and perform their intended functions without unnecessary complexity.examples/texteditor/src/main/java/com/example/texteditor/EditorViewModel.kt (2)
15-15
: Import Statement UpdateThe import statement
import dev.yorkie.document.presence.PresenceInfo
is updated to reflect the new package structure, ensuring theEditorViewModel
class can correctly utilize thePresenceInfo
data class.
Line range hint
15-98
: Class Functionality and ImplementationThe
EditorViewModel
class is robust, handling various aspects of text editing and presence management efficiently. The methods are well-organized, and the class leverages Kotlin's coroutines for asynchronous tasks, which is suitable for the operations it performs.yorkie/src/test/kotlin/dev/yorkie/core/ClientTest.kt (1)
29-29
: Import Update: Correctly updated to new package.The import for
PresenceChange
has been updated to reflect the new package structure. This change aligns with the PR's objective of restructuring presence-related classes.yorkie/src/test/kotlin/dev/yorkie/api/ConverterTest.kt (1)
42-42
: Import Update: Correctly updated to new package.The import for
PresenceChange
has been updated to reflect the new package structure. This change aligns with the PR's objective of restructuring presence-related classes.yorkie/src/main/kotlin/dev/yorkie/api/ElementConverter.kt (1)
49-49
: Import Update: Correctly updated to new package.The import for
P
has been updated to reflect the new package structure. This change aligns with the PR's objective of restructuring presence-related classes.yorkie/src/main/kotlin/dev/yorkie/document/Document.kt (1)
21-27
: Updated import statements align with new package structure.The import statements for presence-related classes have been correctly updated to reflect their new location under
dev.yorkie.document.presence
. This change is consistent with the PR's objective of aligning with the JavaScript SDK structure.yorkie/src/androidTest/kotlin/dev/yorkie/core/PresenceTest.kt (1)
11-11
: Approved: Updated import statement forPresenceInfo
.The import statement for
PresenceInfo
has been correctly updated to reflect its new package location. Ensure that any other code or files that depend onPresenceInfo
are also updated accordingly.yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeTest.kt (1)
25-25
: Updated import statement to reflect new package structure.The import statement for
Presence
has been updated to reflect its new location underdev.yorkie.document.presence
, aligning with the project's restructured package organization.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docker/docker-compose-ci.yml (1 hunks)
- docker/docker-compose.yml (1 hunks)
- yorkie/src/androidTest/kotlin/dev/yorkie/TestAnnotations.kt (1 hunks)
Files skipped from review due to trivial changes (3)
- docker/docker-compose-ci.yml
- docker/docker-compose.yml
- yorkie/src/androidTest/kotlin/dev/yorkie/TestAnnotations.kt
What this PR does / why we need it?
Move presence-related classes to the
presence
package, aligning with the JS SDK structure.Any background context you want to provide?
What are the relevant tickets?
Fixes #
Checklist
Summary by CodeRabbit
Chores
yorkie
service from0.4.22
to0.4.24
.Tests
TooManyRequestsException
in JsonTree-related tests.