@converse/skeletor 3.1.1 → 3.1.2
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/CHANGES.md +124 -0
- package/package.json +4 -2
package/CHANGES.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.1.2 (2026-06-22)
|
|
4
|
+
|
|
5
|
+
- Fix the published package missing its `dist/` directory. `dist/` is gitignored and nothing built
|
|
6
|
+
it during the publish lifecycle, so `npm publish` could ship a tarball without the compiled
|
|
7
|
+
bundles that `main`/`module`/`exports` point at (3.1.1 was published this way and is unusable).
|
|
8
|
+
Add a `prepack` script that runs the build, so `npm pack` and `npm publish` always include a
|
|
9
|
+
freshly built `dist/`.
|
|
10
|
+
|
|
11
|
+
## 3.1.1 (2026-06-22)
|
|
12
|
+
|
|
13
|
+
- Fix browser builds failing to resolve `./drivers/nodeSQLiteStorage`. The node-only SQLite
|
|
14
|
+
storage driver is now registered by the `@converse/skeletor/node` entry point instead of
|
|
15
|
+
being pulled in via a dynamic `import()` from the shared storage module. The browser bundles
|
|
16
|
+
(`skeletor.esm.js`, `skeletor.js`, `skeletor.min.js`) no longer contain a reference to a file
|
|
17
|
+
that isn't published, which broke downstream bundlers.
|
|
18
|
+
|
|
19
|
+
## 3.1.0 (2026-06-22)
|
|
20
|
+
|
|
21
|
+
- Add an ESM build
|
|
22
|
+
- **Rename `browserStorage` → `storage`** on `Model` and `Collection`
|
|
23
|
+
- Add `BrowserStorage` as a deprecated export alias for `PersistentStorage`
|
|
24
|
+
- Add `autoSync` opt-in for transparent local persistence:
|
|
25
|
+
- Declare `get autoSync() { return true; }` on a model or collection to enable.
|
|
26
|
+
- **Auto-hydrate**: the model/collection loads its stored state on construction. `await model.initialized` resolves when done.
|
|
27
|
+
- **Auto-save** (models only): any `set()` (including `attrs.x = y`) that produces changes schedules a debounced save. Pass `{ noAutoSave: true }` to opt out per-call
|
|
28
|
+
- **Flush on unload**: when `autoSync` is used in a browser, Skeletor lazily registers `pagehide`/`visibilitychange` listeners that make a best-effort flush of pending writes when the tab is hidden/closing.
|
|
29
|
+
- **Destroy/save ordering**: `destroy()` now sequences its delete after any auto-save that has already fired and is still in flight, so a late write can no longer land after the delete and resurrect the record.
|
|
30
|
+
- **Error reporting**: a failed auto-save emits an `error` event on the model. Storage-layer failures surface through `sync`'s `error` callback (as before), and rejections that bypass it are emitted on the same event.
|
|
31
|
+
- Override `get autoSyncDelay()` to tune the debounce window (default: 100 ms).
|
|
32
|
+
- Complete the `fetch({ promise: true })` contract: `Model.fetch` now supports the `promise` option (previously ignored), and the promise returned by both `Model.fetch` and `Collection.fetch` now **rejects** on error instead of hanging forever.
|
|
33
|
+
- Add `PersistentStorage.flushAll()` static method to flush all registered storage instances.
|
|
34
|
+
- Add `getStorage(obj)` helper export — returns the configured storage for a model/collection, checking both `storage` and `browserStorage` (preserves compat with subclasses that still override `get browserStorage()`).
|
|
35
|
+
- Add computed properties to `Model`. Declare a `computed` getter returning `{ key: { deps, fn } }` definitions.
|
|
36
|
+
Values are cached, recalculated when deps change, and fire `change:key` events.
|
|
37
|
+
Accessible via `model.get('key')` and `model.attrs.key`.
|
|
38
|
+
- Add `attrs` proxy property on `Model` for ergonomic reactive attribute access:
|
|
39
|
+
`model.attrs.name` reads, `model.attrs.name = 'Bob'` writes (fires change events).
|
|
40
|
+
- Add `subscribe()` method to `EventEmitter`, `Model`, and `Collection`, returning an unsubscribe function.
|
|
41
|
+
Compatible with React's `useSyncExternalStore` and other store-style APIs.
|
|
42
|
+
`Model.subscribe(callback)` receives `(model, changed)` on any attribute change.
|
|
43
|
+
`Collection.subscribe(callback)` fires once per operation (on `update`, `reset`, or `sort` events).
|
|
44
|
+
|
|
45
|
+
## 3.0.0 (2025-12-13)
|
|
46
|
+
|
|
47
|
+
- `Collection.prototype.create` no longer returns a boolean (but `null` instead)
|
|
48
|
+
- `Storage` is now exported as `BrowserStorage`
|
|
49
|
+
|
|
50
|
+
## 2.0.0 (2025-12-13)
|
|
51
|
+
|
|
52
|
+
### Breaking changes
|
|
53
|
+
|
|
54
|
+
- `Model.prototype.set` no longer returns a boolean when validation fails (but `null` instead)
|
|
55
|
+
- Loosened the `reduce` and `reduceRight` type signatures on the `Collection`
|
|
56
|
+
|
|
57
|
+
## 1.0.0 (2025-12-13)
|
|
58
|
+
|
|
59
|
+
- Rewrite as TypeScript
|
|
60
|
+
|
|
61
|
+
### Breaking changes:
|
|
62
|
+
|
|
63
|
+
- Removed the `clone()` method on `Model`.
|
|
64
|
+
- Removed the old `View` type
|
|
65
|
+
- Removed `ElementView`
|
|
66
|
+
- Removed the old `Events` constructor function and instead added the `EventsEmitter` mixin class.
|
|
67
|
+
- Removed the `Router` and `History` classes.
|
|
68
|
+
- All other types (`Model`, `Collection`) are now ES6 classes.
|
|
69
|
+
|
|
70
|
+
## 0.0.9 (2025-03-04)
|
|
71
|
+
|
|
72
|
+
- Fix a race condition when setting a localForage driver
|
|
73
|
+
- Refactor the sync method to properly call the `fetch` API
|
|
74
|
+
|
|
75
|
+
## 0.0.8 (2023-02-14)
|
|
76
|
+
|
|
77
|
+
- Use the released version of `@converse/localforage-getitems`
|
|
78
|
+
- Update 3rd party dependencies
|
|
79
|
+
|
|
80
|
+
## 0.0.7 (2022-04-08)
|
|
81
|
+
|
|
82
|
+
- Move code that needs to be bundled to `dependencies` from `devDependencies`
|
|
83
|
+
- Update localForage-getItems to fix a build issue on Windows
|
|
84
|
+
|
|
85
|
+
## 0.0.6 (2022-04-08)
|
|
86
|
+
|
|
87
|
+
- Use the `getAll` IndexedDB function, which should result in a significant speedup
|
|
88
|
+
- Update various 3rd party dependencies.
|
|
89
|
+
|
|
90
|
+
## 0.0.5 (2021-07-08)
|
|
91
|
+
|
|
92
|
+
- #13 Import the default export of localforage
|
|
93
|
+
- Don't expect a collection's `model` attribute to have a `prototype`. It might be an arrow function, in which case it doesn't.
|
|
94
|
+
- Update to mergebounce 0.1.0
|
|
95
|
+
|
|
96
|
+
## 0.0.4 (2021-05-12)
|
|
97
|
+
|
|
98
|
+
- Upgrade to lit 2.0.0-rc.2
|
|
99
|
+
|
|
100
|
+
## 0.0.3 (2021-04-28)
|
|
101
|
+
|
|
102
|
+
- Create the `ElementView`, which is like a Backbone View but extends
|
|
103
|
+
`HTMLElement` and is therefore also a custom element or web component.
|
|
104
|
+
/home/kalie/src/converse.prosody/src/converse.js/src/headless/core.js: \* @property {object} converse.env.\_ - The instance of [lodash-es](http://lodash.com) used by Converse.
|
|
105
|
+
- Allow writes to the client-side store to be batched (via [mergebounce](https://github.com/conversejs/mergebounce)).
|
|
106
|
+
This is particularly useful for IndexedDB, which has a very slow writing speed.
|
|
107
|
+
To enabled batched writes, pass in `true` for the 3rd parameter of the
|
|
108
|
+
`Storage` constructor.
|
|
109
|
+
|
|
110
|
+
## 0.0.2 (2020-09-18)
|
|
111
|
+
|
|
112
|
+
Initial fork from Backbone
|
|
113
|
+
|
|
114
|
+
- Removes the dependency on jQuery
|
|
115
|
+
- Instead of the `render` method Views can have a `toHTML` method which must return a
|
|
116
|
+
[lit-html](https://lit-html.polymer-project.org/) `TemplateResult`.
|
|
117
|
+
- Replaces [underscore](http://underscorejs.org) with [lodash](https://lodash.com)
|
|
118
|
+
- Imports lodash methods individually to allow for tree-shaking
|
|
119
|
+
- Uses the native browser API instead of lodash
|
|
120
|
+
- Drops support for older browsers (including IE) and uses ES6+ language features
|
|
121
|
+
- Splits models, views and collections into separate modules
|
|
122
|
+
- Adds a new `ElementView` class, which is a like a Backbone View, but doubles
|
|
123
|
+
as an instance of HTMLElement and can be used to register a custom element or
|
|
124
|
+
web-component.
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"contributors": [
|
|
37
37
|
"JC Brand"
|
|
38
38
|
],
|
|
39
|
-
"version": "3.1.
|
|
39
|
+
"version": "3.1.2",
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=22.0.0"
|
|
42
42
|
},
|
|
@@ -55,12 +55,14 @@
|
|
|
55
55
|
"dev": "karma start --single-run=false",
|
|
56
56
|
"lint": "eslint src/*.ts test/*.ts",
|
|
57
57
|
"prebuild": "npm run clean && mkdir -p dist/defs",
|
|
58
|
+
"prepack": "npm run build",
|
|
58
59
|
"prettier": "prettier --write src/**/*.js test/**/*.js src/**/*.ts test/**/*.ts",
|
|
59
60
|
"test": "karma start && karma start --mocha-only",
|
|
60
61
|
"test:node": "tsx node_modules/mocha/bin/mocha.js 'test/nodeStorage.test.ts'"
|
|
61
62
|
},
|
|
62
63
|
"files": [
|
|
63
64
|
"LICENSE",
|
|
65
|
+
"CHANGES.md",
|
|
64
66
|
"dist/skeletor.js",
|
|
65
67
|
"dist/skeletor.esm.js",
|
|
66
68
|
"dist/skeletor.js.map",
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
"dist/skeletor.node.mjs",
|
|
71
73
|
"dist/skeletor.d.ts",
|
|
72
74
|
"dist/skeletor.d.ts.map",
|
|
73
|
-
"src
|
|
75
|
+
"src/**/*.ts"
|
|
74
76
|
],
|
|
75
77
|
"dependencies": {
|
|
76
78
|
"@converse/localforage-getitems": "1.4.3",
|