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(json): remove writableStrategy and readableStrategy options #5097

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jun 20, 2024

What's changed

The writableStrategy and readableStrategy options have been removed from the constructors from ConcatenatedJsonParseStream, JsonParseStream and JsonStringifyStream.

Why this change was made

These options were removed because they aren't used in most use cases. For this reason, none of the other TransformStream implementations in the Standard Library have these options.

Who this affects

Only those who use these options.

Migration guide

If you require the use of these options, please implement a custom class that uses them.

class CustomJsonStringifyStream extends TransformStream<unknown, string> {
  constructor(
    writableStrategy: QueuingStrategy<unknown>,
    readableStrategy: QueuingStrategy<string>,
  ) {
    super(
      {
        transform(chunk, controller) {
          controller.enqueue(JSON.stringify(chunk));
        },
      },
      writableStrategy,
      readableStrategy,
    );
  }
}

Related

Closes #4113

@github-actions github-actions bot added the json label Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (15ec8df) to head (f43490f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5097      +/-   ##
==========================================
- Coverage   92.70%   92.70%   -0.01%     
==========================================
  Files         482      482              
  Lines       38713    38703      -10     
  Branches     5462     5462              
==========================================
- Hits        35888    35878      -10     
  Misses       2770     2770              
  Partials       55       55              

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

@iuioiua iuioiua marked this pull request as ready for review June 20, 2024 12:11
@iuioiua iuioiua requested a review from kt3k as a code owner June 20, 2024 12:11
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 cc8252d into main Jun 21, 2024
16 checks passed
@iuioiua iuioiua deleted the json-remove-strategies branch June 21, 2024 04:20
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.

suggestion: deprecate writableStrategy and readableStrategy argument properties for std/json constructors
2 participants