-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazy-load compression filters in
H5WasmProvider
- Loading branch information
Showing
11 changed files
with
458 additions
and
645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Import compression plugins as static assets (i.e. as URLs) | ||
// cf. `vite.config.ts` and `src/vite-env.d.ts | ||
import blosc from 'h5wasm-plugins/plugins/libH5Zblosc.so'; | ||
import bz2 from 'h5wasm-plugins/plugins/libH5Zbz2.so'; | ||
import lz4 from 'h5wasm-plugins/plugins/libH5Zlz4.so'; | ||
import lzf from 'h5wasm-plugins/plugins/libH5Zlzf.so'; | ||
import szf from 'h5wasm-plugins/plugins/libH5Zszf.so'; | ||
import zfp from 'h5wasm-plugins/plugins/libH5Zzfp.so'; | ||
import zstd from 'h5wasm-plugins/plugins/libH5Zzstd.so'; | ||
|
||
const PLUGINS: Record<string, string> = { | ||
blosc, | ||
bz2, | ||
lz4, | ||
lzf, | ||
szf, | ||
zfp, | ||
zstd, | ||
}; | ||
|
||
export async function getPlugin( | ||
name: string, | ||
): Promise<ArrayBuffer | undefined> { | ||
if (!PLUGINS[name]) { | ||
return undefined; | ||
} | ||
|
||
const response = await fetch(PLUGINS[name]); | ||
return response.arrayBuffer(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
/* eslint-disable spaced-comment */ | ||
|
||
/// <reference types="vite/client" /> | ||
|
||
// HDF5 compression plugins | ||
declare module '*.so' { | ||
const src: string; | ||
export default src; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.