@everystate/core 1.0.7 → 1.0.9
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 +11 -4
- package/everyState.js +3 -3
- package/package.json +1 -1
- package/self-test.js +3 -3
- package/tests/core.test.js +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @everystate/core v1.0.
|
|
1
|
+
# @everystate/core v1.0.9
|
|
2
2
|
|
|
3
3
|
**EveryState: Observable state management with dot-path addressing**
|
|
4
4
|
|
|
@@ -122,7 +122,7 @@ EveryState is a reactive state management library where:
|
|
|
122
122
|
- **Atomic batching**: Multiple writes, single notification per path
|
|
123
123
|
- **Path introspection**: `has()` and `keys()` for runtime path discovery
|
|
124
124
|
- **Zero dependencies**: ~2KB minified
|
|
125
|
-
- **Framework-agnostic**: Works with React, Vue, Angular, Svelte, or vanilla JS
|
|
125
|
+
- **Framework-agnostic**: Works with React, Vue, Angular, Solid, Svelte, or vanilla JS
|
|
126
126
|
|
|
127
127
|
## Why EveryState?
|
|
128
128
|
|
|
@@ -138,21 +138,28 @@ EveryState makes state **addressable, observable, and testable** without special
|
|
|
138
138
|
| Package | Description | License |
|
|
139
139
|
|---|---|---|
|
|
140
140
|
| [@everystate/aliases](https://www.npmjs.com/package/@everystate/aliases) | Ergonomic single-character and short-name DOM aliases for vanilla JS | MIT |
|
|
141
|
+
| [@everystate/angular](https://www.npmjs.com/package/@everystate/angular) | Angular adapter: `usePath`, `useIntent`, `useWildcard`, `useAsync` - bridges store to Angular signals | MIT |
|
|
141
142
|
| [@everystate/core](https://www.npmjs.com/package/@everystate/core) | Path-based state management with wildcard subscriptions and async support. Core state engine (you are here). | MIT |
|
|
142
143
|
| [@everystate/css](https://www.npmjs.com/package/@everystate/css) | Reactive CSSOM engine: design tokens, typed validation, WCAG enforcement, all via path-based state | MIT |
|
|
143
144
|
| [@everystate/examples](https://www.npmjs.com/package/@everystate/examples) | Example applications and patterns | MIT |
|
|
145
|
+
| [@everystate/pattern-catalogue](https://www.npmjs.com/package/@everystate/pattern-catalogue) | Comprehensive demonstration of 13 UI patterns using the "No Ceiling" hybrid architecture | MIT |
|
|
144
146
|
| [@everystate/perf](https://www.npmjs.com/package/@everystate/perf) | Performance monitoring overlay | MIT |
|
|
145
147
|
| [@everystate/react](https://www.npmjs.com/package/@everystate/react) | React hooks adapter: `usePath`, `useIntent`, `useAsync` hooks and `EventStateProvider` | MIT |
|
|
146
148
|
| [@everystate/renderer](https://www.npmjs.com/package/@everystate/renderer) | Direct-binding reactive renderer: `bind-*`, `set`, `each` attributes. Zero build step | MIT |
|
|
147
149
|
| [@everystate/router](https://www.npmjs.com/package/@everystate/router) | SPA routing as state | MIT |
|
|
150
|
+
| [@everystate/solid](https://www.npmjs.com/package/@everystate/solid) | Solid adapter: `usePath`, `useIntent`, `useWildcard`, `useAsync` - bridges store to Solid signals | MIT |
|
|
148
151
|
| [@everystate/test](https://www.npmjs.com/package/@everystate/test) | Event-sequence testing for UIstate stores. Zero dependency. | MIT |
|
|
152
|
+
| [@everystate/types](https://www.npmjs.com/package/@everystate/types) | Typed dot-path autocomplete for EveryState stores (you are here) | MIT |
|
|
153
|
+
| [@everystate/ui](https://www.npmjs.com/package/@everystate/ui) | Tree-shakable, transparent, framework-free imperative UI components. Every component is readable vanilla JS | MIT |
|
|
149
154
|
| [@everystate/view](https://www.npmjs.com/package/@everystate/view) | State-driven view: DOMless resolve + surgical DOM projector. View tree as first-class state | MIT |
|
|
155
|
+
| [@everystate/view-ui](https://www.npmjs.com/package/@everystate/view-ui) | Declarative UI component specs: plain JS objects + handler maps. The declarative twin of @everystate/ui | MIT |
|
|
150
156
|
| [@everystate/vue](https://www.npmjs.com/package/@everystate/vue) | Vue 3 composables adapter: `provideStore`, `usePath`, `useIntent`, `useWildcard`, `useAsync` | MIT |
|
|
151
|
-
| [@everystate/types](https://www.npmjs.com/package/@everystate/types) | Typed dot-path autocomplete for EveryState stores (you are here) | MIT |
|
|
152
157
|
|
|
153
158
|
## Documentation
|
|
154
159
|
|
|
155
|
-
Full documentation
|
|
160
|
+
Full documentation available at [everystate.dev](https://everystate.dev).
|
|
161
|
+
|
|
162
|
+
Source code: [https://github.com/ImsirovicAjdin/everystate-core](https://github.com/ImsirovicAjdin/everystate-core)
|
|
156
163
|
|
|
157
164
|
## License
|
|
158
165
|
|
package/everyState.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EveryState v1.0.
|
|
2
|
+
* EveryState v1.0.9 - Optimized Path-Based State Management
|
|
3
3
|
*
|
|
4
4
|
* A lightweight, performant state management library using path-based subscriptions.
|
|
5
5
|
* Optimized for selective notifications and granular updates.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Selective subscriptions (only relevant subscribers fire)
|
|
10
10
|
* - Wildcard subscriptions (e.g., 'user.*' catches all user changes)
|
|
11
11
|
* - Global subscriptions (e.g., '*' catches all changes)
|
|
12
|
-
* - Atomic batching (batch/setMany
|
|
12
|
+
* - Atomic batching (batch/setMany - subscribers fire after all writes)
|
|
13
13
|
* - Zero dependencies
|
|
14
14
|
* - ~2KB minified
|
|
15
15
|
*
|
|
@@ -85,7 +85,7 @@ export function createEveryState(initial = {}) {
|
|
|
85
85
|
if (destroyed || listeners.size === 0) return value;
|
|
86
86
|
|
|
87
87
|
// Lazy detail allocation: only build the object when a listener is
|
|
88
|
-
// actually present. No closure is created
|
|
88
|
+
// actually present. No closure is created - the inline `||` re-uses
|
|
89
89
|
// the same object across exact / wildcard / global dispatch.
|
|
90
90
|
let detail = null;
|
|
91
91
|
|
package/package.json
CHANGED
package/self-test.js
CHANGED
|
@@ -251,13 +251,13 @@ console.log('\n11. fast-path: no detail allocated without listeners');
|
|
|
251
251
|
const s11 = createEveryState({ a: 0 });
|
|
252
252
|
let s11fires = 0;
|
|
253
253
|
|
|
254
|
-
// set with zero subscribers
|
|
254
|
+
// set with zero subscribers - fast-path should skip all dispatch
|
|
255
255
|
s11.set('a', 1);
|
|
256
256
|
s11.set('a', 2);
|
|
257
257
|
s11.set('a', 3);
|
|
258
258
|
assert('fast-path: value written without subscribers', s11.get('a') === 3);
|
|
259
259
|
|
|
260
|
-
// subscribe, fire, unsub, then set again
|
|
260
|
+
// subscribe, fire, unsub, then set again - fast-path should re-engage
|
|
261
261
|
const unsub11 = s11.subscribe('a', () => { s11fires++; });
|
|
262
262
|
s11.set('a', 4);
|
|
263
263
|
assert('fast-path: fires with subscriber', s11fires === 1);
|
|
@@ -349,7 +349,7 @@ assert('keys: destroyed throws', threwKeys);
|
|
|
349
349
|
|
|
350
350
|
// Results
|
|
351
351
|
|
|
352
|
-
console.log(`\n@everystate/core v1.0.
|
|
352
|
+
console.log(`\n@everystate/core v1.0.9 self-test`);
|
|
353
353
|
console.log(`✓ ${passed} assertions passed${failed ? `, ✗ ${failed} failed` : ''}\n`);
|
|
354
354
|
|
|
355
355
|
if (failed > 0) process.exit(1);
|
package/tests/core.test.js
CHANGED
|
@@ -13,7 +13,7 @@ const results = runTests({
|
|
|
13
13
|
|
|
14
14
|
// -- batch ---------------------------------------------------------
|
|
15
15
|
|
|
16
|
-
'batch: coalesces
|
|
16
|
+
'batch: coalesces - same-path deduplication': () => {
|
|
17
17
|
const t = createEventTest({ count: 0 });
|
|
18
18
|
t.store.batch(() => {
|
|
19
19
|
t.trigger('count', 1);
|
|
@@ -51,7 +51,7 @@ const results = runTests({
|
|
|
51
51
|
store.destroy();
|
|
52
52
|
},
|
|
53
53
|
|
|
54
|
-
'batch: nested
|
|
54
|
+
'batch: nested - only outermost flushes': () => {
|
|
55
55
|
const t = createEventTest({ a: 0, b: 0 });
|
|
56
56
|
t.store.batch(() => {
|
|
57
57
|
t.trigger('a', 1);
|