-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(assets): Use uint8arrays instead of Buffer in code that can run outside of Node #9029
Conversation
🦋 Changeset detectedLatest commit: c0b310f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
!preview assets-uint8array |
Snapshots have been released for the following packages:
Publish Log
Build Log
|
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.
I just tested this with a known good reproducible example and this fixes the issue, facing in non-node runtimes.
I also don't think this is breaking, so I would be very happy to get this out sooner than later.
/lgtm
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.
The changes look good to me. I believe this PR should be a patch
because we used the wrong types (data structures) to handle binary data. For users affected by this wrong assumption from our end, we can provide a migration path to patch their code.
…utside of Node (#9029) * fix(assets): Use uint8arrays instead of Buffer in code that can run outside of Node * chore: changeset * docs: update changeset with more information on what to do if a Buffer is important * nit: do a patch instead
Changes
Our service code can run outside of Node, so it shouldn't use Buffer, it should accept TypedArrays directly.
This is technically breaking, however:
It seems pretty safe to me, honestly. If we deem it not, I'm okay with delaying this to 4.0, no worries.
Fix withastro/adapters#54
Testing
Tests should still pass!
Docs
withastro/docs#5326