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

Support for OperationInfo inference on Document.subscribe #535

Merged
merged 6 commits into from
Jun 16, 2023

Conversation

easylogic
Copy link
Contributor

@easylogic easylogic commented Jun 7, 2023

What this PR does / why we need it?

To make it easier to get the message when using doc.subscribe, we specify the type.
we get the type of $.text by referencing Document<{ text: Text } >.

It adds two new features

  1. Suggest subscribe path
스크린샷 2023-06-06 오후 9 31 42
  1. Inferring the OperationInfo type from the subscribe path
스크린샷 2023-06-06 오후 9 25 46

Any background context you want to provide?

Knowing in advance that an Operation is going to be subject to certain changes makes it easier to adapt.

What are the relevant tickets?

Fixes #521

Checklist

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

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #535 (3a7bc0b) into main (8151e8a) will decrease coverage by 0.16%.
The diff coverage is 72.13%.

@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
- Coverage   88.08%   87.93%   -0.16%     
==========================================
  Files          77       77              
  Lines        7386     7432      +46     
  Branches      713      727      +14     
==========================================
+ Hits         6506     6535      +29     
- Misses        607      614       +7     
- Partials      273      283      +10     
Impacted Files Coverage Δ
src/document/json/element.ts 91.66% <ø> (ø)
src/document/operation/operation.ts 100.00% <ø> (ø)
test/unit/document/document_test.ts 96.00% <71.18%> (-2.05%) ⬇️
src/document/document.ts 73.41% <100.00%> (+0.16%) ⬆️

... and 6 files with indirect coverage changes

@hackerwins hackerwins force-pushed the feat/support-subscribe-path-type-to-infer-operation branch from 857f895 to 3a7bc0b Compare June 16, 2023 06:13
@hackerwins hackerwins changed the title support subscribe path type Support for OperationInfo inference on Document.subscribe Jun 16, 2023
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.
This will provide a more convenient way to use document.Subscribe.

@hackerwins hackerwins merged commit 17987e1 into main Jun 16, 2023
2 checks passed
@hackerwins hackerwins deleted the feat/support-subscribe-path-type-to-infer-operation branch June 16, 2023 06:28
hunkim98 pushed a commit to hunkim98/yorkie-js-sdk that referenced this pull request Jul 12, 2023
…m#535)

Co-authored-by: Youngteac Hong <susukang98@gmail.com>
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.

Type support for message names in subscribe
2 participants