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

fix(bun): Rewrite TextEncoderStream polyfill implementation for Bun middleware #6309

Merged
merged 4 commits into from
May 14, 2024

Conversation

octet-stream
Copy link
Contributor

@octet-stream octet-stream commented May 13, 2024

Overview

Closes #5929

The implementation of bun adapter implemented in #5129 has also introduced a polyfill for TextEncoderStream. While the adapter itself works, this polyfill introduced a bug, caused on attempt to close a response stream (see #5929 for more info). This PR fixes this issue by rewriting the polyfill based on this comment: #5929 (comment)

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Use cases and why

    1. One use case
    1. Another use case

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

@PatrickJS PatrickJS changed the title fix: Rewrite TextEncoderStream polyfill implementation for Bun middleware fix(bun): Rewrite TextEncoderStream polyfill implementation for Bun middleware May 13, 2024
@octet-stream octet-stream marked this pull request as ready for review May 13, 2024 23:43
@octet-stream
Copy link
Contributor Author

The PR itself is ready, but it need to be tested anyway. I will do it manually, since I am not much familiar with the codebase. Please, let me know if I can add some automated tests.

@PatrickJS
Copy link
Member

this should be fine as is. bun should include TextEncoderStream anyways

@octet-stream
Copy link
Contributor Author

Alright then.
Prettier fails on index.ts in bun middleware.

@PatrickJS
Copy link
Member

@octet-stream I'll fix the pr don't worry about it

@PatrickJS PatrickJS enabled auto-merge (squash) May 13, 2024 23:54
@PatrickJS PatrickJS merged commit 45ba302 into QwikDev:main May 14, 2024
21 checks passed
@octet-stream octet-stream deleted the fix/bun-encoder-stream-polyfill branch May 14, 2024 00:07
@gioboa
Copy link
Member

gioboa commented May 14, 2024

Thanks @octet-stream for your help 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐞] Error on response attempting to close WritableStream with Bun adapter
3 participants