Skip to content

Commit ca342f5

Browse files
committed
chore: update package version to 1.3.4 and replace fzstd with @ioai/wasm-zstd
Bump the package version to 1.3.4. Update the NOTICE file to reflect the new source URL for the wasm-hdf5 repository. Replace the deprecated fzstd library with @ioai/wasm-zstd for Zstandard decompression, and update relevant documentation to ensure clarity on the new library usage.
1 parent c35db6c commit ca342f5

7 files changed

Lines changed: 28 additions & 26 deletions

File tree

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ react-intl
6262
Copyright 2026 IO-AI Tech
6363
Licensed under the MIT License; third-party notices ship with the npm package (see node_modules/@ioai/hdf5/THIRD_PARTY_NOTICES.md after install).
6464
https://www.npmjs.com/package/@ioai/hdf5
65-
Source: https://github.com/ioai-tech/hdf5-wasm
65+
Source: https://github.com/ioai-tech/wasm-hdf5
6666

6767
fflate
6868
Copyright 2020-2024 Arjun Barrett

docs/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Fixed-width sidebar (collapsible) on the left with three tabs:
283283
| Library | Purpose |
284284
|---------|---------|
285285
| fflate | General compression/decompression (gzip/deflate/zlib) |
286-
| fzstd | Browser-safe Zstandard decompression for MCAP chunk compression |
286+
| @ioai/wasm-zstd | Vite-friendly WebAssembly Zstandard decompression for MCAP chunk compression |
287287
| lz4js | Browser-safe LZ4 decompression for MCAP/ROS1 chunk compression |
288288

289289
---

docs/ARCHITECTURE.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
|| 说明 |
277277
|----|------|
278278
| fflate | 通用压缩/解压(gzip/deflate/zlib) |
279-
| fzstd | 浏览器安全的 Zstandard 解压(MCAP chunk 压缩) |
279+
| @ioai/wasm-zstd | Vite 友好的 WebAssembly Zstandard 解压(MCAP chunk 压缩) |
280280
| lz4js | 浏览器安全的 LZ4 解压(MCAP/ROS1 chunk 压缩) |
281281

282282
---
@@ -901,7 +901,7 @@ rosview/
901901

902902
"fflate": "^0.8.2",
903903
"@mcap/browser": "^1.1.0",
904-
"fzstd": "^0.1.1",
904+
"@ioai/wasm-zstd": "^1.1.0",
905905
"lz4js": "^0.2.0",
906906

907907
"zustand": "^5.0.0",

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ioai/rosview",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "High-performance robotics data visualization for MCAP, ROS bag, ROS2 db3, HDF5 and BVH — embeddable React component and standalone SPA",
55
"keywords": [
66
"ros",
@@ -97,8 +97,9 @@
9797
"@foxglove/rosmsg-serialization": "^2.0.4",
9898
"@foxglove/rosmsg2-serialization": "^3.0.3",
9999
"@ioai/hdf5": "^1.0.0",
100-
"@mcap/core": "^2.0.2",
100+
"@ioai/wasm-zstd": "^1.1.0",
101101
"@mcap/browser": "^1.1.0",
102+
"@mcap/core": "^2.0.2",
102103
"@playwright/test": "^1.59.1",
103104
"@radix-ui/react-collapsible": "^1.1.12",
104105
"@radix-ui/react-dialog": "^1.1.5",
@@ -134,7 +135,6 @@
134135
"eventemitter3": "^5.0.1",
135136
"fflate": "^0.8.2",
136137
"flatbuffers": "^25.9.23",
137-
"fzstd": "^0.1.1",
138138
"globals": "^17.4.0",
139139
"happy-dom": "^20.9.0",
140140
"intervals-fn": "^3.0.3",
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import type { McapTypes } from "@mcap/core";
2-
import { decompress as fzstdDecompress } from "fzstd";
2+
import { decompress as zstdDecompress, init as initZstd } from "@ioai/wasm-zstd";
3+
import zstdWasmUrl from "@ioai/wasm-zstd/wasm-zstd.wasm?url";
34
import * as lz4js from "lz4js";
45

5-
// @mcap/support currently pulls CommonJS wasm loaders that fail in Vite's
6-
// ES module worker build, so keep these browser-safe ESM handlers local.
6+
// Load the zstd wasm module explicitly so Vite owns the wasm asset URL in both
7+
// dev and production worker bundles.
78

89
let handlersPromise: Promise<McapTypes.DecompressHandlers> | undefined;
910

1011
export async function loadDecompressHandlers(): Promise<McapTypes.DecompressHandlers> {
1112
return await (handlersPromise ??= _loadDecompressHandlers());
1213
}
1314

14-
function _loadDecompressHandlers(): Promise<McapTypes.DecompressHandlers> {
15-
return Promise.resolve({
15+
async function _loadDecompressHandlers(): Promise<McapTypes.DecompressHandlers> {
16+
await initZstd({ wasmUrl: zstdWasmUrl });
17+
18+
return {
1619
lz4: (buffer, decompressedSize) => {
1720
const output = new Uint8Array(Number(decompressedSize));
1821
const result = lz4js.decompressBlock(buffer, output, 0, buffer.byteLength, 0);
@@ -22,8 +25,7 @@ function _loadDecompressHandlers(): Promise<McapTypes.DecompressHandlers> {
2225
return output;
2326
},
2427
zstd: (buffer, decompressedSize) => {
25-
const output = new Uint8Array(Number(decompressedSize));
26-
return fzstdDecompress(buffer, output);
28+
return zstdDecompress(buffer, Number(decompressedSize));
2729
},
28-
});
30+
};
2931
}

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export default defineConfig({
5656
'@foxglove/rosmsg',
5757
'@foxglove/rosmsg-serialization',
5858
'@foxglove/rosmsg2-serialization',
59+
'@ioai/wasm-zstd',
5960
'@mcap/browser',
6061
'@mcap/core',
6162
'eventemitter3',
6263
'flatbuffers/js/flexbuffers.js',
63-
'fzstd',
6464
'intervals-fn',
6565
'lz4js',
6666
'protobufjs',

0 commit comments

Comments
 (0)