@lukekaalim/act-web 3.2.2 → 3.4.0-alpha.0
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 +24 -0
- package/mod.ts +1 -0
- package/package.json +3 -3
- package/render.ts +2 -26
- package/scheduler.ts +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @lukekaalim/act-web
|
|
2
2
|
|
|
3
|
+
## 3.4.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b3f6c49: Added debug capabilities and protocol
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [b3f6c49]
|
|
12
|
+
- @lukekaalim/act-backstage@3.0.0-alpha.0
|
|
13
|
+
- @lukekaalim/act-recon@3.0.0-alpha.0
|
|
14
|
+
|
|
15
|
+
## 3.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Scheduling refactor
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @lukekaalim/act-backstage@2.0.0
|
|
25
|
+
- @lukekaalim/act-recon@2.0.0
|
|
26
|
+
|
|
3
27
|
## 3.2.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/mod.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukekaalim/act-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "mod.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@lukekaalim/act": "^3.1.0",
|
|
8
|
-
"@lukekaalim/act-recon": "^
|
|
9
|
-
"@lukekaalim/act-backstage": "^
|
|
8
|
+
"@lukekaalim/act-recon": "^3.0.0-alpha.0",
|
|
9
|
+
"@lukekaalim/act-backstage": "^3.0.0-alpha.0"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/render.ts
CHANGED
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from "@lukekaalim/act";
|
|
2
2
|
import { createWebSpace, HTML } from "./space";
|
|
3
3
|
import { createRenderFunction, RenderFunction } from "@lukekaalim/act-backstage";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export const createDOMScheduler = (): Scheduler => {
|
|
7
|
-
const workMap = new Map();
|
|
8
|
-
let id: number | null = null;
|
|
9
|
-
const work = () => {
|
|
10
|
-
id = null;
|
|
11
|
-
for (const [,callback] of workMap)
|
|
12
|
-
callback();
|
|
13
|
-
|
|
14
|
-
workMap.clear();
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
requestWork(callback) {
|
|
18
|
-
const workId = createId<'WorkID'>();
|
|
19
|
-
workMap.set(workId, callback);
|
|
20
|
-
if (!id)
|
|
21
|
-
id = setTimeout(work, 1) as any;
|
|
22
|
-
return workId;
|
|
23
|
-
},
|
|
24
|
-
cancelWork(workId) {
|
|
25
|
-
workMap.delete(workId);
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
}
|
|
4
|
+
import { createDOMScheduler } from "./scheduler";
|
|
29
5
|
|
|
30
6
|
|
|
31
7
|
export const render: RenderFunction<HTMLElement> = (node, root) =>
|
package/scheduler.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createId } from "@lukekaalim/act";
|
|
2
|
+
import { Scheduler } from "@lukekaalim/act-recon";
|
|
3
|
+
|
|
4
|
+
export const createDOMScheduler = (): Scheduler => {
|
|
5
|
+
const workMap = new Map();
|
|
6
|
+
let id: number | null = null;
|
|
7
|
+
const work = () => {
|
|
8
|
+
id = null;
|
|
9
|
+
for (const [,callback] of workMap)
|
|
10
|
+
callback();
|
|
11
|
+
|
|
12
|
+
workMap.clear();
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
requestWork(callback) {
|
|
16
|
+
const workId = createId<'WorkID'>();
|
|
17
|
+
workMap.set(workId, callback);
|
|
18
|
+
if (!id)
|
|
19
|
+
id = setTimeout(work, 1) as any;
|
|
20
|
+
return workId;
|
|
21
|
+
},
|
|
22
|
+
cancelWork(workId) {
|
|
23
|
+
workMap.delete(workId);
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
}
|