fix(assets): Use uint8arrays instead of Buffer in code that can run outside of Node#9029
fix(assets): Use uint8arrays instead of Buffer in code that can run outside of Node#9029Princesseuh merged 4 commits intomainfrom
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 |
|
!preview assets-uint8array |
|
Snapshots have been released for the following packages:
Publish LogBuild Log |
alexanderniebuhr
left a comment
There was a problem hiding this comment.
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
ematipico
left a comment
There was a problem hiding this comment.
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