Open yagudaev opened 8 months ago
Actually I'm curious why we need to convert to Base64. What is the data meaning in blob.bytes?
I've been trying to figure it out. The reason for converting it to a string is that it is a UInt8Array and if it is not converted it will be serialized as { "0": 233, "1": 111, ... }
But we don't do it for image fills yet, if you look there is a hash that points to the image (.fig is a zip and it will reference the image in disk in case of image fills)
If I remember correctly there is a faster way to convert a UInt8Array to Base64 string. Switching to that method should fix this
Many of the community files are large .fig files. For example take this file: https://www.figma.com/community/file/1325597018063319916/free-dark-admin-dashboards, it converts to a ~125MB file.
This results in a stack-overflow when we try to process it with the btoa method.
There are more efficient ways to convert a blob to a Base64 we should use.