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

feat: add basic network view, support experimental networking for node #2053

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Aug 8, 2024

This adds a basic network tree view that shows requests and responses
in the debugee. It has a default "go to" action which opens a cURL
representation of the request, and context menu actions to open the
response body either in a text editor or the hex editor. It also has
actions to copy the URL and replay the request.

I initially was hoping to turn this on by default for Node.js since
their networking support in 22.6.0 inspired this change, but their
functionality right now is very limited (we basically get the URL and
nothing else.) Therefore I added an option to turn it on, but it's not
on by default there.

I think I might end up toggling this off for the next stable release
for now until we can polish it some more, but it's ship it in nightly
to get some feedback!

Closes #2051

This adds a basic network tree view that shows requests and responses
in the debugee. It has a default "go to" action which opens a cURL
representation of the request, and context menu actions to open the
response body either in a text editor or the hex editor. It also has
actions to copy the URL and replay the request.

![](https://memes.peet.io/img/24-08-aa5f7f35-332f-4a60-9fbb-32ac79018b60.png)

I initially was hoping to turn this on by default for Node.js since
their networking support in 22.6.0 inspired this change, but their
functionality right now is very limited (we basically get the URL and
nothing else.) Therefore I added an option to turn it on, but it's not
on by default there.

I think I might end up toggling this off for the next stable release
for now until we can polish it some more, but it's ship it in nightly
to get some feedback!
@connor4312 connor4312 enabled auto-merge (squash) August 8, 2024 18:17
@vs-code-engineering vs-code-engineering bot added this to the August 2024 milestone Aug 8, 2024
@connor4312
Copy link
Member Author

build failure is a known flake that's on my todo

@connor4312 connor4312 merged commit 6e8a828 into main Aug 8, 2024
5 of 7 checks passed
@connor4312 connor4312 deleted the connor4312/networking-api branch August 8, 2024 18:45
@vish01
Copy link

vish01 commented Aug 15, 2024

How do I enable this feature? I installed latest nightly version but don't see "network" tab in there.

@connor4312
Copy link
Member Author

It's automatically available if the debug target supports networking

@vish01
Copy link

vish01 commented Aug 15, 2024

I am trying to debug an API call from a local VScode extension through debugger(which technically opens a new VScode window), is that supported?

@connor4312
Copy link
Member Author

VS Code extensions run in the extension host which is not on Node >=22.6 where networking support is available.

@vish01
Copy link

vish01 commented Aug 15, 2024

Hmm I see, is that something I can update for my extension and upgrade node to >=22.6 or extension host node version needs to be upgraded by you guys?

@connor4312
Copy link
Member Author

The extension host's node is bundled with VS Code and isn't upgradable by users. And as I mentioned in the PR the network support Node added in 22.6 is very preliminary and not incredibly useful at the moment, so it'll be a minute.

This works for browsers however.

@gabrieldomgen
Copy link

gabrieldomgen commented Nov 7, 2024

Hi @connor4312 - I've tried that in the nightly build (I know it's not useful atm but wanted to check it out)

I have experimentalNetworking set as on in my launch.json - and it does add the correctly flag to node, but I'm just not seeing the network panel nor any of the commands related to it. Running on node 22.9

Any ideas on what it could be?

@connor4312
Copy link
Member Author

You'll want to also enable the VS Code setting debug.javascript.enableNetworkView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support network inspection
4 participants