-
Notifications
You must be signed in to change notification settings - Fork 80
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
chore(js-utils): switch from unenv to node-stdlib-browser #2071
chore(js-utils): switch from unenv to node-stdlib-browser #2071
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
PR Summary
This PR transitions from unenv
to node-stdlib-browser
for Node.js polyfills, focusing on stream handling and browser compatibility in the JavaScript utilities.
- Replaced
unenv
withnode-stdlib-browser
,pkg-dir
, andreadable-stream
dependencies in/packages/toolchain/js-utils-embed/js/deno.json
- Modified stream handling in
/examples/javascript/s3-streamer/standalone_test.ts
to usetransformToByteArray()
instead oftransformToWebStream()
- Updated S3 streaming implementation to use native Node.js streams via
node:stream
import - Added explicit version constraints for new dependencies to ensure compatibility
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
const webStream1 = await response.Body.transformToByteArray(); | ||
console.log("Body type", webStream1.constructor.name); | ||
const s3Stream = Readable.from(webStream1); | ||
const webStream = nodeStreamToWebStream(s3Stream); |
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.
logic: transformToByteArray() loads entire response into memory at once, while transformToWebStream() streamed chunks. This could cause memory issues with large files.
const webStream1 = await response.Body.transformToByteArray(); | |
console.log("Body type", webStream1.constructor.name); | |
const s3Stream = Readable.from(webStream1); | |
const webStream = nodeStreamToWebStream(s3Stream); | |
//const webStream1 = await response.Body.transformToByteArray(); | |
//console.log("Body type", webStream1.constructor.name); | |
//const s3Stream = Readable.from(webStream1); | |
const webStream = nodeStreamToWebStream(Readable.from(response.Body.transformToWebStream())); |
1a1dd9a
to
3b2fd96
Compare
d3808af
to
3a28245
Compare
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes