Fix packaging very large projects as HTML files in Chrome (#862)

Actually fixes https://github.com/TurboWarp/packager/issues/528

https://github.com/TurboWarp/packager/pull/861 fixed running large projects
in Chrome, but packaging still used string concatenation so it remained broken.
Now the concatenation part is done using TextEncoder & Uint8Arrays and a
template tag function to keep it readable.

This time I have actually tested it with a 1.0GB sb3.

Breaking Node API change: The data property returned by Packager#package() is
now always a Uint8Array instead of sometimes string and sometimes ArrayBuffer.
This commit is contained in:
GarboMuffin authored and GitHub committed 2024-05-23 23:47:40 -05:00
1 parent e366607f15
commit 2f0010294f
4 files changed
+118 -9

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ const filename = result.filename;
// MIME type of the packaged project. Either "text/html" or "application/zip"
const type = result.type;
// The packaged project's data. Will be either a string (for type text/html) or ArrayBuffer (for type application/zip).
// The packaged project's data. Will always be a Uint8Array.
const data = result.data;
```