fix: 120 type errors
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m47s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m47s
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
import { IndexDBCache, RemoteNodeRegistry } from "@nodes/registry";
|
||||
import { createPerformanceStore } from "@nodes/utils";
|
||||
import BenchmarkPanel from "$lib/sidebar/panels/BenchmarkPanel.svelte";
|
||||
import { debounceAsyncFunction } from "$lib/helpers";
|
||||
|
||||
let performanceStore = createPerformanceStore();
|
||||
|
||||
@@ -79,40 +80,39 @@
|
||||
});
|
||||
|
||||
let runIndex = 0;
|
||||
const handleUpdate = async (
|
||||
g: Graph,
|
||||
s: Record<string, any> = graphSettings,
|
||||
) => {
|
||||
runIndex++;
|
||||
performanceStore.startRun();
|
||||
try {
|
||||
let a = performance.now();
|
||||
const graphResult = await runtime.execute(
|
||||
$state.snapshot(g),
|
||||
$state.snapshot(s),
|
||||
);
|
||||
let b = performance.now();
|
||||
const handleUpdate = debounceAsyncFunction(
|
||||
async (g: Graph, s: Record<string, any> = graphSettings) => {
|
||||
runIndex++;
|
||||
performanceStore.startRun();
|
||||
try {
|
||||
let a = performance.now();
|
||||
const graphResult = await runtime.execute(
|
||||
$state.snapshot(g),
|
||||
$state.snapshot(s),
|
||||
);
|
||||
let b = performance.now();
|
||||
|
||||
if (appSettings.debug.useWorker) {
|
||||
let perfData = await runtime.getPerformanceData();
|
||||
let lastRun = perfData?.at(-1);
|
||||
if (lastRun?.total) {
|
||||
lastRun.runtime = lastRun.total;
|
||||
delete lastRun.total;
|
||||
performanceStore.mergeData(lastRun);
|
||||
performanceStore.addPoint(
|
||||
"worker-transfer",
|
||||
b - a - lastRun.runtime[0],
|
||||
);
|
||||
if (appSettings.debug.useWorker) {
|
||||
let perfData = await runtime.getPerformanceData();
|
||||
let lastRun = perfData?.at(-1);
|
||||
if (lastRun?.total) {
|
||||
lastRun.runtime = lastRun.total;
|
||||
delete lastRun.total;
|
||||
performanceStore.mergeData(lastRun);
|
||||
performanceStore.addPoint(
|
||||
"worker-transfer",
|
||||
b - a - lastRun.runtime[0],
|
||||
);
|
||||
}
|
||||
}
|
||||
viewerComponent?.update(graphResult);
|
||||
} catch (error) {
|
||||
console.log("errors", error);
|
||||
} finally {
|
||||
performanceStore.stopRun();
|
||||
}
|
||||
viewerComponent?.update(graphResult);
|
||||
} catch (error) {
|
||||
console.log("errors", error);
|
||||
} finally {
|
||||
performanceStore.stopRun();
|
||||
}
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
$effect(() => {
|
||||
//@ts-ignore
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
import type { RequestHandler } from "./$types";
|
||||
import type { EntryGenerator, RequestHandler } from "./$types";
|
||||
import * as registry from "$lib/node-registry";
|
||||
import type { EntryGenerator } from "../$types";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const entries: EntryGenerator = async () => {
|
||||
const users = await registry.getUsers();
|
||||
return users.map(user => {
|
||||
return user.collections.map(collection => {
|
||||
return collection.nodes.map(node => {
|
||||
return { user: user.id, collection: collection.id.split("/")[1], node: node.id.split("/")[2] }
|
||||
return users
|
||||
.map((user) => {
|
||||
return user.collections.map((collection) => {
|
||||
return collection.nodes.map((node) => {
|
||||
return {
|
||||
user: user.id,
|
||||
collection: collection.id.split("/")[1],
|
||||
node: node.id.split("/")[2],
|
||||
};
|
||||
});
|
||||
});
|
||||
})
|
||||
}).flat(2);
|
||||
}
|
||||
.flat(2);
|
||||
};
|
||||
|
||||
export const GET: RequestHandler = async function GET({ params }) {
|
||||
|
||||
const wasm = await registry.getWasm(`${params.user}/${params.collection}/${params.node}`);
|
||||
const wasm = await registry.getWasm(
|
||||
`${params.user}/${params.collection}/${params.node}`,
|
||||
);
|
||||
|
||||
if (!wasm) {
|
||||
return new Response("Not found", { status: 404 });
|
||||
}
|
||||
|
||||
return new Response(wasm, { status: 200, headers: { "Content-Type": "application/wasm" } });
|
||||
}
|
||||
return new Response(wasm, {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/wasm" },
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user