Skip to content
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

feat(raw): Replaced Buffer serializer to improve portability #364

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

itpropro
Copy link
Member

@itpropro itpropro commented Jan 2, 2024

πŸ”— Linked issue

#142

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Replaced Buffer with native implementation to also run on workers and other environments. It's also faster than Buffer, but in the context of unstorage, the improvement is not significant.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@itpropro itpropro requested a review from pi0 January 2, 2024 17:05
@itpropro
Copy link
Member Author

itpropro commented Jan 2, 2024

The netlify tests seem to be very flaky and slow, we should probably disable them (95% of them ran into timeout on my machine) until the driver is fixed or a faster way of testing is found.

@GalacticHypernova
Copy link
Contributor

GalacticHypernova commented Jan 21, 2024

How would this translate to getItemRaw with the web streams? Would it still be possible for the response of the image to be automatically rendered correctly as an image on the browser?

return genBytesFromBase64(value.slice(BASE64_PREFIX.length));
}

// Base64 utilities - Waiting for https://github.com/unjs/knitwork/pull/83 // TODO: Replace with knitwork imports as soon as PR is merged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can now be used via unjs/undio#8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed. The feature is not releaed yet and I ned to complete node {Buffer} support but we shall adopt undio.

@pi0 pi0 marked this pull request as draft May 1, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants