tangled
alpha
login
or
join now
tombl.dev
/
dhtml
1
fork
atom
a post-component library for building user-interfaces on the web.
1
fork
atom
overview
issues
pulls
pipelines
Use proper typeof import types instead of any
tombl.dev
7 months ago
5eb4d594
c5e52406
verified
This commit was signed with the committer's
known signature
.
tombl.dev
SSH Key Fingerprint:
SHA256:d8AHgL5V+3WdvGdDb3SVBfb0RIRJfkKcqhQ5aG1mVNk=
+14
-12
2 changed files
expand all
collapse all
unified
split
scripts
test
runtime.ts
src
client
tests
bench-comparison.ts
+8
-8
scripts/test/runtime.ts
reviewed
···
44
44
} else {
45
45
// Multiple builds - comparison mode
46
46
const libraries: Array<{
47
47
-
index: { html: any }
48
48
-
client: { invalidate: any; createRoot: any }
49
49
-
server: any
47
47
+
index: typeof import('dhtml')
48
48
+
client: typeof import('dhtml/client')
49
49
+
server: typeof import('dhtml/server')
50
50
ref: string
51
51
}> = []
52
52
53
53
// Dynamically import all library versions
54
54
for (const build of builds) {
55
55
try {
56
56
-
const index = await import(`../../${build.path}/index.min.js`)
57
57
-
const client = await import(`../../${build.path}/client.min.js`)
58
58
-
const server = await import(`../../${build.path}/server.min.js`)
56
56
+
const index = (await import(`../../${build.path}/index.min.js`)) as typeof import('dhtml')
57
57
+
const client = (await import(`../../${build.path}/client.min.js`)) as typeof import('dhtml/client')
58
58
+
const server = (await import(`../../${build.path}/server.min.js`)) as typeof import('dhtml/server')
59
59
libraries.push({
60
60
-
index: { html: index.html },
61
61
-
client: { invalidate: client.invalidate, createRoot: client.createRoot },
60
60
+
index,
61
61
+
client,
62
62
server,
63
63
ref: build.ref,
64
64
})
+6
-4
src/client/tests/bench-comparison.ts
reviewed
···
1
1
export function get_benchmarks({
2
2
-
index: { html },
3
3
-
client: { invalidate, createRoot },
2
2
+
index,
3
3
+
client,
4
4
}: {
5
5
-
index: { html: any }
6
6
-
client: { invalidate: any; createRoot: any }
5
5
+
index: typeof import('dhtml')
6
6
+
client: typeof import('dhtml/client')
7
7
}): Record<string, () => void> {
8
8
+
const { html } = index
9
9
+
const { invalidate, createRoot } = client
8
10
// Setup function using the passed library version
9
11
function setup(initial_html = '') {
10
12
const el = document.createElement('div')