@praxisjs/store 2.0.3 → 2.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @praxisjs/store
2
2
 
3
+ ## 2.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 75115a9: Decorated fields are defined by their innermost decorator. With `@praxisjs/vite-plugin`, `@State()`, `@Prop()`, every built-in field decorator and `createFieldDecorator` bindings install their property directly with the field's initial value instead of replacing a plain value, which kept every instance in V8's slow dictionary mode. New `addClaimableInitializer(context, init)` export for field decorators written against the TC39 API.
8
+ - 75115a9: Field decorators throw a `TypeError` when the class is defined if they decorate an `accessor`, naming the member to fix. Covers `@State()`, `@Prop()`, every built-in field decorator and `createFieldDecorator` bindings. New `assertFieldContext(context, label?)` export for field decorators written against the TC39 API directly.
9
+ - 75115a9: Published packages no longer contain their tests: package builds compile `src` without `src/**/__tests__` (through a `tsconfig.build.json`), and each package's `files` leaves test sources and stale compiled tests out of the tarball. `pnpm typecheck` still type-checks the tests.
10
+ - 75115a9: Performance pass and bug fixes across the feature packages.
11
+ - `@praxisjs/router`: static paths are matched through an index and dynamic ones with a single regex run; `RouterView` keeps a shared layout mounted across navigations; new `router.isActive(path)` (used by `Link`, so a navigation re-evaluates only the links whose state changed) and `router.destroy()`. Fixes regex characters in route paths (`.`, `(`, `+`...) being treated as patterns, and a router replaced by `createRouter()` still reacting to `popstate`. `@Route` no longer wraps the class, and the field decorators share one accessor.
12
+ - `@praxisjs/store`: plugin-wrapped actions keep their identity across reads, extensions are bound once, and writing a field inside an effect no longer subscribes the effect to it. `constructor` and inherited `Object.prototype` members are no longer reported as actions. `@Store` caches the singleton.
13
+ - `@praxisjs/motion`: `@Tween` and `@Spring` share one accessor per field and no longer start a frame loop at construction; `tween()`/`spring()` react to target writes without an effect. Fixes `reset()` leaving a tween marked as playing.
14
+ - `@praxisjs/di`: cached singletons and tokens resolve without allocating, `@Injectable` registers the class itself instead of a subclass, and a dependency cycle through `inject()` calls in constructors now reports `[DI] Circular dependency detected` instead of overflowing the stack.
15
+ - `@praxisjs/fsm`: `send()` and `reset()` no longer subscribe the calling effect to the machine state, transitions allocate nothing per send, and `@StateMachine` shares one accessor.
16
+ - `@praxisjs/head`: tag diffing without `JSON.stringify` or a full `<head>` query per update; updating or removing an entry below the top one leaves the document alone, and removing an unknown id no longer resets the title.
17
+ - `@praxisjs/content`: each entry is loaded, parsed and rendered once and shared by `getCollection`, `getPage` and `getEntry`; `getEntry` looks the slug up in an index; schema defaults are built once per class.
18
+
19
+ - 75115a9: Smaller production bundles. The framework and feature packages are marked `"sideEffects": false`, so bundlers leave out the modules an app does not use (`For`/`Index` and `selector()` were kept in every bundle by their shape keepers). `@praxisjs/core`'s graph gates its observer instrumentation on a boolean that minifiers fold away when no observer is ever installed. `@praxisjs/runtime` passes `Index`'s positional update to the list view, so `For`-only apps leave it out, and builds its event prop table from camel-case names. `@praxisjs/devtools` is built one file per module and its decorators check `process.env.NODE_ENV` inline, so `@Trace`/`@Debug` in production code no longer bundle the registry and the panel. `@praxisjs/vite-plugin` serves TypeScript's decorator helpers and the claimed fields' helper from one virtual module (`virtual:praxisjs/decorators`) instead of writing them into every decorated file, and replaces the identical copies `tsc` wrote into ES module libraries.
20
+ - Updated dependencies [75115a9]
21
+ - Updated dependencies [75115a9]
22
+ - Updated dependencies [75115a9]
23
+ - Updated dependencies [75115a9]
24
+ - Updated dependencies [75115a9]
25
+ - Updated dependencies [75115a9]
26
+ - Updated dependencies [75115a9]
27
+ - Updated dependencies [75115a9]
28
+ - Updated dependencies [75115a9]
29
+ - Updated dependencies [75115a9]
30
+ - Updated dependencies [75115a9]
31
+ - @praxisjs/decorators@2.0.0
32
+ - @praxisjs/core@2.3.0
33
+
34
+ ## 2.0.4
35
+
36
+ ### Patch Changes
37
+
38
+ - 055d5b3: `createStore` actions keep a stable wrapper identity, `$patch()` and `$reset()` run in a single batch, and the previous value passed to `onMutation` is read untracked.
39
+ - Updated dependencies [a97a37c]
40
+ - Updated dependencies [c7a5950]
41
+ - @praxisjs/core@2.2.0
42
+ - @praxisjs/decorators@1.7.0
43
+
3
44
  ## 2.0.3
