MISC: Support compression of save data (#1162)

* Use Compression Streams API instead of jszip or other libraries.
* Remove usage of base64 in the new binary format.
* Do not convert binary data to string and back. The type of save data is SaveData, it's either string (old base64 format) or Uint8Array (new binary format).
* Proper support for interacting with electron-related code. Electron-related code assumes that save data is in the base64 format.
* Proper support for other tools (DevMenu, pretty-save.js). Full support for DevMenu will be added in a follow-up PR. Check the comments in src\DevMenu\ui\SaveFileDev.tsx for details.
This commit is contained in:
catloversg
2024-03-28 11:08:09 +07:00
committed by GitHub
parent 75dabd10be
commit 8553bcb8fc
22 changed files with 358 additions and 289 deletions
+3
View File
@@ -44,3 +44,6 @@ export interface IMinMaxRange {
/** The minimum bound of the range. */
min: number;
}
// Type of save data. The base64 format is string, the binary format is Uint8Array.
export type SaveData = string | Uint8Array;