Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace server #45

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
12d6d7e
(WIP) adding back live trace
typeholes Jun 5, 2024
3b36529
displays for all types working again
typeholes Jun 5, 2024
bd72964
show tree on client init
typeholes Jun 5, 2024
a7a6169
log errors from live trace
typeholes Jun 7, 2024
4ee166d
use ts-trace-server
typeholes Jun 8, 2024
7e2aec5
(WIP) moving functionality to server
typeholes Jun 8, 2024
fe9f1fa
(WIP) moving functionality to server - builds
typeholes Jun 9, 2024
e9975bf
remove divisions by 1000 and get locations in trace lines
typeholes Jun 9, 2024
f94b290
fix: relative paths in UI
typeholes Jun 9, 2024
de3a386
chore: cleanup imports and unused file
typeholes Jun 9, 2024
060ef33
fix: packages traces using workspace path
typeholes Jun 9, 2024
f7d2598
chore: update pnpm lock file
typeholes Jun 9, 2024
d2453d6
chore: fix typecheck issues
typeholes Jun 9, 2024
890a10b
fix: include lib in dist
typeholes Jun 9, 2024
01229d5
ui: display max depth instead of child count
typeholes Jun 9, 2024
22d6328
ui: child nodes also sorted
typeholes Jun 9, 2024
40b43fc
ui: deep expand tree on shift click
typeholes Jun 9, 2024
7966859
fix: trace diagnostics not showing
typeholes Jun 10, 2024
43a4907
realtime diagnositcs respect thresholds and max per file config
typeholes Jun 10, 2024
a7b0337
fix: goto location and other relative path issues
typeholes Jun 10, 2024
c47a139
fix: duplicate nodes when rerunning traces
typeholes Jun 10, 2024
d974af0
fix: expand icon directions for stickied deep expansion
typeholes Jun 10, 2024
01a8185
fix: separate running indicators for metrics and trace
typeholes Jun 10, 2024
b2f25a2
chore: unused imports
typeholes Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,27 @@
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
"preLaunchTask": "npm: dev"
},
{
"type": "node",
"request": "launch",
"name": "Launch Server",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/server/dist/index.js",
"preLaunchTask": "npm: server:dev",
"outFiles": [
"${workspaceFolder}/server/dist/**/*.js"
]
}
],
"compounds": [
{
"name": "Server/Extension",
"configurations": ["Run Extension", "Launch Server"],
"stopAll": true
}
]
}
20 changes: 19 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,25 @@
"group": {
"kind": "build",
"isDefault": true
}
},
"problemMatcher": [],
"label": "npm: dev",
"detail": "nr build --watch --sourcemap"
},
{
"type": "npm",
"script": "server:dev",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
"label": "npm: server:dev",
"detail": "cd server && nr build --watch --sourcemap"
}
]
}
57 changes: 25 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,23 @@
"description": "Create diagnostics from tsserver",
"order": 6
},
"tsperf.tracer.maxDiagnosticsPerFile": {
"type": "number",
"default": 20,
"description": "maximum diagnostics to create per file for realtime metrics",
"order": 7
},
"tsperf.tracer.enableTraceMetrics": {
"type": "boolean",
"default": true,
"description": "Create diagnostics from trace data",
"order": 7
"order": 8
},
"tsperf.tracer.fileBrowserExecutable": {
"type": "string",
"default": "",
"description": "command to open your preferred file browser. Use the ${traceDir} substitution variable",
"order": 8
"order": 9
},
"tsperf.tracer.traceTimeThresholds": {
"type": "object",
Expand All @@ -125,7 +131,7 @@
"error": -1
},
"description": "todo",
"order": 9,
"order": 10,
"markdownDescription": "# Trace Time Thresholds\n\nTrigger diagnostics from trace files when check time in ms exceeds these thresholds.\n\n* -1 will disable diagnostics of that severity\n"
},
"tsperf.tracer.traceTypeThresholds": {
Expand Down Expand Up @@ -153,7 +159,7 @@
"error": -1
},
"description": "todo",
"order": 10,
"order": 11,
"markdownDescription": "# Trace Type Thresholds\n\nTrigger diagnostics from trace files when the number of types created locally in this check call exceeds these thresholds.\n\n* -1 will disable diagnostics of that severity\n"
},
"tsperf.tracer.traceTotalTypeThresholds": {
Expand Down Expand Up @@ -181,14 +187,14 @@
"error": -1
},
"description": "todo",
"order": 11,
"order": 12,
"markdownDescription": "# Trace Total Type Thresholds\n\nTrigger diagnostics from trace files when the number of types created in this check call stack exceeds these thresholds.\n\n* -1 will disable diagnostics of that severity\n"
},
"tsperf.tracer.traceDiagnosticsRelative": {
"type": "boolean",
"default": false,
"description": "Use measurements relative to the average for trace diagnostics",
"order": 12
"order": 13
},
"tsperf.tracer.traceTimeRelativeThresholds": {
"type": "object",
Expand All @@ -215,7 +221,7 @@
"error": -1
},
"description": "todo",
"order": 13
"order": 14
},
"tsperf.tracer.traceTypeRelativeThresholds": {
"type": "object",
Expand All @@ -242,7 +248,7 @@
"error": -1
},
"description": "todo",
"order": 14
"order": 15
},
"tsperf.tracer.traceTotalTypeRelativeThresholds": {
"type": "object",
Expand All @@ -269,7 +275,7 @@
"error": -1
},
"description": "todo",
"order": 15
"order": 16
}
}
},
Expand Down Expand Up @@ -297,11 +303,6 @@
"command": "tsperf.tracer.runTrace",
"category": "Tracer"
},
{
"title": "Send Trace to Trace Viewer",
"command": "tsperf.tracer.sendTrace",
"category": "Tracer"
},
{
"title": "Open tracer directory in terminal",
"command": "tsperf.tracer.openTerminal",
Expand All @@ -314,14 +315,7 @@
}
],
"menus": {
"commandPalette": [
{
"title": "Send Trace to Trace Viewer",
"when": "!notebookEditorFocused && editorLangId == 'json'",
"command": "tsperf.tracer.sendTrace",
"category": "Tracer"
}
],
"commandPalette": [],
"explorer/context": [
{
"title": "tsc trace",
Expand All @@ -332,12 +326,6 @@
"when": "resourceFilename =~ /./",
"command": "tsperf.tracer.runTrace",
"category": "Tracer"
},
{
"title": "Send Trace to Trace Viewer",
"when": "resourceFilename =~ /.*((trace)|(types)).*.json/",
"command": "tsperf.tracer.sendTrace",
"category": "Tracer"
}
]
}
Expand All @@ -346,12 +334,12 @@
"generate:contributes": "jiti ./scripts/generate-contributes.ts",
"generate:experimental": "TraceExperimental=true jiti ./scripts/generate-contributes.ts",
"pretest": "nr build && nr lint",
"build": "nr generate:contributes && nr srcDev:build && nr ui:build && rollup -c",
"build": "nr generate:contributes && nr ui:build && rollup -c",
"dev": "nr build --watch --sourcemap",
"server:build": "cd server && rollup -c",
"server:dev": "cd server && nr build --watch --sourcemap",
"ui:dev": "nuxt dev ui",
"ui:build": "nuxt build ui",
"srcDev:dev": "nr build --filter ./srcDev --watch --srcmap",
"srcDev:build": "cd srcDev && rollup -c && cd ..",
"lint": "eslint .",
"vscode:prepublish": "nr build",
"publish": "vsce publish --no-dependencies",
Expand All @@ -361,15 +349,20 @@
"release": "bumpp && git push"
},
"dependencies": {
"@vue/reactivity": "^3.4.27"
"@vue/reactivity": "^3.4.27",
"ws": "^8.17.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.19.1",
"@antfu/ni": "^0.21.12",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/d3": "^7.4.3",
"@types/node": "^20.12.12",
"@types/ts-expose-internals": "npm:[email protected]",
"@types/vscode": "1.70.0",
"@types/ws": "^8.5.10",
"@vscode/vsce": "^2.26.1",
"bumpp": "^9.4.1",
"d3": "^7.9.0",
Expand Down
3 changes: 3 additions & 0 deletions playground/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ type MultiLine = typeof multiLine | `
2
3
4`

const opts
= { path: '/socket.io/', agent: false, withCredentials: false, upgrade: true, timestampParam: 't', rememberUpgrade: false, addTrailingSlash: true, rejectUnauthorized: false, perMessageDeflate: { threshold: 1024 }, transportOptions: {}, closeOnBeforeunload: false, host: '127.0.0.1', port: '80', hostname: 'undefined', secure: false, query: { EIO: 4, transport: 'polling' }, socket: { binaryType: 'nodebuffer', writeBuffer: [], secure: false, hostname: 'undefined', port: '80', transports: ['polling', 'websocket', 'webtransport'], prevBufferLen: 0, opts: { path: '/socket.io/', agent: false, withCredentials: false, upgrade: true, timestampParam: 't', rememberUpgrade: false, addTrailingSlash: true, rejectUnauthorized: false, perMessageDeflate: { threshold: 1024 }, transportOptions: {}, closeOnBeforeunload: false, host: '127.0.0.1', port: '80', hostname: 'undefined', secure: false }, id: null, upgrades: null, pingInterval: null, pingTimeout: null, pingTimeoutTimer: null, readyState: 'opening' } }
Loading