fix: memory issues when importing giant mrpack files (#6278)

* feat: dont load mrpacks into memory if they are local imports

* fix: frontend
This commit is contained in:
Calum H.
2026-06-02 12:59:41 +00:00
committed by GitHub
parent 6b0a0c1897
commit cfe45b368c
11 changed files with 333 additions and 92 deletions
+11 -1
View File
@@ -9,11 +9,21 @@ export interface PickedFile {
previewUrl: string
}
export interface PickedModpackFile extends Omit<PickedFile, 'file'> {
/** Only present for upload flows; native imports avoid copying huge packs into the webview heap. */
file?: File
}
export interface PickModpackFileOptions {
/** Set to false when a native path can be streamed directly by the backend. */
readFile?: boolean
}
export interface FilePickerProvider {
/** Pick an image file (for icons) */
pickImage: () => Promise<PickedFile | null>
/** Pick a .mrpack modpack file */
pickModpackFile: () => Promise<PickedFile | null>
pickModpackFile: (options?: PickModpackFileOptions) => Promise<PickedModpackFile | null>
}
export const [injectFilePicker, provideFilePicker] = createContext<FilePickerProvider>('FilePicker')