-
Notifications
You must be signed in to change notification settings - Fork 121
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: patch TransformStream on Node.js 16 #564
Conversation
WalkthroughThe changes in this pull request involve the addition of the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
if (typeof global.TransformStream === 'undefined') { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
global.TransformStream = TransformStream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #564 +/- ##
==========================================
+ Coverage 94.79% 95.82% +1.03%
==========================================
Files 11 11
Lines 1267 1270 +3
Branches 305 307 +2
==========================================
+ Hits 1201 1217 +16
+ Misses 62 49 -13
Partials 4 4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/utils.ts (1)
219-223
: Consider adding tests for the TransformStream polyfillThe new polyfill functionality should be covered by tests to ensure it works correctly across different Node.js versions.
Would you like me to help create test cases for verifying the TransformStream polyfill functionality?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/utils.ts
(2 hunks)
🔇 Additional comments (2)
src/utils.ts (2)
4-4
: LGTM: Import statement follows Node.js best practices
The addition of TransformStream
to the import statement is correct and follows Node.js best practices by using the node:
protocol prefix.
219-223
: Verify the TransformStream polyfill compatibility
The implementation follows the established pattern for Web Streams API polyfills. However, we should verify:
- The polyfill works correctly on Node.js 16
- This change doesn't affect other Node.js versions unexpectedly
Let's verify the Node.js version compatibility:
[skip ci] ## [4.6.8](v4.6.7...v4.6.8) (2024-12-11) ### Bug Fixes * patch TransformStream on Node.js 16 ([#564](#564)) ([503dbd8](503dbd8))
Summary by CodeRabbit
New Features
TransformStream
.Bug Fixes
TransformStream
to ensure it is available in the global scope if not already defined.