informa 3.1.0 → 4.0.0

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.
Files changed (48) hide show
  1. package/README.md +171 -184
  2. package/dist/EnumerableWeakSet.d.ts +10 -0
  3. package/dist/EnumerableWeakSet.d.ts.map +1 -0
  4. package/dist/EnumerableWeakSet.js +44 -0
  5. package/dist/EnumerableWeakSet.js.map +1 -0
  6. package/dist/high.d.ts +2 -3
  7. package/dist/high.d.ts.map +1 -1
  8. package/dist/high.js +1 -2
  9. package/dist/high.js.map +1 -1
  10. package/dist/internals.d.ts +3 -0
  11. package/dist/internals.d.ts.map +1 -1
  12. package/dist/internals.js +5 -2
  13. package/dist/internals.js.map +1 -1
  14. package/dist/low.d.ts +16 -0
  15. package/dist/low.d.ts.map +1 -1
  16. package/dist/low.js +150 -0
  17. package/dist/low.js.map +1 -1
  18. package/dist/quirks/array.d.ts +4 -3
  19. package/dist/quirks/array.d.ts.map +1 -1
  20. package/dist/quirks/array.js +163 -75
  21. package/dist/quirks/array.js.map +1 -1
  22. package/dist/quirks/basestatified.d.ts +24 -2
  23. package/dist/quirks/basestatified.d.ts.map +1 -1
  24. package/dist/quirks/basestatified.js +244 -83
  25. package/dist/quirks/basestatified.js.map +1 -1
  26. package/dist/quirks/basestatified.test.d.ts +9 -0
  27. package/dist/quirks/basestatified.test.d.ts.map +1 -0
  28. package/dist/quirks/basestatified.test.js +291 -0
  29. package/dist/quirks/basestatified.test.js.map +1 -0
  30. package/dist/quirks/map.d.ts.map +1 -1
  31. package/dist/quirks/map.js +1 -0
  32. package/dist/quirks/map.js.map +1 -1
  33. package/dist/quirks/set.d.ts.map +1 -1
  34. package/dist/quirks/set.js +1 -0
  35. package/dist/quirks/set.js.map +1 -1
  36. package/dist/test.js +2 -6
  37. package/dist/test.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/EnumerableWeakSet.ts +46 -0
  40. package/src/high.ts +2 -3
  41. package/src/internals.ts +5 -1
  42. package/src/low.ts +120 -1
  43. package/src/quirks/array.ts +168 -92
  44. package/src/quirks/basestatified.test.ts +375 -0
  45. package/src/quirks/basestatified.ts +294 -117
  46. package/src/quirks/map.ts +3 -1
  47. package/src/quirks/set.ts +3 -1
  48. package/src/test.ts +13 -15
@@ -1,99 +1,260 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseStatified = void 0;
4
- exports.makeStatified = makeStatified;
3
+ exports.statifyClass = statifyClass;
4
+ const EnumerableWeakMap_js_1 = require("../EnumerableWeakMap.js");
5
+ const EnumerableWeakSet_js_1 = require("../EnumerableWeakSet.js");
5
6
  const internals_js_1 = require("../internals.js");
6
7
  const low_js_1 = require("../low.js");
