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

Add toJS to return TreeNode of Tree #639

Merged
merged 5 commits into from
Sep 12, 2023
Merged

Add toJS to return TreeNode of Tree #639

merged 5 commits into from
Sep 12, 2023

Conversation

JOOHOJANG
Copy link
Contributor

@JOOHOJANG JOOHOJANG commented Sep 1, 2023

What this PR does / why we need it?

Add toJS to return TreeNode of Tree.

Previously, we return stringified TreeNode (toJSON) so that users have to parse it when they want to use. Also, toJSON was created for testing purposes.
So I just made new toJS to return TreeNode type tree data.

Any background context you want to provide?

In the issue, I mentioned that i'm gonna restore iterator. At first I thought it was necessary, but now I don't think so because the result of postorder traversal is not necessary.

What are the relevant tickets?

Address yorkie-team/yorkie#632

Checklist

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

@JOOHOJANG JOOHOJANG requested a review from hackerwins September 1, 2023 11:51
@JOOHOJANG JOOHOJANG self-assigned this Sep 1, 2023
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.08% ⚠️

Comparison is base (4bd7a07) 88.63% compared to head (7a55526) 88.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #639      +/-   ##
==========================================
- Coverage   88.63%   88.55%   -0.08%     
==========================================
  Files          80       80              
  Lines        8892     8896       +4     
  Branches      816      817       +1     
==========================================
- Hits         7881     7878       -3     
- Misses        704      711       +7     
  Partials      307      307              
Files Changed Coverage Δ
src/document/json/tree.ts 58.08% <0.00%> (-1.07%) ⬇️
src/document/crdt/tree.ts 84.09% <100.00%> (+0.05%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

src/document/crdt/tree.ts Outdated Show resolved Hide resolved
src/document/crdt/tree.ts Outdated Show resolved Hide resolved
src/document/crdt/tree.ts Outdated Show resolved Hide resolved
src/document/json/tree.ts Outdated Show resolved Hide resolved
@JOOHOJANG JOOHOJANG requested a review from humdrum September 4, 2023 02:49
Copy link

@humdrum humdrum left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

4 participants