@componentor/fs 3.0.50 → 3.0.52
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/dist/index.js +125 -25
- package/dist/index.js.map +1 -1
- package/dist/workers/async-relay.worker.js +5 -2
- package/dist/workers/async-relay.worker.js.map +1 -1
- package/dist/workers/repair.worker.js +90 -14
- package/dist/workers/repair.worker.js.map +1 -1
- package/dist/workers/server.worker.js +90 -14
- package/dist/workers/server.worker.js.map +1 -1
- package/dist/workers/sync-relay.worker.js +107 -16
- package/dist/workers/sync-relay.worker.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +13 -0
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -604,6 +604,19 @@ Make sure `opfsSync` is enabled (it's `true` by default). Files are mirrored to
|
|
|
604
604
|
|
|
605
605
|
See [CHANGELOG.md](./CHANGELOG.md) for the full version history.
|
|
606
606
|
|
|
607
|
+
### v3.0.52 (2026)
|
|
608
|
+
|
|
609
|
+
**Fixes:**
|
|
610
|
+
- Sync FS calls on the browser main thread (which can't use `Atomics.wait` and so spin on `Atomics.load`) no longer abort a legitimately slow operation. The old fixed timeout (10 s, briefly 60 s) killed in-flight `rename`/`copy` over large trees — e.g. `create-strapi-app`'s git init over a fresh `node_modules` — while a genuinely dead worker still blocked for the whole timeout. The relay worker now pulses a heartbeat counter in the control SAB every 1 s (it keeps ticking even while parked on an `await` inside a long op), and the spin-wait aborts only if that heartbeat stalls for 20 s — no upper bound on a progressing op
|
|
611
|
+
- Fix corruption/hang on large sync writes. A `writeFileSync`/`writeSync`/`appendFileSync` of more than ~2 MB (the default SAB data window) is chunked over the SAB; the response-wait afterward waited on the wrong control-word sentinel (`REQUEST` instead of the last chunk's `CHUNK`), so it fell through immediately and read stale request bytes as the response, then wedged. Now waits on the frame it actually wrote last, matching the async path
|
|
612
|
+
- Add a Playwright regression test round-tripping ≈2 MB / ≈5 MB payloads through the sync and promises write APIs with byte-for-byte verification; `playwright-report/` and `test-results/` are now gitignored
|
|
613
|
+
|
|
614
|
+
### v3.0.51 (2026)
|
|
615
|
+
|
|
616
|
+
**Fixes:**
|
|
617
|
+
- Fix O(N²) regression introduced in 3.0.49. The implicit-directory guard added then (`isImplicitDirectory(path)` in `write`, `symlink`, `link`, `copy`, plus several stat-side methods) called `rebuildImplicitDirs` — O(N×depth) over all pathIndex entries — on every invocation, and `pathIndexGen` was bumped on every mutation, so the cache was always invalid by the next call. Batch workloads (Vite optimize, pnpm install, Strapi unpacks of thousands of files) went quadratic. Measured on a 5000-file write benchmark: **3.0.48 baseline 26 ms → 3.0.50 1725 ms (66× slower) → 3.0.51 23 ms (back to baseline)**
|
|
618
|
+
- Replace the on-demand rebuild with an incrementally maintained `descCount` map. `isImplicitDirectory(P)` is now O(1): `!pathIndex.has(P) && descCount[P] > 0`. Maintenance is O(depth) per pathIndex mutation, behind two helpers (`setPathIndex`, `deletePathIndex`) that wrap the 12 mutation sites
|
|
619
|
+
|
|
607
620
|
### v3.0.50 (2026)
|
|
608
621
|
|
|
609
622
|
**Fixes:**
|