Skip to content

Commit a5f787f

Browse files
committed
refactor: inspect/debugging as useInspector
This PR rewrites the logic for establishing a connection with the debugging socket, and adds some enhancements along the way. Part of solving #188. Some highlights - - I've installed `"devtools-protocol`, a convenient package that has the static types for the devtools protocol (duh) autogenerated from chrome's devtools codebase. - We now log messages and exceptions into the terminal directly, so you don't have to open devtools to see those messages. - Messages are now buffered until a devtools instance connects, so you won't lose any messages while devtools isn't connected. - We don't lose the connection on making changes to the worker, removing the need for the kludgy hack on the devtools side (where we refresh the whole page when there's a change) Some things that I still have to do, and will do so in followup PRs - - clear the console whenever we make a change to the worker - stay connected when we shift between local/remote mode - eventually, move to using the devtools hosted at cloudflareworkers.com.
1 parent 19d3833 commit a5f787f

File tree

5 files changed

+549
-481
lines changed

5 files changed

+549
-481
lines changed

package-lock.json

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/wrangler/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"chokidar": "^3.5.2",
6060
"clipboardy": "^3.0.0",
6161
"command-exists": "^1.2.9",
62+
"devtools-protocol": "^0.0.955664",
6263
"execa": "^6.0.0",
6364
"faye-websocket": "^0.11.4",
6465
"finalhandler": "^1.1.2",

0 commit comments

Comments
 (0)