memorio 2.7.0 → 2.7.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/README.md +0 -45
- package/examples/browser-vanilla.html +1 -1
- package/index.cjs +3 -1
- package/index.js +1 -1
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -357,51 +357,6 @@ This ensures that in server-side environments (Node.js/Deno), different requests
|
|
|
357
357
|
|
|
358
358
|
### Checking Platform
|
|
359
359
|
|
|
360
|
-
```javascript
|
|
361
|
-
// Platform detection is available via the internal module
|
|
362
|
-
// Note: Public API coming in future versions
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
367
|
-
## Cross-Platform Support
|
|
368
|
-
|
|
369
|
-
Memorio is designed to work across multiple JavaScript environments:
|
|
370
|
-
|
|
371
|
-
### Platform Compatibility
|
|
372
|
-
|
|
373
|
-
| Feature | Browser | Node.js | Deno | Edge Workers |
|
|
374
|
-
|---------|---------|---------|------|---------------|
|
|
375
|
-
| `state` | ✅ | ✅ | ✅ | ✅ |
|
|
376
|
-
| `observer` | ✅ | ✅ | ✅ | ✅ |
|
|
377
|
-
| `useObserver` | ✅ | ⚠️ | ⚠️ | ✅ |
|
|
378
|
-
| `cache` | ✅ | ✅ | ✅ | ✅ |
|
|
379
|
-
| `store` | ✅ (localStorage) | ⚠️ (memory) | ⚠️ (memory) | ✅ (localStorage) |
|
|
380
|
-
| `session` | ✅ (sessionStorage) | ⚠️ (memory) | ⚠️ (memory) | ✅ (sessionStorage) |
|
|
381
|
-
| `idb` | ✅ | ❌ | ❌ | ⚠️ |
|
|
382
|
-
|
|
383
|
-
- ✅ Full support
|
|
384
|
-
- ⚠️ Partial support (fallback to in-memory)
|
|
385
|
-
- ❌ Not available
|
|
386
|
-
|
|
387
|
-
### Session Isolation
|
|
388
|
-
|
|
389
|
-
Memorio provides automatic session isolation to prevent state leakage between different requests or contexts:
|
|
390
|
-
|
|
391
|
-
- **Unique Session IDs**: Each import gets a unique session identifier
|
|
392
|
-
- **Namespaced Storage**: `store` and `session` keys are prefixed with session ID
|
|
393
|
-
- **State Isolation**: `state` is isolated per-instance
|
|
394
|
-
|
|
395
|
-
This ensures that in server-side environments (Node.js/Deno), different requests don't share state data.
|
|
396
|
-
|
|
397
|
-
### Best Practices
|
|
398
|
-
|
|
399
|
-
1. **For Client-Side**: Use all features freely - store, session, idb work with real browser storage
|
|
400
|
-
2. **For Server-Side**: Use `state` and `cache` for in-memory data; store/session fall back to memory
|
|
401
|
-
3. **For Edge Workers**: Same as browser; localStorage/sessionStorage available
|
|
402
|
-
|
|
403
|
-
### Checking Platform
|
|
404
|
-
|
|
405
360
|
```javascript
|
|
406
361
|
import { isBrowser, isNode, isDeno, getCapabilities } from 'memorio';
|
|
407
362
|
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
</div>
|
|
225
225
|
|
|
226
226
|
<!-- Load Memorio -->
|
|
227
|
-
<script src="https://cdn.jsdelivr.net/npm/memorio/
|
|
227
|
+
<script src="https://cdn.jsdelivr.net/npm/memorio/index.cjs"></script>
|
|
228
228
|
|
|
229
229
|
<script>
|
|
230
230
|
// ============================================
|
package/index.cjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
var e = Object.getOwnPropertyNames, t = (t, o) => function() {
|
|
2
4
|
return t && (o = (0, t[e(t)[0]])(t = 0)), o;
|
|
3
5
|
}, o = {}, r = t({
|
|
@@ -310,7 +312,7 @@ Object.defineProperty(globalThis, "memorio", {
|
|
|
310
312
|
}), Object.defineProperty(memorio, "version", {
|
|
311
313
|
writable: !1,
|
|
312
314
|
enumerable: !1,
|
|
313
|
-
value: "2.7.
|
|
315
|
+
value: "2.7.2"
|
|
314
316
|
});
|
|
315
317
|
|
|
316
318
|
var B = [ "list", "state", "store", "idb", "observer", "useObserver", "remove", "removeAll", "_platform", "_capabilities", "_sessionId" ];
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ Object.defineProperty(globalThis, "memorio", {
|
|
|
310
310
|
}), Object.defineProperty(memorio, "version", {
|
|
311
311
|
writable: !1,
|
|
312
312
|
enumerable: !1,
|
|
313
|
-
value: "2.7.
|
|
313
|
+
value: "2.7.2"
|
|
314
314
|
});
|
|
315
315
|
|
|
316
316
|
var B = [ "list", "state", "store", "idb", "observer", "useObserver", "remove", "removeAll", "_platform", "_capabilities", "_sessionId" ];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorio",
|
|
3
3
|
"code": "memorio",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.2",
|
|
5
5
|
"description": "Memorio, State + Observer, Store and iDB for an easy life - Cross-platform compatible",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"browser": "./index.cjs",
|
|
@@ -64,13 +64,10 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"react": {
|
|
67
|
-
"optional":
|
|
67
|
+
"optional": true
|
|
68
68
|
},
|
|
69
69
|
"react-dom": {
|
|
70
|
-
"optional":
|
|
71
|
-
},
|
|
72
|
-
"jquery": {
|
|
73
|
-
"optional": false
|
|
70
|
+
"optional": true
|
|
74
71
|
}
|
|
75
72
|
},
|
|
76
73
|
"exports": {
|