@mintjamsinc/ichigojs 0.1.1 → 0.1.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.
@@ -84,6 +84,14 @@ export declare class VNode {
84
84
  */
85
85
  get dependentIdentifiers(): string[];
86
86
  get preparableIdentifiers(): string[];
87
+ /**
88
+ * The DOM path of this virtual node.
89
+ * This is a string representation of the path from the root to this node,
90
+ * using the node names and their indices among siblings with the same name.
91
+ * For example: "DIV[0]/SPAN[1]/#text[0]"
92
+ * @return The DOM path as a string.
93
+ */
94
+ get domPath(): string;
87
95
  /**
88
96
  * Updates the virtual node and its children based on the current bindings.
89
97
  * This method evaluates any expressions in text nodes and applies effectors from directives.
@@ -107,9 +115,11 @@ export declare class VNode {
107
115
  /**
108
116
  * Adds a dependent virtual node that relies on this node's bindings.
109
117
  * @param dependent The dependent virtual node to add.
118
+ * @param dependentIdentifiers The identifiers that the dependent node relies on.
119
+ * If not provided, the dependent node's own identifiers will be used.
110
120
  * @returns A list of closers to unregister the dependency, or undefined if no dependency was added.
111
121
  */
112
- addDependent(dependent: VNode): VCloser[] | undefined;
122
+ addDependent(dependent: VNode, dependentIdentifiers?: string[] | undefined): VCloser[] | undefined;
113
123
  /**
114
124
  * Cleans up any resources used by this virtual node.
115
125
  * This method is called when the virtual node is no longer needed.
@@ -22,4 +22,9 @@ export interface VNodeInit {
22
22
  * This is optional and may be undefined if there are no bindings.
23
23
  */
24
24
  bindings?: VBindings;
25
+ /**
26
+ * The set of identifiers that this node depends on.
27
+ * This is optional and may be undefined if there are no dependent identifiers.
28
+ */
29
+ dependentIdentifiers?: string[];
25
30
  }
@@ -3,19 +3,20 @@
3
3
  */
4
4
  export declare class ReactiveProxy {
5
5
  /**
6
- * A WeakMap to store the original target for each proxy.
7
- * This allows us to avoid creating multiple proxies for the same object.
6
+ * A WeakMap to store the proxy for each target object and path combination.
7
+ * This prevents creating multiple proxies for the same object accessed from different paths.
8
8
  */
9
- private static proxyMap;
9
+ private static proxyCache;
10
10
  /**
11
11
  * Creates a reactive proxy for the given object.
12
12
  * The proxy will call the onChange callback whenever a property is modified.
13
13
  *
14
14
  * @param target The object to make reactive.
15
- * @param onChange Callback function to call when the object changes. Receives the changed key name.
15
+ * @param onChange Callback function to call when the object changes. Receives the full path of the changed property.
16
+ * @param path The current path in the object tree (used internally for nested objects).
16
17
  * @returns A reactive proxy of the target object.
17
18
  */
18
- static create<T extends object>(target: T, onChange: (changedKey?: string) => void): T;
19
+ static create<T extends object>(target: T, onChange: (changedPath?: string) => void, path?: string): T;
19
20
  /**
20
21
  * Checks if the given object is a reactive proxy.
21
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintjamsinc/ichigojs",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "ichigo.js - Simple and intuitive reactive framework. Lightweight, fast, and user-friendly virtual DOM library",
5
5
  "main": "./dist/ichigo.umd.js",
6
6
  "module": "./dist/ichigo.esm.js",
@@ -11,7 +11,7 @@
11
11
  "homepage": "https://github.com/mintjamsinc/ichigojs#readme",
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "https://github.com/mintjamsinc/ichigojs.git"
14
+ "url": "git+https://github.com/mintjamsinc/ichigojs.git"
15
15
  },
16
16
  "bugs": {
17
17
  "url": "https://github.com/mintjamsinc/ichigojs/issues"