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

docs(json): lint @std/json docs #4798

Merged
merged 14 commits into from
Jun 18, 2024
Merged

Conversation

littledivy
Copy link
Member

No description provided.

@littledivy littledivy requested a review from kt3k as a code owner May 21, 2024 12:15
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.92%. Comparing base (8ec230f) to head (15c0bac).
Report is 1 commits behind head on main.

Current head 15c0bac differs from pull request most recent head ce2d9e6

Please upload reports for the commit ce2d9e6 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4798      +/-   ##
==========================================
- Coverage   92.32%   91.92%   -0.41%     
==========================================
  Files         481      481              
  Lines       38747    38754       +7     
  Branches     5444     5409      -35     
==========================================
- Hits        35775    35624     -151     
- Misses       2917     3073     +156     
- Partials       55       57       +2     

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

@iuioiua
Copy link
Collaborator

iuioiua commented May 22, 2024

FYI, we just updated the doc checker to check classes. Hence, the lint failure(s).

@github-actions github-actions bot added the json label May 22, 2024
@iuioiua iuioiua requested a review from igorzi May 22, 2024 22:39
@kt3k kt3k mentioned this pull request May 23, 2024
38 tasks
* ```
*/
export class ConcatenatedJsonParseStream
implements TransformStream<string, JsonValue> {
/** A writable stream of byte data. */
// TODO(iuioiua): Investigate why this class is implemented differently to the other JSON streams.
/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

I went with this for now. I didn't bother with a proper example because this, as a public property, seems like a mistake/fault, and may get removed in the future.

Copy link
Member

Choose a reason for hiding this comment

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

To my understanding readable and writable are necessary to be exposed for a TransformStream instance working as a TransformStream.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just meant how this implements TransformStream rather than extending it.

@iuioiua
Copy link
Collaborator

iuioiua commented Jun 5, 2024

PTAL @kt3k

* ```
*/
export class ConcatenatedJsonParseStream
implements TransformStream<string, JsonValue> {
/** A writable stream of byte data. */
// TODO(iuioiua): Investigate why this class is implemented differently to the other JSON streams.
Copy link
Member

Choose a reason for hiding this comment

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

JSONParseStream supposes every chunk is valid JSON string which represents a single JSON object. ConcatenatedJsonParseStream handles stream of strings where each chunk can be incomplete fragments of JSON strings.

This difference exists because in NDJSON or JSONLines, each line contains single JSON object. So we can use TextLineStream to split them and pass the result to JSONParseStream. On the other hand, in Concatenated JSON, there's no explicit delimiter of JSONs. So the class needs to maintain the internal parsing state of JSONs

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@iuioiua iuioiua enabled auto-merge (squash) June 18, 2024 10:09
@iuioiua iuioiua merged commit 16fa0c8 into denoland:main Jun 18, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants