libfw-client 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,10 +102,10 @@ dist/libfw-client.umd.js UMD bundle (after build:umd)
102
102
  - `downloadWindow: number` (default `4`) — in-flight byte-range window per
103
103
  single file download (how many concurrent `Range` GETs); raise it on
104
104
  high-latency links. `1` disables parallelism (sequential downloads).
105
- - `downloadChunkSize: number` (default `262144`, 256 KiB) — byte range size
106
- for parallel downloads; the engine reorders in-flight chunks in memory
107
- (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the SDK
108
- still receives data in order.
105
+ - `chunkSize: number` (default `2097152`, 2 MiB) — shared size used for
106
+ both upload chunks and parallel download ranges; the engine reorders
107
+ in-flight chunks in memory (worst case ≈ `downloadWindow * chunkSize`
108
+ bytes) so the SDK still receives data in order.
109
109
  - `downloadMode: 'auto' | 'fs' | 'browser'` (default `'auto'`) — `'fs'`
110
110
  streams downloads through the File System Access API; `'browser'` buffers
111
111
  and triggers a traditional browser download (folders become `.zip`);
@@ -130,7 +130,7 @@ dist/libfw-client.umd.js UMD bundle (after build:umd)
130
130
  - `tuneStatus() → { phase, params, stats, capsHash } | null` — live
131
131
  adaptive-tuning status. `phase` is `uninitialized | ramping | settled |
132
132
  degraded`; `params` is `{ concurrency, uploadWindow, downloadWindow,
133
- chunkSize, downloadChunkSize, compressLevel }`; `stats` is
133
+ chunkSize, compressLevel }`; `stats` is
134
134
  `{ rttMs, mbps }` (EWMA request RTT, last-window throughput). `null`
135
135
  until the WASM engine is initialised.
136
136
  - Events: with `autoTune` enabled, `onEvent` additionally receives
package/index.d.ts CHANGED
@@ -55,10 +55,8 @@ export interface TuningParams {
55
55
  uploadWindow: number;
56
56
  /** In-flight byte-range GETs per single-file download. */
57
57
  downloadWindow: number;
58
- /** Upload chunk size in bytes. */
58
+ /** Shared chunk size in bytes for uploads and parallel downloads. */
59
59
  chunkSize: number;
60
- /** Download byte-range size in bytes. */
61
- downloadChunkSize: number;
62
60
  /** zrip compression level (negative = faster, positive = smaller). */
63
61
  compressLevel: number;
64
62
  }
@@ -127,13 +125,6 @@ export interface LibfwClientOptions {
127
125
  * parallelism (sequential downloads). Default `4`.
128
126
  */
129
127
  downloadWindow?: number;
130
- /**
131
- * Byte range size for parallel downloads. The engine reorders in-flight
132
- * chunks in memory (worst case ≈ `downloadWindow * downloadChunkSize`
133
- * bytes) so the SDK still receives data strictly in order. Default
134
- * `262144` (256 KiB).
135
- */
136
- downloadChunkSize?: number;
137
128
  /** Negotiate zrip compression. Default `true`. */
138
129
  compress?: boolean;
139
130
  /** Upload chunk size in bytes. Default 2 MiB. */
@@ -291,7 +282,7 @@ export declare class LibfwClient {
291
282
  * @returns `{ phase, params, stats, capsHash }` — `phase` is
292
283
  * `uninitialized | ramping | settled | degraded`; `params` holds the
293
284
  * tuned `concurrency` / `uploadWindow` / `downloadWindow` / `chunkSize`
294
- * / `downloadChunkSize` / `compressLevel`; `stats` is
285
+ * / `compressLevel`; `stats` is
295
286
  * `{ rttMs, mbps }` (EWMA request RTT, last-window throughput).
296
287
  * `null` until the WASM engine is initialised (or when `autoTune` is
297
288
  * disabled, `phase` stays `uninitialized`).
package/index.js CHANGED
@@ -207,16 +207,11 @@ export class LibfwClient {
207
207
  * transfer), so a single file's throughput is bounded by bandwidth
208
208
  * instead of one connection's `chunkSize / RTT` on high-latency
209
209
  * links. `1` disables parallelism (sequential downloads).
210
- * @param {number} [options.downloadChunkSize=262144] byte range size for
211
- * parallel downloads (256 KiB default). Smaller than the upload
212
- * chunk on purpose: the engine reorders in-flight chunks in memory
213
- * (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the
214
- * SDK still receives data strictly in order.
215
210
  * @param {boolean} [options.compress=true] negotiate zrip compression
216
- * @param {number} [options.chunkSize=2097152] upload chunk size in bytes
217
- * (each chunk is split into many small ~64 KiB compressed frames, so
218
- * any value works; larger = fewer, bigger POST requests — bounded
219
- * only by the server's upload limit and client memory)
211
+ * @param {number} [options.chunkSize=2097152] shared chunk size in bytes for
212
+ * both upload chunks and parallel download ranges. The same value is
213
+ * used on both paths, and any value works as long as the server and
214
+ * memory budget permit it (larger = fewer, bigger requests).
220
215
  * @param {number} [options.maxRetries=3] retries per chunk/file before failing
221
216
  * @param {number} [options.baseRetryDelayMs=500] initial backoff (ms)
222
217
  * @param {number} [options.maxRetryDelayMs=30000] backoff ceiling (ms)
@@ -272,7 +267,6 @@ export class LibfwClient {
272
267
  concurrency: 4,
273
268
  uploadWindow: 8,
274
269
  downloadWindow: 4,
275
- downloadChunkSize: 256 * 1024,
276
270
  compress: true,
277
271
  chunkSize: 2 * 1024 * 1024,
278
272
  maxRetries: 3,
@@ -338,7 +332,6 @@ export class LibfwClient {
338
332
  concurrency: this._options.concurrency,
339
333
  uploadWindow: this._options.uploadWindow,
340
334
  downloadWindow: this._options.downloadWindow,
341
- downloadChunkSize: this._options.downloadChunkSize,
342
335
  compress: this._options.compress,
343
336
  chunkSize: this._options.chunkSize,
344
337
  maxRetries: this._options.maxRetries,
@@ -1246,8 +1239,7 @@ export class LibfwClient {
1246
1239
  *
1247
1240
  * - `phase`: `uninitialized | ramping | settled | degraded`
1248
1241
  * - `params`: `{ concurrency, uploadWindow, downloadWindow, chunkSize,
1249
- * downloadChunkSize, compressLevel }` — the parameters the engine is
1250
- * currently tuned to
1242
+ * compressLevel }` — the parameters the engine is currently tuned to
1251
1243
  * - `stats`: `{ rttMs, mbps }` — EWMA request RTT and last-window
1252
1244
  * throughput of the most recent transfer
1253
1245
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libfw-client",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "High-performance streaming file & folder transfer SDK for the browser (libfw WASM engine + File System Access API + IndexedDB resume).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,8 +29,8 @@ export class LibfwClient {
29
29
  has_callbacks(): boolean;
30
30
  /**
31
31
  * Create an engine. `options` may include:
32
- * `{ concurrency, uploadWindow, downloadWindow, downloadChunkSize,
33
- * compress, compressLevel, chunkSize, maxRetries, baseRetryDelayMs,
32
+ * `{ concurrency, uploadWindow, downloadWindow, compress,
33
+ * compressLevel, chunkSize, maxRetries, baseRetryDelayMs,
34
34
  * maxRetryDelayMs, timeoutMs, autoTune, tuneTtlMs }`.
35
35
  */
36
36
  constructor(opts: any);
@@ -72,8 +72,8 @@ export class LibfwClient {
72
72
  }
73
73
  /**
74
74
  * Create an engine. `options` may include:
75
- * `{ concurrency, uploadWindow, downloadWindow, downloadChunkSize,
76
- * compress, compressLevel, chunkSize, maxRetries, baseRetryDelayMs,
75
+ * `{ concurrency, uploadWindow, downloadWindow, compress,
76
+ * compressLevel, chunkSize, maxRetries, baseRetryDelayMs,
77
77
  * maxRetryDelayMs, timeoutMs, autoTune, tuneTtlMs }`.
78
78
  * @param {any} opts
79
79
  */
Binary file
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "libfw-client",
3
3
  "type": "module",
4
4
  "description": "WASM engine + JS SDK for libfw browser clients",
5
- "version": "0.4.2",
5
+ "version": "0.4.3",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",