@lipsjs/lips 0.0.1
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/LICENSE +21 -0
- package/README.md +138 -0
- package/dist/lips.min.js +3 -0
- package/dist/lips.min.js.map +48 -0
- package/dist/test.component.min.js +3 -0
- package/dist/test.component.min.js.map +49 -0
- package/dist/test.stress.min.js +476 -0
- package/dist/test.stress.min.js.map +49 -0
- package/dist/types/benchmark.d.ts +48 -0
- package/dist/types/component.d.ts +77 -0
- package/dist/types/dws.d.ts +14 -0
- package/dist/types/events.d.ts +14 -0
- package/dist/types/i18n.d.ts +16 -0
- package/dist/types/index.d.ts +173 -0
- package/dist/types/iuc.d.ts +25 -0
- package/dist/types/lips.d.ts +27 -0
- package/dist/types/preprocess.d.ts +2 -0
- package/dist/types/signal.d.ts +30 -0
- package/dist/types/stylesheet.d.ts +51 -0
- package/dist/types/syntax/async.d.ts +17 -0
- package/dist/types/syntax/for.d.ts +20 -0
- package/dist/types/syntax/if.d.ts +15 -0
- package/dist/types/syntax/pd.d.ts +31 -0
- package/dist/types/syntax/router.d.ts +40 -0
- package/dist/types/syntax/switch.d.ts +17 -0
- package/dist/types/tick.d.ts +38 -0
- package/dist/types/uqs.d.ts +37 -0
- package/dist/types/utils.d.ts +15 -0
- package/package.json +46 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A more efficient scheduler using microtasks
|
|
3
|
+
* for component updates
|
|
4
|
+
*/
|
|
5
|
+
export default class NextTick {
|
|
6
|
+
private pendingComponents;
|
|
7
|
+
private isPending;
|
|
8
|
+
private callbacks;
|
|
9
|
+
/**
|
|
10
|
+
* Register a component update callback
|
|
11
|
+
*/
|
|
12
|
+
register(ref: string, callback: Function): void;
|
|
13
|
+
/**
|
|
14
|
+
* Unregister a component
|
|
15
|
+
*/
|
|
16
|
+
unregister(ref: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Queue a component update to be processed
|
|
19
|
+
* in the next tick of the event loop
|
|
20
|
+
*/
|
|
21
|
+
queue(ref: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Schedule update using microtasks
|
|
24
|
+
*/
|
|
25
|
+
private schedule;
|
|
26
|
+
/**
|
|
27
|
+
* Process all pending component updates
|
|
28
|
+
*/
|
|
29
|
+
private process;
|
|
30
|
+
/**
|
|
31
|
+
* Clear all pending updates and reset state
|
|
32
|
+
*/
|
|
33
|
+
clear(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Complete disposal of all resources
|
|
36
|
+
*/
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FGUDBatchEntry, Metavars } from '.';
|
|
2
|
+
import type Component from './component';
|
|
3
|
+
/**
|
|
4
|
+
* Update Queue System for high-frequency DOM updates
|
|
5
|
+
*/
|
|
6
|
+
export default class UpdateQueue<MT extends Metavars> {
|
|
7
|
+
private pending;
|
|
8
|
+
private isPending;
|
|
9
|
+
private component;
|
|
10
|
+
private metrics;
|
|
11
|
+
constructor(component: Component<MT>);
|
|
12
|
+
/**
|
|
13
|
+
* Queue updates to be processed in the next tick
|
|
14
|
+
*/
|
|
15
|
+
queue(entry: FGUDBatchEntry): void;
|
|
16
|
+
/**
|
|
17
|
+
* Schedule processing using microtasks for better performance
|
|
18
|
+
*/
|
|
19
|
+
private scheduleProcessing;
|
|
20
|
+
/**
|
|
21
|
+
* Process all queued updates in a batch
|
|
22
|
+
*/
|
|
23
|
+
private processQueue;
|
|
24
|
+
/**
|
|
25
|
+
* Apply updates to the DOM
|
|
26
|
+
*/
|
|
27
|
+
private applyUpdates;
|
|
28
|
+
/**
|
|
29
|
+
* Get current metrics
|
|
30
|
+
*/
|
|
31
|
+
getMetrics(): {
|
|
32
|
+
batchCount: number;
|
|
33
|
+
lastBatchSize: number;
|
|
34
|
+
avgBatchSize: string;
|
|
35
|
+
totalUpdates: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ROOT_PATH = "#0";
|
|
2
|
+
export declare const SYNCTAX_VAR_FLAG = "syn:";
|
|
3
|
+
export declare const FUNCTION_ATTR_FLAG = "fn:";
|
|
4
|
+
export declare const EVENT_LISTENER_FLAG = "on-";
|
|
5
|
+
export declare const SPREAD_VAR_PATTERN: RegExp;
|
|
6
|
+
export declare const ARGUMENT_VAR_PATTERN: RegExp;
|
|
7
|
+
export declare const META_ATTRIBUTES: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Deep difference checker with support for Map, Set,
|
|
10
|
+
* and various JS built-in types
|
|
11
|
+
*/
|
|
12
|
+
export declare function isDiff(a: any, b: any): boolean;
|
|
13
|
+
export declare function isEqual(a: any, b: any): boolean;
|
|
14
|
+
export declare function deepClone(obj: any, seen?: WeakMap<object, any>): any;
|
|
15
|
+
export declare function deepAssign<T>(original: T, toSet: Record<string, any>): T;
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lipsjs/lips",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Fast, Lightweight Reactive UI Framework",
|
|
5
|
+
"main": "./dist/lips.min.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/",
|
|
8
|
+
"*.d.ts",
|
|
9
|
+
"dist/types/**/*"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"author": "Fabrice K.E.M",
|
|
18
|
+
"private": false,
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "bun compile --watch",
|
|
21
|
+
"compile": "bun build --entrypoints ./test/* ./src/lips.ts --entry-naming [name].min.[ext] --minify --root . --outdir ./dist --target browser --format esm --sourcemap=external",
|
|
22
|
+
"build:declaration": "tsc --project tsconfig.types.json && cp ./src/index.d.ts ./dist/types/index.d.ts",
|
|
23
|
+
"prepack": "bun compile && bun run build:declaration",
|
|
24
|
+
"test": "Echo 'Error: No test specified' && exit 1"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"cash-dom": "^8.1.5",
|
|
28
|
+
"stylis": "^4.3.4"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/stylis": "^4.2.7",
|
|
32
|
+
"tsc": "^2.0.4",
|
|
33
|
+
"typescript": "^5.7.3"
|
|
34
|
+
},
|
|
35
|
+
"directories": {
|
|
36
|
+
"dist": "dist/",
|
|
37
|
+
"docs": "docs/",
|
|
38
|
+
"test": "test/"
|
|
39
|
+
},
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git://github.com/fabrice8/lips"
|
|
44
|
+
},
|
|
45
|
+
"keywords": []
|
|
46
|
+
}
|