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

BREAKING(io): remove readStringDelim() #6001

Merged
merged 3 commits into from
Sep 25, 2024
Merged

BREAKING(io): remove readStringDelim() #6001

merged 3 commits into from
Sep 25, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Sep 17, 2024

What's changed

readStringDelim() has been removed from @std/io.

Motivation

This change was made to help push users towards using the Streams API and @std/streams, and make design decisions about which APIs easier.

Migration guide

To migrate, pipe the readable stream through a new TextDelimiterStream instead.

- import { readStringDelim } from "@std/io/read-string-delim";
+ import { TextDelimiterStream } from "@std/streams/text-delimiter-stream";

  using file = await Deno.open("README.md");

  for await (
-   const line of readStringDelim(file, "\n")
+   const line of file.readable
+     .pipeThrough(new TextDecoderStream())
+     .pipeThrough(new TextDelimiterStream("\n"))
  ) {
    console.log(line);
  }

Related

Towards #5989

@iuioiua iuioiua requested a review from kt3k as a code owner September 17, 2024 07:05
@iuioiua iuioiua enabled auto-merge (squash) September 17, 2024 07:05
@github-actions github-actions bot added the io label Sep 17, 2024
@iuioiua iuioiua marked this pull request as draft September 17, 2024 07:05
auto-merge was automatically disabled September 17, 2024 07:05

Pull request was converted to draft

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.28%. Comparing base (fc06009) to head (b181c2a).
Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6001      +/-   ##
==========================================
- Coverage   96.29%   96.28%   -0.01%     
==========================================
  Files         493      491       -2     
  Lines       39528    39437      -91     
  Branches     5833     5817      -16     
==========================================
- Hits        38063    37973      -90     
  Misses       1423     1423              
+ Partials       42       41       -1     

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

@iuioiua iuioiua closed this Sep 18, 2024
@iuioiua iuioiua reopened this Sep 25, 2024
@iuioiua iuioiua marked this pull request as ready for review September 25, 2024 02:09
@iuioiua iuioiua enabled auto-merge (squash) September 25, 2024 02:19
@kt3k kt3k changed the title BREAKING(io/unstable): remove readStringDelim() BREAKING(io): remove readStringDelim() Sep 25, 2024
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 4c0ac4f into main Sep 25, 2024
14 checks passed
@iuioiua iuioiua deleted the remove-readStringDelim branch September 25, 2024 04:01
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.

2 participants