perf: analyze cjs exports and emit typescript in parallel (#23856)

This commit is contained in:
David Sherret 2024-05-18 11:42:03 -04:00 committed by GitHub
parent fcb6a18b2b
commit a2dbcf9e0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 398 additions and 153 deletions

View file

@ -1,5 +1,5 @@
{
"tempDir": true,
"args": "run -A --log-level=debug main.tsx",
"args": "run -A run_main_sorted_lines.ts",
"output": "main.out"
}

View file

@ -1,5 +1,5 @@
[WILDCARD]Resolved preact from file:///[WILDLINE]/preact@10.19.6/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
DEBUG RS - [WILDLINE] - Resolved preact from file:///[WILDLINE]/preact@10.19.6/node_modules/preact/hooks/dist/hooks.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[# ensure that preact is resolving to .deno/preact@10.19.6/node_modules/preact and not .deno/preact-render-to-string@6.4.0/node_modules/preact]
DEBUG RS - [WILDLINE] - Resolved preact from file:///[WILDLINE]/preact-render-to-string@6.4.0/node_modules/preact-render-to-string/dist/index.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[WILDCARD]
[WILDCARD]/preact-render-to-string@6.4.0/node_modules/preact-render-to-string/dist/index.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[WILDCARD]/preact@10.19.6/node_modules/preact/hooks/dist/hooks.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[WILDCARD]/preact@10.19.6/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[WILDCARD]

View file

@ -0,0 +1,19 @@
const { success, stderr } = new Deno.Command(
Deno.execPath(),
{
args: ["run", "-A", "--log-level=debug", "main.tsx"],
},
).outputSync();
const stderrText = new TextDecoder().decode(stderr);
if (!success) {
console.error(stderrText);
throw new Error("Failed to run script.");
}
// create some stability with the output
const lines = stderrText.split("\n")
.filter((line) => line.includes("Resolved preact from"));
lines.sort();
for (const line of lines) {
console.error(line);
}