-
Notifications
You must be signed in to change notification settings - Fork 432
feat(fs): support ReadableStream<Unit8Array>
for writeFile
API
#1964
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
Conversation
Package Changes Through 5703494There are 14 changes which include upload with minor, upload-js with minor, deep-link with patch, deep-link-js with patch, log-plugin with patch, log-js with patch, fs with patch, fs-js with patch, localhost with minor, opener with major, opener-js with major, positioner-js with minor, positioner with minor, sql with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
plugins/fs/permissions/autogenerated/commands/read_text_file_lines.toml
Outdated
Show resolved
Hide resolved
tbh i'm still a bit confused why the allow and deny arrays don't match but i assume it's correct. Ah no, is it because users may want to deny write_file but still use open/write? |
yeah |
Hey @amrbashir @FabianLars – just a quick heads-up that I don't think this actually works on macOS (15.3.1). I get a TypeError on the TypeError: undefined is not a function (near '...chunk of data...') Async iterator support on Safari is not currently in place (https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#browser_compatibility) I had to drop in a polyfill for this to work: ReadableStream.prototype[Symbol.asyncIterator] = async function* () {
const reader = this.getReader()
try {
while (true) {
const {done, value} = await reader.read()
if (done) return
yield value
}
}
finally {
reader.releaseLock()
}
} Do you need me to create a separate issue? Happy to provide more info if needed. |
@tjramage thanks for the heads up, I forgot to check if it was supported on all platforms. Would you like to open a PR to change from async iterator to manual read, same as you did in the polyfill? or just open an issue if you like so I don't forget. |
@amrbashir – no problem, leave the PR with me 👍 |
closes #1598