Skip to content

Some suggestions #2

@jimmywarting

Description

@jimmywarting
  1. Drop support for IE
    • MS will end the support soon in Agust...
    • MS office 365 have already dropped support for IE
    • Global marketshare tells us that it's down at < 1% (0.7% in fact)
  2. Switch to using canvas.toBlob() instead.
    • Even doe it's async it much faster since it don't have to encode the image data to base64 only to be decoded again by converting it to binary data again when you convert it into a Uint8Array. then you can do blob.arrayBuffer().then(do_something) afterwards
    • Using toBlob would mean that it would become async only - so drop all the sync code?
  3. typedarray-to-buffer isn't really necessary. you can just safely do Buffer.from(arrayBuffer) or Buffer.from(uint8.buffer)
    • The uint8 array you produce don't have any byteOffsets or anything like that.
    • typedarray-to-buffer is such a small package that it can be inlined.
  4. Really don't think you should be returning a Node Buffer, I think a Uint8Array is way better. It's more lightweight and don't depend on any nodejs stuff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions