isomorphic-jj 1.14.0 → 1.14.1
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/browser/helpers.js +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.14.1 — 2026-10-14 — createBrowserFS works in Web Workers
|
|
4
|
+
|
|
5
|
+
Fixes [#58](https://github.com/johnhenry/isomorphic-jj/issues/58).
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`createBrowserFS()` threw in a Web Worker even when `opts.fs` was supplied.**
|
|
10
|
+
It required `window`, which workers lack. A supplied `opts.fs` is now used
|
|
11
|
+
directly with no environment check; the default LightningFS path checks for
|
|
12
|
+
`indexedDB` (present in windows and workers) instead of `window`, and the
|
|
13
|
+
error when neither is available now says so and points at `opts.fs`.
|
|
14
|
+
|
|
3
15
|
## 1.14.0 — 2026-10-09 — describe()/metaedit() honor changeId; operations.restore() restores the view
|
|
4
16
|
|
|
5
17
|
Fixes [#55](https://github.com/johnhenry/isomorphic-jj/issues/55) and
|
package/README.md
CHANGED
|
@@ -1020,7 +1020,7 @@ repo/
|
|
|
1020
1020
|
|
|
1021
1021
|
## Project Status
|
|
1022
1022
|
|
|
1023
|
-
**Current Version**: 1.14.
|
|
1023
|
+
**Current Version**: 1.14.1 (`@johnhenry/isomorphic-jj`; same library/API lineage as the old `isomorphic-jj`, which reached v1.8.0 before the rename — see the provenance note at the top of this file, and the CHANGELOG's `1.9.0` entry for how the scoped/unscoped version lineages were merged back together)
|
|
1024
1024
|
**Test Coverage**: 1882 tests passing, ~97% statements / 90% branches
|
|
1025
1025
|
**JJ CLI parity**: tracks Jujutsu through v0.45.1
|
|
1026
1026
|
**Status**: Actively developed; broad JJ CLI semantic parity, used in the examples/apps in this repo and in [JJHub](#family). Not yet 1.0 in the API-stability sense (the version number is past 1.0 only because merging the scoped/unscoped lineages forced it above the unscoped side's prior ceiling, not because the API is frozen) — API surface can still shift; pin a version and read the CHANGELOG before upgrading.
|
package/package.json
CHANGED
package/src/browser/helpers.js
CHANGED
|
@@ -44,13 +44,8 @@
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
export async function createBrowserFS(opts = {}) {
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
throw new Error('createBrowserFS() should only be used in browser environments');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Caller supplied their own filesystem — use it directly instead of
|
|
53
|
-
// pulling in LightningFS at all.
|
|
47
|
+
// Caller supplied their own filesystem — use it directly. No window check:
|
|
48
|
+
// this must work in Web Workers (no `window`) and other non-DOM runtimes.
|
|
54
49
|
if (opts.fs) {
|
|
55
50
|
if (typeof opts.fs === 'function') {
|
|
56
51
|
return new opts.fs(opts.name || 'jj', { wipe: opts.wipe || false });
|
|
@@ -58,6 +53,15 @@ export async function createBrowserFS(opts = {}) {
|
|
|
58
53
|
return opts.fs;
|
|
59
54
|
}
|
|
60
55
|
|
|
56
|
+
// The default LightningFS backend needs IndexedDB, which exists in both
|
|
57
|
+
// windows and workers. Check for that feature rather than for `window`.
|
|
58
|
+
if (typeof indexedDB === 'undefined') {
|
|
59
|
+
throw new Error(
|
|
60
|
+
'createBrowserFS() requires IndexedDB (available in browsers and Web Workers). ' +
|
|
61
|
+
'Pass your own filesystem via opts.fs to use it elsewhere.'
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
// Dynamic `import()` (not `require`) so this resolves in an ESM browser
|
|
62
66
|
// bundle — `require` does not exist there (see issue #28). Users must
|
|
63
67
|
// install @isomorphic-git/lightning-fs separately; it's an optional
|