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

refactor(yaml): make readDocument() and readDocuments() generator functions #5255

Merged
merged 8 commits into from
Jul 3, 2024

Conversation

timreichen
Copy link
Contributor

  • makes readDocuments() and add readDocuments() generator functions

This will prevent parsing all documents in load() before throwing an error.

Note: The performance can be enhanced in a future PR by checking whether the state.position is at the end of the state.input instead of parsing a second document. There are some unknown state changes going on somewhere during the parsing. That is why this approach doesn't work atm.

@timreichen timreichen requested a review from kt3k as a code owner July 2, 2024 11:57
@github-actions github-actions bot added the yaml label Jul 2, 2024
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.66%. Comparing base (1a11b69) to head (ea9bd0f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5255      +/-   ##
==========================================
- Coverage   95.66%   95.66%   -0.01%     
==========================================
  Files         459      459              
  Lines       38015    38014       -1     
  Branches     5559     5558       -1     
==========================================
- Hits        36368    36367       -1     
  Misses       1606     1606              
  Partials       41       41              

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

yaml/_loader/loader.ts Outdated Show resolved Hide resolved
yaml/_loader/loader.ts Outdated Show resolved Hide resolved
@kt3k
Copy link
Member

kt3k commented Jul 3, 2024

Should we also remove documents field of LoaderState?

@iuioiua iuioiua requested a review from kt3k July 3, 2024 03:48
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 merged commit 17837f4 into denoland:main Jul 3, 2024
15 checks passed
@timreichen timreichen deleted the yaml-document-generator branch July 3, 2024 05:58
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