@signaltree/core 5.0.2 → 5.0.4

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.
@@ -3,6 +3,12 @@ import { isNodeAccessor } from '../../../lib/utils.js';
3
3
  import { LRUCache } from '../../../lru-cache.js';
4
4
  import { deepEqual } from '../../../deep-equal.js';
5
5
 
6
+ function isDevMode() {
7
+ if (typeof __DEV__ !== 'undefined') {
8
+ return __DEV__;
9
+ }
10
+ return false;
11
+ }
6
12
  const MAX_CACHE_SIZE = 1000;
7
13
  const DEFAULT_TTL = 5 * 60 * 1000;
8
14
  const memoizationCache = new Map();
@@ -291,6 +297,11 @@ function withMemoization(config = {}) {
291
297
  if (cached && equalityFn(cached.deps, [currentState])) {
292
298
  return cached.value;
293
299
  }
300
+ if (isDevMode() && tree.__devHooks?.onRecompute) {
301
+ try {
302
+ tree.__devHooks.onRecompute(key, 1);
303
+ } catch {}
304
+ }
294
305
  const result = fn(currentState);
295
306
  memoizeResultCache.set(key, {
296
307
  value: result,
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { signalTree } from './lib/signal-tree.js';
2
2
  export { ENHANCER_META, entityMap } from './lib/types.js';
3
3
  export { composeEnhancers, createLazySignalTree, isAnySignal, isNodeAccessor, toWritableSignal } from './lib/utils.js';
4
+ export { getPathNotifier } from './lib/path-notifier.js';
4
5
  export { SecurityPresets, SecurityValidator } from './lib/security/security-validator.js';
5
6
  export { createEnhancer, resolveEnhancerOrder } from './enhancers/index.js';
6
7
  export { flushBatchedUpdates, getBatchQueueSize, hasPendingUpdates, withBatching, withHighPerformanceBatching } from './enhancers/batching/lib/batching.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaltree/core",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "Lightweight, type-safe signal-based state management for Angular. Core package providing hierarchical signal trees, basic entity management, and async actions.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -66,7 +66,25 @@
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@angular/core": "^20.0.0",
69
- "tslib": "^2.0.0"
69
+ "@angular/compiler": "^20.0.0",
70
+ "@angular/platform-browser-dynamic": "^20.0.0",
71
+ "zone.js": "^0.15.0",
72
+ "tslib": "^2.0.0",
73
+ "vitest": "^2.0.0"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@angular/compiler": {
77
+ "optional": true
78
+ },
79
+ "@angular/platform-browser-dynamic": {
80
+ "optional": true
81
+ },
82
+ "zone.js": {
83
+ "optional": true
84
+ },
85
+ "vitest": {
86
+ "optional": true
87
+ }
70
88
  },
71
89
  "publishConfig": {
72
90
  "access": "public"
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
@@ -1 +1,3 @@
1
- export {};
1
+ import '@angular/compiler';
2
+ import 'zone.js';
3
+ import 'zone.js/testing';
package/src/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { signalTree } from './lib/signal-tree';
2
2
  export type { SignalTree, TreeNode, RemoveSignalMethods, Primitive, BuiltInObject, NotFn, DeepPath, DeepAccess, TreeConfig, TreePreset, Enhancer, EnhancerMeta, EnhancerWithMeta, ChainResult, WithMethod, EntitySignal, EntityMapMarker, EntityConfig, MutationOptions, AddOptions, AddManyOptions, PerformanceMetrics, EntityHelpers, TimeTravelEntry, } from './lib/types';
3
3
  export { entityMap } from './lib/types';
4
4
  export { equal, deepEqual, isNodeAccessor, isAnySignal, toWritableSignal, parsePath, composeEnhancers, isBuiltInObject, createLazySignalTree, } from './lib/utils';
5
+ export { getPathNotifier } from './lib/path-notifier';
5
6
  export { SecurityValidator, SecurityPresets, type SecurityEvent, type SecurityEventType, type SecurityValidatorConfig, } from './lib/security/security-validator';
6
7
  export { createEnhancer, resolveEnhancerOrder } from './enhancers/index';
7
8
  export { ENHANCER_META } from './lib/types';
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- displayName: string;
3
- preset: string;
4
- setupFilesAfterEnv: string[];
5
- coverageDirectory: string;
6
- transform: {
7
- '^.+\\.(ts|mjs|js|html)$': (string | {
8
- tsconfig: string;
9
- stringifyContentPathRegex: string;
10
- })[];
11
- };
12
- transformIgnorePatterns: string[];
13
- snapshotSerializers: string[];
14
- };
15
- export default _default;