@ng-org/alien-deepsignals 0.1.2-alpha.1 → 0.1.2-alpha.3
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/dist/deepSignal.d.ts.map +1 -1
- package/dist/deepSignal.js +78 -86
- package/dist/hooks/react/useDeepSignal.d.ts +4 -4
- package/dist/hooks/react/useDeepSignal.d.ts.map +1 -1
- package/dist/hooks/react/useDeepSignal.js +22 -15
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/watch.d.ts +2 -2
- package/dist/watch.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/deepSignal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepSignal.d.ts","sourceRoot":"","sources":["../src/deepSignal.ts"],"names":[],"mappings":"AAWA,OAAO,EAGH,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EAMpB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"deepSignal.d.ts","sourceRoot":"","sources":["../src/deepSignal.ts"],"names":[],"mappings":"AAWA,OAAO,EAGH,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EAMpB,MAAM,SAAS,CAAC;AAo/BjB,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACvC,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,iBAAiB,GAC5B,UAAU,CAAC,CAAC,CAAC,CAwBf;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,EAAE,EAAE,mBAAmB,GAAG,sBAAsB,EAChD,gBAAgB,GAAE,OAAe,GAClC,MAAM,IAAI,CAoBZ;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,MAAM,GAAG,MAAM,GACtB,MAAM,GAAG,SAAS,CAIpB;AAED,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAGnD;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,QAItE;AAED,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAa1E"}
|
package/dist/deepSignal.js
CHANGED
|
@@ -19,9 +19,11 @@ exports.setSetEntrySyntheticId = setSetEntrySyntheticId;
|
|
|
19
19
|
exports.addWithId = addWithId;
|
|
20
20
|
const core_1 = require("./core");
|
|
21
21
|
const iteratorHelpers_1 = require("./iteratorHelpers");
|
|
22
|
+
/** The current proxy object for the raw object (others might exist but are not the current / clean ones). */
|
|
22
23
|
const rawToProxy = new WeakMap();
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const rawToMeta = new WeakMap();
|
|
25
|
+
// TODO: We can move them to the meta objects.
|
|
26
|
+
const propertiesToSignals = new WeakMap();
|
|
25
27
|
const iterableSignals = new WeakMap();
|
|
26
28
|
const ignored = new WeakSet();
|
|
27
29
|
const rootStates = new Map();
|
|
@@ -51,37 +53,20 @@ const forcedSyntheticIds = new WeakMap();
|
|
|
51
53
|
const META_KEY = "__meta__";
|
|
52
54
|
const RAW_KEY = "__raw__";
|
|
53
55
|
const DEFAULT_SYNTHETIC_ID_PROPERTY_NAME = "@id";
|
|
54
|
-
/**
|
|
55
|
-
* Lookup the metadata record backing a proxy (if the value is proxied).
|
|
56
|
-
* Returns undefined for non-object inputs or values that never went through deepSignal().
|
|
57
|
-
*/
|
|
58
|
-
function getMeta(target) {
|
|
59
|
-
if (!target || typeof target !== "object")
|
|
60
|
-
return undefined;
|
|
61
|
-
return proxyToMeta.get(target);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Resolve the raw underlying object for a possibly proxied value.
|
|
65
|
-
* Falls back to the value itself when no proxy metadata is attached.
|
|
66
|
-
*/
|
|
67
|
-
function getRaw(value) {
|
|
68
|
-
const meta = getMeta(value);
|
|
69
|
-
return meta?.raw ?? value;
|
|
70
|
-
}
|
|
71
56
|
/** Returns `true` if `value` is an object, array or set and is not in `ignored`. */
|
|
72
57
|
function shouldProxy(value) {
|
|
73
58
|
return (!!value &&
|
|
74
59
|
typeof value === "object" &&
|
|
75
|
-
supported.has(value.constructor) &&
|
|
60
|
+
(supported.has(value.constructor) || value instanceof Set) &&
|
|
76
61
|
!ignored.has(value));
|
|
77
62
|
}
|
|
78
63
|
/**
|
|
79
64
|
* Get or create the map in `proxySignals` for key `proxy`.
|
|
80
65
|
*/
|
|
81
|
-
function ensureSignalMap(
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
-
return
|
|
66
|
+
function ensureSignalMap(rawObj) {
|
|
67
|
+
if (!propertiesToSignals.has(rawObj))
|
|
68
|
+
propertiesToSignals.set(rawObj, new Map());
|
|
69
|
+
return propertiesToSignals.get(rawObj);
|
|
85
70
|
}
|
|
86
71
|
/**
|
|
87
72
|
* Write a new value into a cached signal, creating it if needed.
|
|
@@ -134,6 +119,20 @@ function escapePathSegment(segment) {
|
|
|
134
119
|
function isReactiveSymbol(key) {
|
|
135
120
|
return typeof key === "symbol" && !wellKnownSymbols.has(key);
|
|
136
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Replaces the old proxy to a raw object with a new one.
|
|
124
|
+
* Used so that we can indicate modifications along the path of a change by equality checks.
|
|
125
|
+
*/
|
|
126
|
+
function replaceProxy(meta) {
|
|
127
|
+
if (!meta.parent || !meta.key)
|
|
128
|
+
return;
|
|
129
|
+
// Create a new proxy for this raw object -- frontend libs like react need this to recognize changes along this path.
|
|
130
|
+
const handlers = meta.raw instanceof Set ? setHandlers : objectHandlers;
|
|
131
|
+
const proxy = new Proxy(meta.raw, handlers);
|
|
132
|
+
rawToProxy.set(meta.raw, proxy);
|
|
133
|
+
const signal = propertiesToSignals.get(meta.parent.raw)?.get(meta.key);
|
|
134
|
+
signal?.(proxy);
|
|
135
|
+
}
|
|
137
136
|
/**
|
|
138
137
|
* Walk the metadata chain to build the patch path for a property access.
|
|
139
138
|
* Handles numbers, symbols (using description) and synthetic ID markers.
|
|
@@ -160,7 +159,8 @@ function buildPath(meta, key, skipEscape = false) {
|
|
|
160
159
|
let cursor = meta;
|
|
161
160
|
while (cursor && cursor.parent && cursor.key !== undefined) {
|
|
162
161
|
push(cursor.key, !!cursor.isSyntheticId);
|
|
163
|
-
|
|
162
|
+
replaceProxy(cursor);
|
|
163
|
+
cursor = cursor.parent;
|
|
164
164
|
}
|
|
165
165
|
return path;
|
|
166
166
|
}
|
|
@@ -168,8 +168,8 @@ function buildPath(meta, key, skipEscape = false) {
|
|
|
168
168
|
function resolveContainerPath(meta) {
|
|
169
169
|
if (!meta || !meta.parent || meta.key === undefined)
|
|
170
170
|
return [];
|
|
171
|
-
|
|
172
|
-
return buildPath(
|
|
171
|
+
replaceProxy(meta);
|
|
172
|
+
return buildPath(meta.parent, meta.key, !!meta.isSyntheticId);
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Build and enqueue patches for a mutation, only if listeners exist on the root.
|
|
@@ -297,24 +297,25 @@ function initializeObjectTreeIfNoListeners(meta, basePath, value, inSet) {
|
|
|
297
297
|
* Does not proxy and returns `value` if @see shouldProxy returns false.
|
|
298
298
|
* Returns value if parent has no metadata record.
|
|
299
299
|
*/
|
|
300
|
-
function ensureChildProxy(
|
|
301
|
-
if (!shouldProxy(
|
|
302
|
-
return
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
300
|
+
function ensureChildProxy(rawChild, parent, key, isSyntheticId = false) {
|
|
301
|
+
if (!shouldProxy(rawChild))
|
|
302
|
+
return rawChild;
|
|
303
|
+
const parentRaw = parent[RAW_KEY] || parent;
|
|
304
|
+
const parentMeta = rawToMeta?.get(parentRaw);
|
|
305
|
+
if (rawToProxy.has(rawChild)) {
|
|
306
|
+
const proxied = rawToProxy.get(rawChild);
|
|
307
|
+
const proxiedMeta = rawToMeta.get(rawChild);
|
|
306
308
|
if (proxiedMeta) {
|
|
307
|
-
proxiedMeta.parent =
|
|
309
|
+
proxiedMeta.parent = parentMeta;
|
|
308
310
|
proxiedMeta.key = key;
|
|
309
311
|
proxiedMeta.isSyntheticId = isSyntheticId;
|
|
310
312
|
}
|
|
311
313
|
return proxied;
|
|
312
314
|
}
|
|
313
|
-
const parentMeta = getMeta(parentProxy);
|
|
314
315
|
if (!parentMeta)
|
|
315
|
-
return
|
|
316
|
+
return rawChild;
|
|
316
317
|
// Create proxy if none exists yet.
|
|
317
|
-
const proxy = createProxy(
|
|
318
|
+
const proxy = createProxy(rawChild, parentMeta.root, parentMeta.options, parentMeta, key, isSyntheticId);
|
|
318
319
|
return proxy;
|
|
319
320
|
}
|
|
320
321
|
/**
|
|
@@ -338,7 +339,7 @@ function ensureSetInfo(meta) {
|
|
|
338
339
|
* - Add object and id to `idForObject` and `objectForId` maps.
|
|
339
340
|
*/
|
|
340
341
|
function assignSyntheticId(meta, entry, path, inSet) {
|
|
341
|
-
const rawEntry =
|
|
342
|
+
const rawEntry = entry?.[RAW_KEY] ?? entry;
|
|
342
343
|
if (!rawEntry || typeof rawEntry !== "object") {
|
|
343
344
|
return rawEntry;
|
|
344
345
|
}
|
|
@@ -397,28 +398,26 @@ function assignSyntheticId(meta, entry, path, inSet) {
|
|
|
397
398
|
return idString;
|
|
398
399
|
}
|
|
399
400
|
/** Create the appropriate proxy (object vs Set) and track its metadata. */
|
|
400
|
-
function createProxy(target, root, options,
|
|
401
|
+
function createProxy(target, root, options, parentMeta, key, isSyntheticId) {
|
|
401
402
|
const handlers = target instanceof Set ? setHandlers : objectHandlers;
|
|
402
403
|
const proxy = new Proxy(target, handlers);
|
|
403
404
|
const meta = {
|
|
404
405
|
raw: target,
|
|
405
|
-
parent,
|
|
406
|
+
parent: parentMeta,
|
|
406
407
|
key,
|
|
407
408
|
isSyntheticId,
|
|
408
409
|
root,
|
|
409
410
|
options,
|
|
410
411
|
};
|
|
411
|
-
|
|
412
|
-
|
|
412
|
+
propertiesToSignals.set(target, new Map());
|
|
413
|
+
rawToMeta.set(target, meta);
|
|
413
414
|
rawToProxy.set(target, proxy);
|
|
414
415
|
return proxy;
|
|
415
416
|
}
|
|
416
417
|
/** Normalize a value prior to writes, ensuring nested objects are proxied. */
|
|
417
418
|
function ensureValueForWrite(value, receiver, key) {
|
|
418
|
-
const rawValue =
|
|
419
|
-
const proxied =
|
|
420
|
-
? ensureChildProxy(rawValue, receiver, key)
|
|
421
|
-
: rawValue;
|
|
419
|
+
const rawValue = rawToMeta.get(value) ?? value;
|
|
420
|
+
const proxied = ensureChildProxy(rawValue, receiver, key);
|
|
422
421
|
return { raw: rawValue, proxied };
|
|
423
422
|
}
|
|
424
423
|
/** Return primitive literals (string/number/boolean) for patch serialization. */
|
|
@@ -513,9 +512,9 @@ const objectHandlers = {
|
|
|
513
512
|
get(target, key, receiver) {
|
|
514
513
|
// Handle meta keys
|
|
515
514
|
if (key === RAW_KEY)
|
|
516
|
-
return
|
|
515
|
+
return target;
|
|
517
516
|
if (key === META_KEY)
|
|
518
|
-
return
|
|
517
|
+
return rawToMeta.get(target);
|
|
519
518
|
// TODO: Why are we doing this?
|
|
520
519
|
if (typeof key === "symbol") {
|
|
521
520
|
if (key === Symbol.iterator) {
|
|
@@ -526,19 +525,16 @@ const objectHandlers = {
|
|
|
526
525
|
return Reflect.get(target, key, receiver);
|
|
527
526
|
}
|
|
528
527
|
// Get object map from key to signal.
|
|
529
|
-
const signals = ensureSignalMap(
|
|
530
|
-
// TODO: Why are we doing this?
|
|
528
|
+
const signals = ensureSignalMap(target);
|
|
531
529
|
// Ensure that target object is signal.
|
|
532
530
|
ensureComputed(signals, target, key, receiver);
|
|
533
531
|
// Add signal if it does not exist already and did not have a getter.
|
|
534
532
|
if (!signals.has(key)) {
|
|
535
|
-
let
|
|
536
|
-
if (typeof
|
|
537
|
-
return
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
: rawValue;
|
|
541
|
-
signals.set(key, (0, core_1.signal)(rawValue));
|
|
533
|
+
let rawChild = Reflect.get(target, key, receiver);
|
|
534
|
+
if (typeof rawChild === "function")
|
|
535
|
+
return rawChild.bind(receiver ?? target);
|
|
536
|
+
const childProxyOrRaw = ensureChildProxy(rawChild, receiver, key);
|
|
537
|
+
signals.set(key, (0, core_1.signal)(childProxyOrRaw));
|
|
542
538
|
}
|
|
543
539
|
// Call and return signal
|
|
544
540
|
const sig = signals.get(key);
|
|
@@ -548,7 +544,7 @@ const objectHandlers = {
|
|
|
548
544
|
// Skip reactivity for symbols.
|
|
549
545
|
if (typeof key === "symbol" && !isReactiveSymbol(key))
|
|
550
546
|
return Reflect.set(target, key, value, receiver);
|
|
551
|
-
const meta =
|
|
547
|
+
const meta = rawToMeta.get(target);
|
|
552
548
|
if (meta?.options?.readOnlyProps?.includes(String(key))) {
|
|
553
549
|
throw new Error(`Cannot modify readonly property '${String(key)}'`);
|
|
554
550
|
}
|
|
@@ -558,10 +554,9 @@ const objectHandlers = {
|
|
|
558
554
|
(typeof desc.get === "function" || typeof desc.set === "function");
|
|
559
555
|
const { raw, proxied } = ensureValueForWrite(value, receiver, key);
|
|
560
556
|
const hadKey = Object.prototype.hasOwnProperty.call(target, key);
|
|
561
|
-
const previous = hadKey ? target[key] : undefined;
|
|
562
557
|
const result = Reflect.set(target, key, raw, receiver);
|
|
563
558
|
if (!hasAccessor) {
|
|
564
|
-
const signals = ensureSignalMap(
|
|
559
|
+
const signals = ensureSignalMap(target);
|
|
565
560
|
setSignalValue(signals, key, proxied);
|
|
566
561
|
}
|
|
567
562
|
if (!hadKey)
|
|
@@ -587,13 +582,13 @@ const objectHandlers = {
|
|
|
587
582
|
deleteProperty(target, key) {
|
|
588
583
|
if (typeof key === "symbol" && !isReactiveSymbol(key))
|
|
589
584
|
return Reflect.deleteProperty(target, key);
|
|
590
|
-
const
|
|
591
|
-
const meta = receiver ? getMeta(receiver) : undefined;
|
|
585
|
+
const meta = rawToMeta.get(target);
|
|
592
586
|
const hadKey = Object.prototype.hasOwnProperty.call(target, key);
|
|
593
587
|
const result = Reflect.deleteProperty(target, key);
|
|
594
588
|
if (hadKey) {
|
|
595
|
-
if (
|
|
596
|
-
|
|
589
|
+
if (propertiesToSignals.has(target)) {
|
|
590
|
+
// Trigger signal
|
|
591
|
+
const signals = propertiesToSignals.get(target);
|
|
597
592
|
const existing = signals.get(key);
|
|
598
593
|
if (existing &&
|
|
599
594
|
typeof existing.set === "function") {
|
|
@@ -601,6 +596,7 @@ const objectHandlers = {
|
|
|
601
596
|
}
|
|
602
597
|
signals.delete(key);
|
|
603
598
|
}
|
|
599
|
+
// Notify listeners
|
|
604
600
|
touchIterable(target);
|
|
605
601
|
schedulePatch(meta, () => ({
|
|
606
602
|
path: buildPath(meta, key),
|
|
@@ -618,9 +614,9 @@ const objectHandlers = {
|
|
|
618
614
|
/**
|
|
619
615
|
* Guarantee Set iteration always surfaces proxies, even when raw values were stored.
|
|
620
616
|
*/
|
|
621
|
-
function ensureEntryProxy(
|
|
617
|
+
function ensureEntryProxy(raw, entry, syntheticKey, meta) {
|
|
622
618
|
return shouldProxy(entry)
|
|
623
|
-
? ensureChildProxy(entry,
|
|
619
|
+
? ensureChildProxy(entry, raw, syntheticKey, true)
|
|
624
620
|
: entry;
|
|
625
621
|
}
|
|
626
622
|
/** Wrap the underlying Set iterator so each value is proxied before leaving the trap. */
|
|
@@ -632,8 +628,8 @@ function createSetIterator(target, receiver, mapValue) {
|
|
|
632
628
|
const next = iterator.next();
|
|
633
629
|
if (next.done)
|
|
634
630
|
return next;
|
|
635
|
-
const meta =
|
|
636
|
-
const proxied = ensureEntryProxy(
|
|
631
|
+
const meta = rawToMeta.get(target);
|
|
632
|
+
const proxied = ensureEntryProxy(target, next.value, assignSyntheticId(meta, next.value, [], true), meta);
|
|
637
633
|
return {
|
|
638
634
|
value: mapValue(proxied),
|
|
639
635
|
done: false,
|
|
@@ -643,10 +639,11 @@ function createSetIterator(target, receiver, mapValue) {
|
|
|
643
639
|
/** Proxy handler providing deep-signal semantics for native Set instances. */
|
|
644
640
|
const setHandlers = {
|
|
645
641
|
get(target, key, receiver) {
|
|
642
|
+
const meta = rawToMeta.get(target);
|
|
646
643
|
if (key === RAW_KEY)
|
|
647
|
-
return
|
|
644
|
+
return target;
|
|
648
645
|
if (key === META_KEY)
|
|
649
|
-
return
|
|
646
|
+
return meta;
|
|
650
647
|
if (key === "size") {
|
|
651
648
|
const sig = ensureIterableSignal(target);
|
|
652
649
|
sig();
|
|
@@ -659,21 +656,19 @@ const setHandlers = {
|
|
|
659
656
|
const iterator = target.values().next();
|
|
660
657
|
if (iterator.done)
|
|
661
658
|
return undefined;
|
|
662
|
-
|
|
663
|
-
return ensureEntryProxy(receiver, iterator.value, assignSyntheticId(meta, iterator.value, [], true), meta);
|
|
659
|
+
return ensureEntryProxy(target, iterator.value, assignSyntheticId(meta, iterator.value, [], true), meta);
|
|
664
660
|
};
|
|
665
661
|
}
|
|
666
662
|
if (key === "getById") {
|
|
667
663
|
return function getById(id) {
|
|
668
664
|
const iterableSig = ensureIterableSignal(target);
|
|
669
665
|
iterableSig();
|
|
670
|
-
const meta = getMeta(receiver);
|
|
671
666
|
if (!meta?.setInfo)
|
|
672
667
|
return undefined;
|
|
673
668
|
const entry = meta.setInfo.objectForId.get(String(id));
|
|
674
669
|
if (!entry)
|
|
675
670
|
return undefined;
|
|
676
|
-
return ensureEntryProxy(
|
|
671
|
+
return ensureEntryProxy(target, entry, String(id), meta);
|
|
677
672
|
};
|
|
678
673
|
}
|
|
679
674
|
if (key === "getBy") {
|
|
@@ -685,9 +680,8 @@ const setHandlers = {
|
|
|
685
680
|
}
|
|
686
681
|
if (key === "add") {
|
|
687
682
|
return function add(value) {
|
|
688
|
-
const meta = getMeta(receiver);
|
|
689
683
|
const containerPath = resolveContainerPath(meta);
|
|
690
|
-
const rawValue =
|
|
684
|
+
const rawValue = value[RAW_KEY] ?? value;
|
|
691
685
|
const sizeBefore = target.size;
|
|
692
686
|
const result = target.add(rawValue);
|
|
693
687
|
if (target.size !== sizeBefore) {
|
|
@@ -695,7 +689,7 @@ const setHandlers = {
|
|
|
695
689
|
if (rawValue && typeof rawValue === "object") {
|
|
696
690
|
const synthetic = assignSyntheticId(meta, rawValue, containerPath, true);
|
|
697
691
|
initializeObjectTreeIfNoListeners(meta, [...containerPath, synthetic], rawValue, true);
|
|
698
|
-
ensureEntryProxy(
|
|
692
|
+
ensureEntryProxy(target, rawValue, synthetic, meta);
|
|
699
693
|
schedulePatch(meta, () => emitPatchesForNew(rawValue, meta, [...containerPath, synthetic], true));
|
|
700
694
|
}
|
|
701
695
|
else {
|
|
@@ -715,9 +709,8 @@ const setHandlers = {
|
|
|
715
709
|
}
|
|
716
710
|
if (key === "delete") {
|
|
717
711
|
return function deleteEntry(value) {
|
|
718
|
-
const meta = getMeta(receiver);
|
|
719
712
|
const containerPath = resolveContainerPath(meta);
|
|
720
|
-
const rawValue =
|
|
713
|
+
const rawValue = value?.[RAW_KEY] ?? value;
|
|
721
714
|
const synthetic = rawValue && typeof rawValue === "object"
|
|
722
715
|
? ensureSetInfo(meta).idForObject.get(rawValue)
|
|
723
716
|
: rawValue;
|
|
@@ -748,7 +741,6 @@ const setHandlers = {
|
|
|
748
741
|
}
|
|
749
742
|
if (key === "clear") {
|
|
750
743
|
return function clear() {
|
|
751
|
-
const meta = getMeta(receiver);
|
|
752
744
|
const containerPath = resolveContainerPath(meta);
|
|
753
745
|
if (meta.setInfo) {
|
|
754
746
|
meta.setInfo.objectForId.clear();
|
|
@@ -796,12 +788,11 @@ const setHandlers = {
|
|
|
796
788
|
return function forEach(callback, thisArg) {
|
|
797
789
|
const iterableSig = ensureIterableSignal(target);
|
|
798
790
|
iterableSig();
|
|
799
|
-
const meta = getMeta(receiver);
|
|
800
791
|
let index = 0;
|
|
801
792
|
const expectsIteratorSignature = callback.length <= 2;
|
|
802
793
|
const iteratorCallback = callback;
|
|
803
794
|
target.forEach((entry) => {
|
|
804
|
-
const proxied = ensureEntryProxy(
|
|
795
|
+
const proxied = ensureEntryProxy(target, entry, assignSyntheticId(meta, entry, [], true), meta);
|
|
805
796
|
if (expectsIteratorSignature) {
|
|
806
797
|
iteratorCallback.call(thisArg, proxied, index++);
|
|
807
798
|
}
|
|
@@ -813,7 +804,7 @@ const setHandlers = {
|
|
|
813
804
|
}
|
|
814
805
|
if (key === "has") {
|
|
815
806
|
return function has(value) {
|
|
816
|
-
return target.has(
|
|
807
|
+
return target.has(value?.[RAW_KEY] ?? value);
|
|
817
808
|
};
|
|
818
809
|
}
|
|
819
810
|
return Reflect.get(target, key, receiver);
|
|
@@ -821,7 +812,7 @@ const setHandlers = {
|
|
|
821
812
|
};
|
|
822
813
|
/** Runtime guard that checks whether a value is a deepSignal proxy. */
|
|
823
814
|
function isDeepSignal(value) {
|
|
824
|
-
return !!
|
|
815
|
+
return !!value?.[RAW_KEY];
|
|
825
816
|
}
|
|
826
817
|
/**
|
|
827
818
|
* Create a deep reactive proxy for objects, arrays or Sets.
|
|
@@ -878,7 +869,7 @@ function subscribeDeepMutations(root, cb, triggerInstantly = false) {
|
|
|
878
869
|
}
|
|
879
870
|
/** Return the root identifier symbol for a deepSignal proxy (if any). */
|
|
880
871
|
function getDeepSignalRootId(value) {
|
|
881
|
-
return
|
|
872
|
+
return rawToMeta.get(value?.[RAW_KEY] ?? value)?.root;
|
|
882
873
|
}
|
|
883
874
|
/** Retrieve the current patch version for a deepSignal root (if tracked). */
|
|
884
875
|
function getDeepSignalVersion(root) {
|
|
@@ -896,7 +887,8 @@ function shallow(obj) {
|
|
|
896
887
|
function setSetEntrySyntheticId(obj, id) {
|
|
897
888
|
if (!obj || typeof obj !== "object")
|
|
898
889
|
return;
|
|
899
|
-
|
|
890
|
+
// @ts-ignore
|
|
891
|
+
forcedSyntheticIds.set(obj[RAW_KEY] ?? obj, String(id));
|
|
900
892
|
}
|
|
901
893
|
/** Convenience helper to add an entry to a proxied Set with a pre-defined synthetic ID. */
|
|
902
894
|
function addWithId(set, entry, id) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeepSignalOptions } from "
|
|
1
|
+
import { DeepSignalOptions } from "../..";
|
|
2
2
|
/**
|
|
3
3
|
* Create or use an existing deepSignal object in your component.
|
|
4
4
|
* Modifications to the returned deepSignal object cause an immediate rerender.
|
|
@@ -6,9 +6,9 @@ import { DeepSignalOptions } from "../../types.js";
|
|
|
6
6
|
* is rerendered as well.
|
|
7
7
|
*
|
|
8
8
|
* @param object The object that should become reactive
|
|
9
|
-
* @param
|
|
10
|
-
* @returns The deepSignal object of the object param.
|
|
9
|
+
* @param deepSignalOptions When the object is not a deepSignal already, options passed to `deepSignal`.
|
|
10
|
+
* @returns The deepSignal object of the object param. On every change, the returned object will change (a new no-op proxy is created) around the deepSignal object.
|
|
11
11
|
*/
|
|
12
|
-
declare const useSignal: <T extends object>(object: T,
|
|
12
|
+
declare const useSignal: <T extends object>(object: T, deepSignalOptions?: DeepSignalOptions) => import("../..").DeepSignal<T>;
|
|
13
13
|
export default useSignal;
|
|
14
14
|
//# sourceMappingURL=useDeepSignal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeepSignal.d.ts","sourceRoot":"","sources":["../../../src/hooks/react/useDeepSignal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDeepSignal.d.ts","sourceRoot":"","sources":["../../../src/hooks/react/useDeepSignal.ts"],"names":[],"mappings":"AAYA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;;;;;;GASG;AACH,QAAA,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EAC/B,QAAQ,CAAC,EACT,oBAAoB,iBAAiB,kCAqCxC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const watch_js_1 = require("../../watch.js");
|
|
13
13
|
const react_1 = require("react");
|
|
14
|
-
const
|
|
14
|
+
const __1 = require("../..");
|
|
15
15
|
/**
|
|
16
16
|
* Create or use an existing deepSignal object in your component.
|
|
17
17
|
* Modifications to the returned deepSignal object cause an immediate rerender.
|
|
@@ -19,21 +19,28 @@ const deepSignal_1 = require("../../deepSignal");
|
|
|
19
19
|
* is rerendered as well.
|
|
20
20
|
*
|
|
21
21
|
* @param object The object that should become reactive
|
|
22
|
-
* @param
|
|
23
|
-
* @returns The deepSignal object of the object param.
|
|
22
|
+
* @param deepSignalOptions When the object is not a deepSignal already, options passed to `deepSignal`.
|
|
23
|
+
* @returns The deepSignal object of the object param. On every change, the returned object will change (a new no-op proxy is created) around the deepSignal object.
|
|
24
24
|
*/
|
|
25
|
-
const useSignal = (object,
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const useSignal = (object, deepSignalOptions) => {
|
|
26
|
+
// Create the actual deepSignal object from the raw object (if the object is a deepSignal object already, it returns itself).
|
|
27
|
+
const signal = (0, react_1.useMemo)(() => (0, __1.deepSignal)(object, deepSignalOptions), [object, deepSignalOptions]);
|
|
28
|
+
// Create a shallow proxy of the original object which can be disposed and a new one
|
|
29
|
+
// recreated on rerenders so that react knows it changed on comparisons.
|
|
30
|
+
const proxyRef = (0, react_1.useRef)(new Proxy(signal, {}));
|
|
31
|
+
// Update proxy ref when shapeSignal changes
|
|
32
|
+
(0, react_1.useMemo)(() => {
|
|
33
|
+
proxyRef.current = new Proxy(signal, {});
|
|
34
|
+
}, [signal]);
|
|
35
|
+
const subscribe = (0, react_1.useCallback)((onStoreChange) => {
|
|
36
|
+
const { stopListening } = (0, watch_js_1.watch)(signal, () => {
|
|
37
|
+
// Create a new shallow proxy and notify react about the change.
|
|
38
|
+
proxyRef.current = new Proxy(signal, {});
|
|
39
|
+
onStoreChange();
|
|
32
40
|
}, { triggerInstantly: true });
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return shapeSignalRef.current;
|
|
41
|
+
return stopListening;
|
|
42
|
+
}, [signal]);
|
|
43
|
+
const getSnapshot = (0, react_1.useCallback)(() => proxyRef.current, []);
|
|
44
|
+
return (0, react_1.useSyncExternalStore)(subscribe, getSnapshot);
|
|
38
45
|
};
|
|
39
46
|
exports.default = useSignal;
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,oDAAoD;AACpD,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC7B,GAAG,CACE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAE,GACnD;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAE,CAChD,CAAC;AAEF,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,SAAS,EAAE,CAAC;CACxB;AAED,s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AAK,CAAC,MAAM,CAAC,CAAC,GACtB,UAAU,CAAC,CAAC,CAAC,EAAE,GACf,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GACpB,aAAa,CAAC,CAAC,CAAC,GAChB,CAAC,SAAS,MAAM,GACd,gBAAgB,CAAC,CAAC,CAAC,GACnB,CAAC,CAAC;AAElB,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;KAC5C,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
package/dist/watch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeepPatch, DeepSignal } from "./types";
|
|
1
|
+
import { DeepPatch, DeepSignal, DeepSignalObject, DeepSignalSet } from "./types";
|
|
2
2
|
export type RegisterCleanup = (cleanupFn: () => void) => void;
|
|
3
3
|
export interface WatchOptions {
|
|
4
4
|
/** True, if the callback should be run immediately after `watch` was called. @default false*/
|
|
@@ -20,7 +20,7 @@ export interface WatchPatchEvent<T extends object> {
|
|
|
20
20
|
newValue: DeepSignal<T>;
|
|
21
21
|
}
|
|
22
22
|
export type WatchPatchCallback<T extends object> = (event: WatchPatchEvent<T>) => void;
|
|
23
|
-
export declare function watch<T extends object>(source: DeepSignal<T>, callback: WatchPatchCallback<T>, options?: WatchOptions): {
|
|
23
|
+
export declare function watch<T extends object>(source: DeepSignalSet<T> | DeepSignalObject<T> | DeepSignal<T>, callback: WatchPatchCallback<T>, options?: WatchOptions): {
|
|
24
24
|
stopListening: () => void;
|
|
25
25
|
registerCleanup: RegisterCleanup;
|
|
26
26
|
};
|
package/dist/watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,SAAS,EAET,UAAU,EACV,gBAAgB,EAChB,aAAa,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;AAE9D,MAAM,WAAW,YAAY;IACzB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uFAAuF;IACvF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM;IAC7C,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,IAAI,CAC/C,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KACxB,IAAI,CAAC;AAEV,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,EAClC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAC9D,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC/B,OAAO,GAAE,YAAiB;;;EAiE7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-org/alien-deepsignals",
|
|
3
|
-
"version": "0.1.2-alpha.
|
|
3
|
+
"version": "0.1.2-alpha.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"authors": [
|
|
6
6
|
"Laurin Weger",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"description": "NextGraph adaptation of AlienDeepSignals - alien signals, but using regular JavaScript objects",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
23
|
"./react": {
|
|
24
24
|
"types": "./dist/hooks/react/index.d.ts",
|