4
45
 
5
46
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"apply-plugins.d.ts","sourceRoot":"","sources":["../src/apply-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,EAAE,GACrB,CAAC,CAsEH"}
1
+ {"version":3,"file":"apply-plugins.d.ts","sourceRoot":"","sources":["../src/apply-plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,EAAE,GACrB,CAAC,CA8FH"}
@@ -1,55 +1,85 @@
1
+ import { pauseTracking, resumeTracking } from "@praxisjs/core/internal";
2
+ // `constructor` and the members every object inherits (`toString`, `hasOwnProperty`...) are not
3
+ // store actions: wrapping them would report them to plugins and break `new store.constructor()`.
4
+ function isBuiltin(prop, val) {
5
+ return prop === "constructor" || Object.prototype[prop] === val;
6
+ }
1
7
  export function applyPluginsToStore(instance, storeName, plugins) {
2
8
  if (plugins.length === 0)
3
9
  return instance;
4
- const extensions = {};
10
+ const actionPlugins = plugins.filter((p) => "onAction" in p || "onActionDone" in p);
11
+ const mutationPlugins = plugins.filter((p) => "onMutation" in p);
12
+ // Extensions are stored ready to return (functions already bound), so a read does no work.
13
+ const extensions = new Map();
14
+ // One wrapper per method, so `store.action` keeps its identity across reads; rebuilt only when
15
+ // the method itself is replaced.
16
+ const wrappers = new Map();
17
+ function wrap(name, fn) {
18
+ if (actionPlugins.length === 0) {
19
+ return (...args) => fn.apply(proxy, args);
20
+ }
21
+ return (...args) => {
22
+ for (const p of actionPlugins)
23
+ p.onAction?.({ name, args, storeName });
24
+ const result = fn.apply(proxy, args);
25
+ if (result instanceof Promise) {
26
+ return result
27
+ .then((resolved) => {
28
+ for (const p of actionPlugins)
29
+ p.onActionDone?.({ name, args, storeName, result: resolved });
30
+ return resolved;
31
+ })
32
+ .catch((err) => {
33
+ for (const p of actionPlugins)
34
+ p.onActionDone?.({ name, args, storeName, result: undefined, error: err });
35
+ throw err;
36
+ });
37
+ }
38
+ for (const p of actionPlugins)
39
+ p.onActionDone?.({ name, args, storeName, result });
40
+ return result;
41
+ };
42
+ }
5
43
  const proxy = new Proxy(instance, {
6
44
  get(target, prop) {
7
45
  if (typeof prop === "symbol")
8
46
  return Reflect.get(target, prop);
9
- if (prop in extensions) {
10
- const ext = extensions[prop];
11
- return typeof ext === "function"
12
- ? ext.bind(proxy)
13
- : ext;
14
- }
47
+ if (extensions.size > 0 && extensions.has(prop))
48
+ return extensions.get(prop);
15
49
  const val = Reflect.get(target, prop, proxy);
16
- if (typeof val === "function" && !prop.startsWith("$")) {
17
- return (...args) => {
18
- for (const p of plugins)
19
- p.onAction?.({ name: prop, args, storeName });
20
- const result = val.apply(proxy, args);
21
- if (result instanceof Promise) {
22
- return result
23
- .then((resolved) => {
24
- for (const p of plugins)
25
- p.onActionDone?.({ name: prop, args, storeName, result: resolved });
26
- return resolved;
27
- })
28
- .catch((err) => {
29
- for (const p of plugins)
30
- p.onActionDone?.({ name: prop, args, storeName, result: undefined, error: err });
31
- throw err;
32
- });
33
- }
34
- for (const p of plugins)
35
- p.onActionDone?.({ name: prop, args, storeName, result });
36
- return result;
37
- };
38
- }
39
- return val;
50
+ if (typeof val !== "function")
51
+ return val;
52
+ const cached = wrappers.get(prop);
53
+ if (cached?.fn === val)
54
+ return cached.wrapped;
55
+ if (prop.startsWith("$") || isBuiltin(prop, val))
56
+ return val;
57
+ const wrapped = wrap(prop, val);
58
+ wrappers.set(prop, { fn: val, wrapped });
59
+ return wrapped;
40
60
  },
41
61
  set(target, prop, value) {
42
62
  if (typeof prop === "symbol") {
43
63
  target[prop] = value;
44
64
  return true;
45
65
  }
46
- const prevValue = Reflect.get(target, prop, proxy);
47
- const ok = Reflect.set(target, prop, value, proxy);
48
- if (ok) {
49
- for (const p of plugins)
50
- p.onMutation?.({ key: prop, value, prevValue, storeName });
66
+ if (mutationPlugins.length === 0)
67
+ return Reflect.set(target, prop, value, proxy);
68
+ // A write is not a read: assigning a field inside an effect must not subscribe the effect to
69
+ // that field (through the previous value) or to whatever the plugins read.
70
+ const prevSub = pauseTracking();
71
+ try {
72
+ const prevValue = Reflect.get(target, prop, proxy);
73
+ const ok = Reflect.set(target, prop, value, proxy);
74
+ if (ok) {
75
+ for (const p of mutationPlugins)
76
+ p.onMutation?.({ key: prop, value, prevValue, storeName });
77
+ }
78
+ return ok;
79
+ }
80
+ finally {
81
+ resumeTracking(prevSub);
51
82
  }
52
- return ok;
53
83
  },
54
84
  });
55
85
  for (const plugin of plugins) {
@@ -57,7 +87,10 @@ export function applyPluginsToStore(instance, storeName, plugins) {
57
87
  store: proxy,
58
88
  storeName,
59
89
  extend(props) {
60
- Object.assign(extensions, props);
90
+ for (const key of Object.keys(props)) {
91
+ const ext = props[key];
92
+ extensions.set(key, typeof ext === "function" ? ext.bind(proxy) : ext);
93
+ }
61
94
  },
62
95
  });
63
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"apply-plugins.js","sourceRoot":"","sources":["../src/apply-plugins.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CACjC,QAAW,EACX,SAAiB,EACjB,OAAsB;IAEtB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE1C,MAAM,UAAU,GAA4B,EAAE,CAAC;IAE/C,MAAM,KA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Decorator, } from "@praxisjs/decorators";
1
+ import { addClaimableInitializer, assertFieldContext } from "@praxisjs/decorators";
2
2
  import { applyPluginsToStore } from "./apply-plugins.js";
3
3
  import { getGlobalPlugins } from "./plugin-registry.js";
4
4
  const storeRegistry = new Map();
@@ -15,27 +15,33 @@ export function Storable(options = {}) {
15
15
  };
16
16
  }
17
17
  export function store(StoreClass) {
18
- if (!storeRegistry.has(StoreClass) || storeRegistry.get(StoreClass) === null) {
19
- const instance = new StoreClass();
20
- const perStore = storePluginsMap.get(StoreClass) ?? [];
21
- const plugins = [...getGlobalPlugins(), ...perStore];
22
- const wrapped = applyPluginsToStore(instance, StoreClass.name, plugins);
23
- storeRegistry.set(StoreClass, wrapped);
24
- }
25
- return storeRegistry.get(StoreClass);
18
+ const existing = storeRegistry.get(StoreClass);
19
+ if (existing != null)
20
+ return existing;
21
+ const instance = new StoreClass();
22
+ const perStore = storePluginsMap.get(StoreClass) ?? [];
23
+ const plugins = [...getGlobalPlugins(), ...perStore];
24
+ const wrapped = applyPluginsToStore(instance, StoreClass.name, plugins);
25
+ storeRegistry.set(StoreClass, wrapped);
26
+ return wrapped;
26
27
  }
27
28
  export function Store(StoreConstructor) {
28
- return createFieldDecorator({
29
- bind(_instance, _name, _initialValue) {
30
- return {
31
- descriptor: {
32
- get() {
33
- return store(StoreConstructor);
34
- },
35
- },
36
- };
29
+ // A store is a singleton that is never replaced, so the first lookup is kept for every later read.
30
+ let cached;
31
+ const descriptor = {
32
+ get() {
33
+ return (cached ??= store(StoreConstructor));
37
34
  },
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
- });
35
+ enumerable: true,
36
+ configurable: true,
37
+ };
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ return function (_value, context) {
40
+ assertFieldContext(context);
41
+ const name = context.name;
42
+ addClaimableInitializer(context, function () {
43
+ Object.defineProperty(this, name, descriptor);
44
+ });
45
+ };
40
46
  }
41
47
  //# sourceMappingURL=decorators.js.map
@@ -1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AQ,GAAG,IAAI,UAAU,EAAE,CAAC;IAClC,MAAM,QAAQ,GACZ,eAAe,CAAC,GAAG,CAAC,UAAuD,CAAC,IAAI,EAAE,CAAC;IACrF,MAAM,OAAO,GAAG,CAAC,GAAG,gBAAgB,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxE,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,gBAAmC;IACvD,mGAAmG;IACnG,IAAI,MAAe,CAAC;IACpB,MAAM,UAAU,GAAuB;QACrC,GAAG;YACD,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,gBAA2C,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACnB,CAAC;IACF,8DAA8D;IAC9D,OAAO,UAAU,MAAiB,EAAE,OAAwC;QAC1E,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,uBAAuB,CAAC,OAAO,EAAE;YAC/B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@praxisjs/store",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
+ "sideEffects": false,
5
6
  "main": "./dist/index.js",
6
7
  "types": "./dist/index.d.ts",
7
8
  "exports": {
@@ -10,15 +11,23 @@
10
11
  "types": "./dist/index.d.ts"
11
12
  }
12
13
  },
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "!dist/**/__tests__",
18
+ "!src/**/__tests__",
19
+ "CHANGELOG.md"
20
+ ],
13
21
  "devDependencies": {
14
22
  "typescript": "^6.0.3"
15
23
  },
16
24
  "dependencies": {
17
- "@praxisjs/core": "2.1.0",
18
- "@praxisjs/decorators": "1.6.1"
25
+ "@praxisjs/decorators": "2.0.0",
26
+ "@praxisjs/core": "2.3.0"
19
27
  },
20
28
  "scripts": {
21
- "build": "tsc",
22
- "dev": "tsc --watch"
29
+ "build": "tsc -p tsconfig.build.json",
30
+ "dev": "tsc -p tsconfig.build.json --watch",
31
+ "typecheck": "tsc --noEmit"
23
32
  }
24
33
  }
@@ -1,5 +1,15 @@
1
+ import { pauseTracking, resumeTracking } from "@praxisjs/core/internal";
2
+
1
3
  import type { StorePlugin } from "./plugin-types.js";
2
4
 
5
+ type Action = (...args: unknown[]) => unknown;
6
+
7
+ // `constructor` and the members every object inherits (`toString`, `hasOwnProperty`...) are not
8
+ // store actions: wrapping them would report them to plugins and break `new store.constructor()`.
9
+ function isBuiltin(prop: string, val: unknown): boolean {
10
+ return prop === "constructor" || (Object.prototype as unknown as Record<string, unknown>)[prop] === val;
11
+ }
12
+
3
13
  export function applyPluginsToStore<T extends object>(
4
14
  instance: T,
5
15
  storeName: string,
@@ -7,45 +17,55 @@ export function applyPluginsToStore<T extends object>(
7
17
  ): T {
8
18
  if (plugins.length === 0) return instance;
9
19
 
10
- const extensions: Record<string, unknown> = {};
20
+ const actionPlugins = plugins.filter((p) => "onAction" in p || "onActionDone" in p);
21
+ const mutationPlugins = plugins.filter((p) => "onMutation" in p);
22
+ // Extensions are stored ready to return (functions already bound), so a read does no work.
23
+ const extensions = new Map<string, unknown>();
24
+ // One wrapper per method, so `store.action` keeps its identity across reads; rebuilt only when
25
+ // the method itself is replaced.
26
+ const wrappers = new Map<string, { fn: Action; wrapped: Action }>();
27
+
28
+ function wrap(name: string, fn: Action): Action {
29
+ if (actionPlugins.length === 0) {
30
+ return (...args) => fn.apply(proxy, args);
31
+ }
32
+ return (...args) => {
33
+ for (const p of actionPlugins) p.onAction?.({ name, args, storeName });
34
+ const result = fn.apply(proxy, args);
35
+ if (result instanceof Promise) {
36
+ return result
37
+ .then((resolved: unknown) => {
38
+ for (const p of actionPlugins)
39
+ p.onActionDone?.({ name, args, storeName, result: resolved });
40
+ return resolved;
41
+ })
42
+ .catch((err: unknown) => {
43
+ for (const p of actionPlugins)
44
+ p.onActionDone?.({ name, args, storeName, result: undefined, error: err });
45
+ throw err;
46
+ });
47
+ }
48
+ for (const p of actionPlugins)
49
+ p.onActionDone?.({ name, args, storeName, result });
50
+ return result;
51
+ };
52
+ }
11
53
 
12
54
  const proxy: T = new Proxy(instance, {
13
55
  get(target, prop: string | symbol): unknown {
14
56
  if (typeof prop === "symbol") return Reflect.get(target, prop) as unknown;
15
57
 
16
- if (prop in extensions) {
17
- const ext = extensions[prop];
18
- return typeof ext === "function"
19
- ? (ext as (...a: unknown[]) => unknown).bind(proxy)
20
- : ext;
21
- }
58
+ if (extensions.size > 0 && extensions.has(prop)) return extensions.get(prop);
22
59
 
23
60
  const val = Reflect.get(target, prop, proxy) as unknown;
24
61
 
25
- if (typeof val === "function" && !prop.startsWith("$")) {
26
- return (...args: unknown[]): unknown => {
27
- for (const p of plugins) p.onAction?.({ name: prop, args, storeName });
28
- const result = (val as (...a: unknown[]) => unknown).apply(proxy, args);
29
- if (result instanceof Promise) {
30
- return result
31
- .then((resolved: unknown) => {
32
- for (const p of plugins)
33
- p.onActionDone?.({ name: prop, args, storeName, result: resolved });
34
- return resolved;
35
- })
36
- .catch((err: unknown) => {
37
- for (const p of plugins)
38
- p.onActionDone?.({ name: prop, args, storeName, result: undefined, error: err });
39
- throw err;
40
- });
41
- }
42
- for (const p of plugins)
43
- p.onActionDone?.({ name: prop, args, storeName, result });
44
- return result;
45
- };
46
- }
47
-
48
- return val;
62
+ if (typeof val !== "function") return val;
63
+ const cached = wrappers.get(prop);
64
+ if (cached?.fn === val) return cached.wrapped;
65
+ if (prop.startsWith("$") || isBuiltin(prop, val)) return val;
66
+ const wrapped = wrap(prop, val as Action);
67
+ wrappers.set(prop, { fn: val as Action, wrapped });
68
+ return wrapped;
49
69
  },
50
70
 
51
71
  set(target, prop: string | symbol, value: unknown): boolean {
@@ -53,13 +73,21 @@ export function applyPluginsToStore<T extends object>(
53
73
  (target as Record<symbol, unknown>)[prop] = value;
54
74
  return true;
55
75
  }
56
- const prevValue = Reflect.get(target, prop, proxy) as unknown;
57
- const ok: boolean = Reflect.set(target, prop, value, proxy);
58
- if (ok) {
59
- for (const p of plugins)
60
- p.onMutation?.({ key: prop, value, prevValue, storeName });
76
+ if (mutationPlugins.length === 0) return Reflect.set(target, prop, value, proxy);
77
+ // A write is not a read: assigning a field inside an effect must not subscribe the effect to
78
+ // that field (through the previous value) or to whatever the plugins read.
79
+ const prevSub = pauseTracking();
80
+ try {
81
+ const prevValue = Reflect.get(target, prop, proxy) as unknown;
82
+ const ok: boolean = Reflect.set(target, prop, value, proxy);
83
+ if (ok) {
84
+ for (const p of mutationPlugins)
85
+ p.onMutation?.({ key: prop, value, prevValue, storeName });
86
+ }
87
+ return ok;
88
+ } finally {
89
+ resumeTracking(prevSub);
61
90
  }
62
- return ok;
63
91
  },
64
92
  });
65
93
 
@@ -68,7 +96,13 @@ export function applyPluginsToStore<T extends object>(
68
96
  store: proxy as unknown as Record<string, unknown>,
69
97
  storeName,
70
98
  extend(props) {
71
- Object.assign(extensions, props);
99
+ for (const key of Object.keys(props)) {
100
+ const ext = props[key];
101
+ extensions.set(
102
+ key,
103
+ typeof ext === "function" ? (ext as Action).bind(proxy) : ext,
104
+ );
105
+ }
72
106
  },
73
107
  });
74
108
  }
package/src/decorators.ts CHANGED
@@ -1,8 +1,4 @@
1
- import {
2
- createFieldDecorator,
3
- reactiveHostType,
4
- type FieldBinding,
5
- } from "@praxisjs/decorators";
1
+ import { reactiveHostType, addClaimableInitializer, assertFieldContext } from "@praxisjs/decorators";
6
2
 
7
3
  import { applyPluginsToStore } from "./apply-plugins.js";
8
4
  import { getGlobalPlugins } from "./plugin-registry.js";
@@ -37,28 +33,33 @@ export function Storable(options: StorableOptions = {}) {
37
33
  }
38
34
 
39
35
  export function store<T extends ReactiveStore>(StoreClass: new () => T): T {
40
- if (!storeRegistry.has(StoreClass) || storeRegistry.get(StoreClass) === null) {
41
- const instance = new StoreClass();
42
- const perStore =
43
- storePluginsMap.get(StoreClass as new (...args: unknown[]) => ReactiveStore) ?? [];
44
- const plugins = [...getGlobalPlugins(), ...perStore];
45
- const wrapped = applyPluginsToStore(instance, StoreClass.name, plugins);
46
- storeRegistry.set(StoreClass, wrapped);
47
- }
48
- return storeRegistry.get(StoreClass) as T;
36
+ const existing = storeRegistry.get(StoreClass);
37
+ if (existing != null) return existing as T;
38
+ const instance = new StoreClass();
39
+ const perStore =
40
+ storePluginsMap.get(StoreClass as new (...args: unknown[]) => ReactiveStore) ?? [];
41
+ const plugins = [...getGlobalPlugins(), ...perStore];
42
+ const wrapped = applyPluginsToStore(instance, StoreClass.name, plugins);
43
+ storeRegistry.set(StoreClass, wrapped);
44
+ return wrapped;
49
45
  }
50
46
 
51
47
  export function Store(StoreConstructor: new () => unknown) {
52
- return createFieldDecorator({
53
- bind(_instance, _name, _initialValue): FieldBinding {
54
- return {
55
- descriptor: {
56
- get(this: object): unknown {
57
- return store(StoreConstructor as new () => ReactiveStore);
58
- },
59
- },
60
- };
48
+ // A store is a singleton that is never replaced, so the first lookup is kept for every later read.
49
+ let cached: unknown;
50
+ const descriptor: PropertyDescriptor = {
51
+ get(): unknown {
52
+ return (cached ??= store(StoreConstructor as new () => ReactiveStore));
61
53
  },
54
+ enumerable: true,
55
+ configurable: true,
56
+ };
62
57
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
- }) as unknown as (_value: undefined, context: ClassFieldDecoratorContext<any>) => void;
58
+ return function (_value: undefined, context: ClassFieldDecoratorContext<any>): void {
59
+ assertFieldContext(context);
60
+ const name = context.name;
61
+ addClaimableInitializer(context, function () {
62
+ Object.defineProperty(this, name, descriptor);
63
+ });
64
+ };
64
65
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=create-store.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-store.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/create-store.test.ts"],"names":[],"mappings":""}