core: Move speedscope into a trace app. Isolate all the things.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 10m11s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 10m11s
This commit is contained in:
@@ -959,8 +959,7 @@ PACKAGE_DIRS := \
|
||||
core \
|
||||
deps/codemirror \
|
||||
deps/prettier \
|
||||
deps/lit \
|
||||
deps/speedscope
|
||||
deps/lit
|
||||
|
||||
RAW_FILES := $(sort $(filter-out apps/blog% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f -not -name '.*')))
|
||||
|
||||
@@ -1260,7 +1259,6 @@ tarball: ## Build an all-inclusive source tarball (.tar.xz).
|
||||
--exclude=deps/libsodium/test \
|
||||
--exclude=deps/libuv/docs \
|
||||
--exclude=deps/libuv/test \
|
||||
--exclude=deps/speedscope/*.map \
|
||||
--exclude=deps/sqlite/shell.c \
|
||||
--exclude=deps/zlib/contrib/vstudio \
|
||||
--exclude=deps/zlib/doc \
|
||||
|
||||
5
apps/trace.json
Normal file
5
apps/trace.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "📦",
|
||||
"previous": "&mhBOscDHiJ4VNnod27NOdRVC+4cXYZXIdYjsQBfmTYg=.sha256"
|
||||
}
|
||||
25
apps/trace/app.js
Normal file
25
apps/trace/app.js
Normal file
@@ -0,0 +1,25 @@
|
||||
async function main() {
|
||||
let speedscope_js = await utf8Decode(getFile('speedscope/speedscope-432XE7GS.js'));
|
||||
speedscope_js = speedscope_js.replace(/alert\(`Cannot load.*?return/, '');
|
||||
app.setDocument(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>speedscope</title>
|
||||
<link rel="stylesheet" href="speedscope/speedscope-GHPHNKXC.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
delete window.localStorage;
|
||||
window.location.hash = '#profileURL=${core.url}../../trace';
|
||||
</script>
|
||||
<script>${speedscope_js}</script>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
}
|
||||
|
||||
main();
|
||||
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -912,7 +912,7 @@ async function edit() {
|
||||
* Open a performance trace.
|
||||
*/
|
||||
function trace() {
|
||||
window.open(`/speedscope/#profileURL=${encodeURIComponent('/trace')}`);
|
||||
window.open(`/~core/trace/`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -965,7 +965,6 @@ tf_http_t* tf_httpd_create(JSContext* context)
|
||||
tf_http_add_handler(http, "/codemirror/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/lit/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/prettier/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/speedscope/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/static/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/.well-known/*", tf_httpd_endpoint_static, NULL, task);
|
||||
tf_http_add_handler(http, "/&*.sha256", _httpd_endpoint_add_slash, NULL, task);
|
||||
|
||||
@@ -138,7 +138,6 @@ void tf_httpd_endpoint_static(tf_http_request_t* request)
|
||||
{ "/lit/", "deps/lit/" },
|
||||
{ "/codemirror/", "deps/codemirror/" },
|
||||
{ "/prettier/", "deps/prettier/" },
|
||||
{ "/speedscope/", "deps/speedscope/" },
|
||||
{ "/.well-known/", "data/global/.well-known/" },
|
||||
};
|
||||
|
||||
|
||||
@@ -151,6 +151,14 @@ static void _tf_ssb_import_recursive_add_files(tf_ssb_t* ssb, uv_loop_t* loop, J
|
||||
tf_free(blob);
|
||||
tf_free(full_path);
|
||||
}
|
||||
else if (ent.type == UV_DIRENT_DIR)
|
||||
{
|
||||
size_t len = strlen(path) + strlen(ent.name) + 2;
|
||||
char* full_path = tf_malloc(len);
|
||||
snprintf(full_path, len, "%s/%s", path, ent.name);
|
||||
_tf_ssb_import_recursive_add_files(ssb, loop, context, files, root, full_path);
|
||||
tf_free(full_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user