@mintjamsinc/ichigojs 0.1.21 → 0.1.23
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/README.md +45 -0
- package/dist/ichigo.esm.js +149 -17
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -2
- package/dist/ichigo.esm.min.js.map +1 -1
- package/dist/ichigo.umd.js +149 -16
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -2
- package/dist/ichigo.umd.min.js.map +1 -1
- package/dist/types/ichigo/VApplication.d.ts +16 -5
- package/dist/types/ichigo/VApplicationInit.d.ts +25 -0
- package/dist/types/ichigo/VBindings.d.ts +7 -0
- package/dist/types/ichigo/util/ReactiveProxy.d.ts +29 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,8 +2,9 @@ import { VLogManager } from "./util/VLogManager";
|
|
|
2
2
|
import { VApplicationOptions } from "./VApplicationOptions";
|
|
3
3
|
import { VBindings } from "./VBindings";
|
|
4
4
|
import { VNode } from "./VNode";
|
|
5
|
-
import
|
|
5
|
+
import { VDirectiveParserRegistry } from "./directives/VDirectiveParserRegistry";
|
|
6
6
|
import { VComponentRegistry } from "./components/VComponentRegistry";
|
|
7
|
+
import { VApplicationInit } from "./VApplicationInit";
|
|
7
8
|
/**
|
|
8
9
|
* Represents a virtual application instance.
|
|
9
10
|
*/
|
|
@@ -11,11 +12,13 @@ export declare class VApplication {
|
|
|
11
12
|
#private;
|
|
12
13
|
/**
|
|
13
14
|
* Creates an instance of the virtual application.
|
|
14
|
-
* @param
|
|
15
|
-
* @param directiveParserRegistry The global directive parser registry.
|
|
16
|
-
* @param componentRegistry The global component registry.
|
|
15
|
+
* @param args The initialization arguments for the application.
|
|
17
16
|
*/
|
|
18
|
-
constructor(
|
|
17
|
+
constructor(args: VApplicationInit);
|
|
18
|
+
/**
|
|
19
|
+
* Gets the parent application, if any.
|
|
20
|
+
*/
|
|
21
|
+
get parentApplication(): VApplication | undefined;
|
|
19
22
|
/**
|
|
20
23
|
* Gets the global directive parser registry.
|
|
21
24
|
*/
|
|
@@ -55,4 +58,12 @@ export declare class VApplication {
|
|
|
55
58
|
* @returns The created child application instance.
|
|
56
59
|
*/
|
|
57
60
|
createChildApp(options: VApplicationOptions): VApplication;
|
|
61
|
+
/**
|
|
62
|
+
* Computes dependent identifiers for a given computed property and value.
|
|
63
|
+
* This is used to track dependencies in directives like v-for.
|
|
64
|
+
* @param computedName The name of the computed property.
|
|
65
|
+
* @param value The value to check for dependencies.
|
|
66
|
+
* @returns An array of dependent identifiers.
|
|
67
|
+
*/
|
|
68
|
+
resolveDependentIdentifiers(computedName: string, value: any): string[];
|
|
58
69
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VComponentRegistry } from "./components/VComponentRegistry";
|
|
2
|
+
import { VDirectiveParserRegistry } from "./directives/VDirectiveParserRegistry";
|
|
3
|
+
import { VApplication } from "./VApplication";
|
|
4
|
+
import { VApplicationOptions } from "./VApplicationOptions";
|
|
5
|
+
/**
|
|
6
|
+
* The interface for initializing a VApplication instance.
|
|
7
|
+
*/
|
|
8
|
+
export interface VApplicationInit {
|
|
9
|
+
/**
|
|
10
|
+
* The options for initializing the application.
|
|
11
|
+
*/
|
|
12
|
+
options: VApplicationOptions;
|
|
13
|
+
/**
|
|
14
|
+
* The parent application, if any.
|
|
15
|
+
*/
|
|
16
|
+
parentApplication?: VApplication;
|
|
17
|
+
/**
|
|
18
|
+
* The global directive parser registry.
|
|
19
|
+
*/
|
|
20
|
+
directiveParserRegistry: VDirectiveParserRegistry;
|
|
21
|
+
/**
|
|
22
|
+
* The global component registry.
|
|
23
|
+
*/
|
|
24
|
+
componentRegistry: VComponentRegistry;
|
|
25
|
+
}
|
|
@@ -56,4 +56,11 @@ export declare class VBindings {
|
|
|
56
56
|
* @param key The binding name.
|
|
57
57
|
*/
|
|
58
58
|
remove(key: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Sets a binding value without triggering onChange callback.
|
|
61
|
+
* This is useful for internal updates that shouldn't trigger reactivity.
|
|
62
|
+
* @param key The binding name.
|
|
63
|
+
* @param value The binding value.
|
|
64
|
+
*/
|
|
65
|
+
setSilent(key: string, value: any): void;
|
|
59
66
|
}
|
|
@@ -7,6 +7,16 @@ export declare class ReactiveProxy {
|
|
|
7
7
|
* This prevents creating multiple proxies for the same object accessed from different paths.
|
|
8
8
|
*/
|
|
9
9
|
private static proxyCache;
|
|
10
|
+
/**
|
|
11
|
+
* A WeakMap to track which objects are proxies, mapping proxy -> original target.
|
|
12
|
+
* This prevents double-wrapping of already proxied objects.
|
|
13
|
+
*/
|
|
14
|
+
private static proxyToTarget;
|
|
15
|
+
/**
|
|
16
|
+
* A WeakSet to track objects marked as "raw" (non-reactive).
|
|
17
|
+
* These objects will not be wrapped with Proxy.
|
|
18
|
+
*/
|
|
19
|
+
private static rawObjects;
|
|
10
20
|
/**
|
|
11
21
|
* Creates a reactive proxy for the given object.
|
|
12
22
|
* The proxy will call the onChange callback whenever a property is modified.
|
|
@@ -32,4 +42,23 @@ export declare class ReactiveProxy {
|
|
|
32
42
|
* @returns The original object.
|
|
33
43
|
*/
|
|
34
44
|
static unwrap<T>(obj: T): T;
|
|
45
|
+
/**
|
|
46
|
+
* Marks an object as "raw" (non-reactive).
|
|
47
|
+
* Objects marked as raw will not be wrapped with Proxy when accessed from reactive objects.
|
|
48
|
+
* This is useful for objects that should not be reactive, such as:
|
|
49
|
+
* - Objects with private fields (class instances with # fields)
|
|
50
|
+
* - Third-party library instances
|
|
51
|
+
* - Objects used only for method calls
|
|
52
|
+
*
|
|
53
|
+
* @param obj The object to mark as raw.
|
|
54
|
+
* @returns The same object (for chaining).
|
|
55
|
+
*/
|
|
56
|
+
static markRaw<T extends object>(obj: T): T;
|
|
57
|
+
/**
|
|
58
|
+
* Checks if an object is marked as raw (non-reactive).
|
|
59
|
+
*
|
|
60
|
+
* @param obj The object to check.
|
|
61
|
+
* @returns True if the object is marked as raw, false otherwise.
|
|
62
|
+
*/
|
|
63
|
+
static isRaw(obj: any): boolean;
|
|
35
64
|
}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintjamsinc/ichigojs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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",
|