Skip to content

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

Merged
iuioiua merged 14 commits into
denoland:mainfrom
littledivy:lint_json_docs
Jun 18, 2024
Merged

iuioiua merged 14 commits into
denoland:mainfrom
littledivy:lint_json_docs

Conversation

@littledivy

Copy link
Copy Markdown
Member

No description provided.

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

codecov Bot commented May 22, 2024 •

Copy link
Copy Markdown

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

iuioiua commented May 22, 2024

Copy link
Copy Markdown
Contributor

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
37 of 38 tasks
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

iuioiua commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

PTAL @kt3k

Comment thread json/concatenated_json_parse_stream.ts Outdated
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
Copy Markdown
Contributor

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

Comment thread json/json_parse_stream.ts Resolved

@kt3k kt3k left a comment

Copy link
Copy Markdown
Contributor

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
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