7
- const classMapMemo = new WeakMap();
8
- const blanketProtoMemo = new WeakMap();
9
- const blanketProtoSet = new WeakSet();
10
- function getBlanketPrototype(actualProto) {
11
- const maybeMemoed = blanketProtoMemo.get(actualProto);
12
- if (maybeMemoed)
13
- return maybeMemoed;
14
- const storage = Object.create(actualProto);
15
- // storage[statifySealKey] = true;
16
- const blanket = new Proxy(storage, {
17
- get(target, prop, recv) {
18
- if (prop === internals_js_1.statifySealKey)
19
- return true;
20
- if ((0, internals_js_1.getGlobalStateMode)() === "extract-proxy-path") {
21
- if (prop === internals_js_1.exitProxySymbol) {
22
- return { path: [], stateRoot: recv };
23
- }
24
- return (0, low_js_1.extract)(undefined, recv, [prop]);
8
+ // Classes whose instances have been constructed but not yet field-instrumented.
9
+ const pendingAssemblies = new EnumerableWeakSet_js_1.EnumerableWeakSet();
10
+ // Map from a still-pending child instance → list of (parentMetadata, prop) pairs
11
+ // that need hook() called once the child is reconciled.
12
+ const deferredHooks = new EnumerableWeakMap_js_1.EnumerableWeakMap();
13
+ // One shim proxy per outermost constructor (new.target).
14
+ const shimCache = new WeakMap();
15
+ function getPrototypeChainDescriptor(obj, prop) {
16
+ let curr = obj;
17
+ while (curr !== null) {
18
+ const desc = Object.getOwnPropertyDescriptor(curr, prop);
19
+ if (desc)
20
+ return desc;
21
+ curr = Object.getPrototypeOf(curr);
22
+ }
23
+ return undefined;
24
+ }
25
+ const shimHandler = {
26
+ get(target, prop, recv) {
27
+ // Always signal that this object is statified.
28
+ if (prop === internals_js_1.statifySealKey)
29
+ return true;
30
+ if ((0, internals_js_1.getGlobalStateMode)() === "extract-proxy-path") {
31
+ // Root-level exit: this instance IS the stateRoot.
32
+ if (prop === internals_js_1.exitProxySymbol) {
33
+ return { path: [], stateRoot: recv };
25
34
  }
26
- return Reflect.get(target, prop, recv);
27
- },
28
- set(target, prop, newVal, recv) {
35
+ // Safety net: reconcile if somehow still pending at extraction time.
36
+ if (pendingAssemblies.has(recv)) {
37
+ reconcileInstance(recv);
38
+ }
39
+ // Forward to extract() so the path is captured.
40
+ // Own accessor properties on recv are already handling extract-proxy-path
41
+ // themselves; the shim is only reached for prototype-level props.
42
+ return (0, low_js_1.extract)(Reflect.get(target, prop, recv), recv, [prop]);
43
+ }
44
+ return Reflect.get(target, prop, recv);
45
+ },
46
+ set(target, prop, newVal, recv) {
47
+ // This trap fires only when `prop` is NOT an own property of `recv`.
48
+ // That covers:
49
+ // (a) Pre-reconciliation field initializer writes → create own data prop.
50
+ // (b) Prototype accessor writes (e.g. `get state()` / `set state()`).
51
+ // (c) Genuinely new dynamic property additions.
52
+ //
53
+ // Own accessor properties installed by reconcileInstance are handled
54
+ // by their own setters and never reach here.
55
+ // Check for a prototype-level accessor setter BEFORE calling Reflect.set.
56
+ const protoDesc = getPrototypeChainDescriptor(target, prop);
57
+ // Delegate the actual assignment.
58
+ const result = Reflect.set(target, prop, newVal, recv);
59
+ // If this was a prototype accessor write and the instance has metadata,
60
+ // emit replacement events so subscribers fire.
61
+ if (result && protoDesc?.set && internals_js_1.metadataMap.has(recv)) {
29
62
  const stateMetadata = (0, internals_js_1.getMetadataOf)(recv);
30
- const had = Reflect.has(recv, prop);
31
- const oldVal = Reflect.get(recv, prop);
32
- const result = Reflect.set(target, prop, newVal, recv);
33
- try {
34
- if (result) {
35
- if (typeof newVal === "object"
36
- && newVal != null
37
- && newVal[internals_js_1.statifySealKey]) {
38
- (0, low_js_1.hook)(stateMetadata, prop, (0, internals_js_1.getMetadataOf)(newVal));
39
- }
40
- if (had) {
41
- if (oldVal !== newVal
42
- && typeof oldVal === "object"
43
- && oldVal != null
44
- && oldVal[internals_js_1.statifySealKey]) {
45
- (0, low_js_1.unhook)(stateMetadata, prop, (0, internals_js_1.getMetadataOf)(oldVal));
46
- }
47
- stateMetadata.emit("replaceProp", newVal, prop);
48
- }
49
- stateMetadata.emit("setProp", newVal, prop);
50
- const maybeEventEmitterAtPath = stateMetadata.eventEmitterAtPathMaybe([prop]);
51
- if (maybeEventEmitterAtPath) {
52
- if (had) {
53
- maybeEventEmitterAtPath.emit("replace", newVal);
54
- }
55
- maybeEventEmitterAtPath.emit("set", newVal);
56
- (0, low_js_1.emitDescendantPathEvents)(stateMetadata, [prop], newVal, had);
57
- }
58
- }
63
+ stateMetadata.emit("replaceProp", newVal, prop);
64
+ const ee = stateMetadata.eventEmitterAtPathMaybe([prop]);
65
+ if (ee) {
66
+ ee.emit("replace", newVal);
67
+ (0, low_js_1.emitDescendantPathEvents)(stateMetadata, [prop], newVal, true);
59
68
  }
60
- finally {
61
- return result;
69
+ }
70
+ return result;
71
+ },
72
+ has(target, prop) {
73
+ if (prop === internals_js_1.statifySealKey || prop === internals_js_1.exitProxySymbol)
74
+ return true;
75
+ return Reflect.has(target, prop);
76
+ },
77
+ };
78
+ function getOrCreateShim(ctor) {
79
+ const cached = shimCache.get(ctor);
80
+ if (cached)
81
+ return cached;
82
+ // shimTarget's [[Prototype]] = ctor.prototype, so the full chain is:
83
+ // instance → shim → shimTarget → ctor.prototype → … → Superclass.prototype
84
+ // This preserves instanceof for all classes in the chain.
85
+ const shimTarget = Object.create(ctor.prototype);
86
+ const shim = new Proxy(shimTarget, shimHandler);
87
+ shimCache.set(ctor, shim);
88
+ return shim;
89
+ }
90
+ /**
91
+ * Converts all enumerable, configurable own data properties of `instance` into
92
+ * accessor-backed reactive properties connected to `instance`'s StateMetadata.
93
+ *
94
+ * Idempotent: returns immediately if the instance is not in pendingAssemblies.
95
+ */
96
+ function reconcileInstance(instance) {
97
+ if (!pendingAssemblies.has(instance))
98
+ return;
99
+ pendingAssemblies.delete(instance);
100
+ // Drain any deferred hooks where this instance was the pending child.
101
+ const deferred = deferredHooks.get(instance);
102
+ if (deferred) {
103
+ deferredHooks.delete(instance);
104
+ const childMetadata = (0, internals_js_1.getMetadataOf)(instance);
105
+ for (const { metadata: parentMetadata, prop } of deferred) {
106
+ (0, low_js_1.hook)(parentMetadata, prop, childMetadata);
107
+ }
108
+ }
109
+ // Metadata was installed eagerly in ExtractionShimBase's constructor.
110
+ const metadata = (0, internals_js_1.getMetadataOf)(instance);
111
+ const isArray = Array.isArray(instance);
112
+ const props = [
113
+ ...Object.getOwnPropertyNames(instance),
114
+ ...Object.getOwnPropertySymbols(instance),
115
+ ];
116
+ for (const prop of props) {
117
+ // Skip Informa internal symbols.
118
+ if (prop === internals_js_1.statifySealKey || prop === internals_js_1.exitProxySymbol)
119
+ continue;
120
+ // Skip array numeric indices — managed by the array's own push/pop/splice overrides.
121
+ if (isArray && typeof prop === "string" && Number.isInteger(Number(prop)))
122
+ continue;
123
+ const desc = Object.getOwnPropertyDescriptor(instance, prop);
124
+ // Non-configurable: cannot be redefined; leave non-reactive.
125
+ // Note: these properties retain their value but won't participate in the
126
+ // observable graph. This is intentional and tested.
127
+ if (!desc.configurable)
128
+ continue;
129
+ // Existing accessor (get/set): do not double-wrap.
130
+ if ("get" in desc || "set" in desc)
131
+ continue;
132
+ // ---- Instrument this configurable data property ----
133
+ let value = desc.value;
134
+ // Hook the initial value if it is itself statified.
135
+ if (value != null &&
136
+ typeof value === "object" &&
137
+ (0, internals_js_1.isStatified)(value)) {
138
+ if (pendingAssemblies.has(value)) {
139
+ // The nested value is itself pending (constructed during this constructor
140
+ // but not yet reconciled — its metadata doesn't exist yet). Defer the
141
+ // hook: it will be wired once reconcileInstance runs for that child.
142
+ deferredHooks.getOrInsertComputed(value, () => []).push({ metadata, prop });
62
143
  }
63
- },
64
- has(target, prop) {
65
- if ((0, internals_js_1.getGlobalStateMode)() === "extract-proxy-path" && prop === internals_js_1.exitProxySymbol) {
66
- return true;
144
+ else {
145
+ (0, low_js_1.hook)(metadata, prop, (0, internals_js_1.getMetadataOf)(value));
67
146
  }
68
- return Reflect.has(target, prop);
69
- },
70
- });
71
- blanketProtoMemo.set(actualProto, blanket);
72
- blanketProtoSet.add(blanket);
73
- return blanket;
147
+ }
148
+ Object.defineProperty(instance, prop, {
149
+ get() {
150
+ if ((0, internals_js_1.getGlobalStateMode)() === "extract-proxy-path") {
151
+ return (0, low_js_1.extract)(value, this, [prop]);
152
+ }
153
+ return value;
154
+ },
155
+ set(next) {
156
+ const old = value;
157
+ value = next;
158
+ if (old !== next) {
159
+ if (old != null &&
160
+ typeof old === "object" &&
161
+ (0, internals_js_1.isStatified)(old)) {
162
+ (0, low_js_1.unhook)(metadata, prop, (0, internals_js_1.getMetadataOf)(old));
163
+ }
164
+ if (next != null &&
165
+ typeof next === "object" &&
166
+ (0, internals_js_1.isStatified)(next)) {
167
+ (0, low_js_1.hook)(metadata, prop, (0, internals_js_1.getMetadataOf)(next));
168
+ }
169
+ (0, low_js_1.emitCollectionTransition)(old, next);
170
+ }
171
+ // Enter the existing replacement machinery — same path as statifyObject's
172
+ // set trap in low.ts. "listen → replace → fire" is preserved because this
173
+ // accessor is installed before any external mutation can reach the field.
174
+ metadata.emit("replaceProp", next, prop);
175
+ const ee = metadata.eventEmitterAtPathMaybe([prop]);
176
+ if (ee) {
177
+ ee.emit("replace", next);
178
+ (0, low_js_1.emitDescendantPathEvents)(metadata, [prop], next, true);
179
+ }
180
+ },
181
+ enumerable: desc.enumerable ?? true,
182
+ configurable: true,
183
+ });
184
+ }
185
+ // Selector/stateRoot identity: verified correct. Every on*()/off*() call goes
186
+ // through selectorToRootAndPath(), which fires preExtractionHooks() before
187
+ // entering extract-proxy-path mode. The preExtractionHook registered below
188
+ // reconciles all pending instances first — so by the time the selector function
189
+ // runs, every pending `this.x` field is already an accessor that returns
190
+ // extract(value, this, ['x']). Path chains like `() => this.a.b.c` are therefore
191
+ // built up correctly, and stateRoot is the raw instance, which is the same object
192
+ // keyed in metadataMap. No re-mapping needed.
74
193
  }
75
- function makeStatified(OriginalClass) {
76
- const maybeMemoed = classMapMemo.get(OriginalClass);
77
- if (maybeMemoed)
78
- return maybeMemoed;
79
- // @ts-ignore - ts-2545 "A mixin class must have a constructor with a single rest parameter of type 'any[]'."
80
- class Statified extends OriginalClass {
194
+ // Before selectorToRootAndPath enters extract-proxy-path mode it calls all
195
+ // registered hooks. This hook reconciles every pending instance so that their
196
+ // own data properties are already accessor-backed when the selector runs.
197
+ (0, low_js_1.registerPreExtractionHook)(() => {
198
+ // Snapshot: reconcileInstance removes from pendingAssemblies, which mutates
199
+ // the set during iteration — take a copy first.
200
+ const snapshot = [...pendingAssemblies];
201
+ for (const instance of snapshot) {
202
+ reconcileInstance(instance);
203
+ }
204
+ });
205
+ /**
206
+ * Wraps a user-defined class factory in the Informa observable lifecycle.
207
+ *
208
+ * Usage:
209
+ * ```ts
210
+ * const MyClass = statifyClass(
211
+ * (Base) => class MyClass extends Base {
212
+ * name = "default";
213
+ * constructor(name: string) { super(); this.name = name; }
214
+ * },
215
+ * Object,
216
+ * );
217
+ * ```
218
+ *
219
+ * Construction lifecycle:
220
+ * 1. ExtractionShimBase constructor runs → metadata installed, shim set as prototype.
221
+ * 2. UserSubclass field initializers run → own data properties created on instance.
222
+ * 3. UserSubclass constructor body runs.
223
+ * 4. Instance is in pendingAssemblies (field instrumentation deferred).
224
+ * 5. On first `on()`/`off()` call → registerPreExtractionHook fires → reconcileInstance
225
+ * converts own data properties to reactive accessor-backed properties.
226
+ */
227
+ function statifyClass(makeSubclass, Superclass) {
228
+ // ExtractionShimBase sits between Superclass and the user's class.
229
+ // Its constructor:
230
+ // - Installs StateMetadata on the instance eagerly (so subclasses like
231
+ // StatifiedArray can call getMetadataOf() from their constructor bodies).
232
+ // - Marks the instance as pending for lazy field instrumentation.
233
+ // - Inserts the shim proxy as the instance's [[Prototype]], enabling
234
+ // statifySealKey / exitProxySymbol / extract-proxy-path handling.
235
+ //
236
+ // Guard: in nested statifyClass chains (e.g. statifyClass(..., A) where A
237
+ // was itself produced by statifyClass), multiple ExtractionShimBase
238
+ // constructors run. The guard ensures setup happens exactly once — at the
239
+ // innermost (deepest) ExtractionShimBase call.
240
+ class ExtractionShimBase extends Superclass {
81
241
  constructor(...args) {
82
242
  super(...args);
83
- const ctor = new.target ?? Statified;
84
- const inst = Reflect.construct(OriginalClass, args, ctor);
85
- (0, internals_js_1.setMetadataOf)(inst, new low_js_1.StateMetadata());
86
- const actualProto = ctor.prototype;
87
- const finalProto = blanketProtoSet.has(actualProto)
88
- ? actualProto
89
- : getBlanketPrototype(actualProto);
90
- Reflect.setPrototypeOf(inst, finalProto);
91
- return inst;
243
+ if (!pendingAssemblies.has(this)) {
244
+ (0, internals_js_1.setMetadataOf)(this, new low_js_1.StateMetadata());
245
+ pendingAssemblies.add(this);
246
+ }
247
+ // Always update the shim to match the outermost constructor (new.target).
248
+ // In nested chains the innermost ExtractionShimBase sets the shim first;
249
+ // subsequent (shallower) ones overwrite it with the same value since
250
+ // new.target propagates as the outermost class throughout the chain.
251
+ const ctor = (new.target ?? ExtractionShimBase);
252
+ Reflect.setPrototypeOf(this, getOrCreateShim(ctor));
92
253
  }
93
254
  }
94
- ;
95
- classMapMemo.set(OriginalClass, Statified);
96
- return Statified;
255
+ // Invoke the user's factory with the shim base, then return the result.
256
+ // No outer Statified wrapper is needed: field instrumentation is lazy,
257
+ // triggered by registerPreExtractionHook before any selectorToRootAndPath call.
258
+ return makeSubclass(ExtractionShimBase);
97
259
  }
98
- exports.BaseStatified = makeStatified(Object);
99
260
  //# sourceMappingURL=basestatified.js.map
@@ -1 +1 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AC,GAAI,IAAW,CAAC,CAAC;YAEvB,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,4BAAa,EACX,IAA0C,EAC1C,IAAI,sBAAa,EAAE,CACpB,CAAC;gBACF,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;YAED,0EAA0E;YAC1E,yEAAyE;YACzE,qEAAqE;YACrE,qEAAqE;YACrE,MAAM,IAAI,GAAG,CAAC,IAAI,MAAM,IAAI,kBAAkB,CAAa,CAAC;YAC5D,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC;KACF;IAED,wEAAwE;IACxE,uEAAuE;IACvE,gFAAgF;IAChF,OAAO,YAAY,CACjB,kBAA+C,CACiB,CAAC;AACrE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Acceptance tests for statifyClass / makeStatified / BaseStatified.
3
+ *
4
+ * Run with: npx tsx src/quirks/basestatified.test.ts
5
+ *
6
+ * Uses Node.js built-in assert — no test framework required.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=basestatified.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basestatified.test.d.ts","sourceRoot":"","sources":["../../src/quirks/basestatified.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}