@componentor/fs 3.0.15 → 3.0.17

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
@@ -570,6 +570,16 @@ Make sure `opfsSync` is enabled (it's `true` by default). Files are mirrored to
570
570
 
571
571
  ## Changelog
572
572
 
573
+ ### v3.0.17 (2026)
574
+
575
+ **Features:**
576
+ - Auto-populate VFS from existing OPFS files when `.vfs.bin` doesn't exist — seamless transition from OPFS mode back to hybrid mode without manual `loadFromOPFS()` call
577
+
578
+ ### v3.0.16 (2026)
579
+
580
+ **Fixes:**
581
+ - Add 10s timeout to main-thread spin-wait — prevents infinite busy loop if SharedWorker is dead or unresponsive
582
+
573
583
  ### v3.0.15 (2026)
574
584
 
575
585
  **Fixes:**
package/dist/index.js CHANGED
@@ -1277,11 +1277,18 @@ var DEFAULT_SAB_SIZE = 2 * 1024 * 1024;
1277
1277
  var instanceRegistry = /* @__PURE__ */ new Map();
1278
1278
  var HEADER_SIZE = SAB_OFFSETS.HEADER_SIZE;
1279
1279
  var _canAtomicsWait = typeof globalThis.WorkerGlobalScope !== "undefined";
1280
+ var SPIN_TIMEOUT_MS = 1e4;
1280
1281
  function spinWait(arr, index, value) {
1281
1282
  if (_canAtomicsWait) {
1282
1283
  Atomics.wait(arr, index, value);
1283
1284
  } else {
1285
+ const start = performance.now();
1284
1286
  while (Atomics.load(arr, index) === value) {
1287
+ if (performance.now() - start > SPIN_TIMEOUT_MS) {
1288
+ throw new Error(
1289
+ `VFS sync operation timed out after ${SPIN_TIMEOUT_MS / 1e3}s \u2014 SharedWorker may be unresponsive`
1290
+ );
1291
+ }
1285
1292
  }
1286
1293
  }
1287
1294
  }