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

Test js-debug names support #125018

Closed
2 tasks done
connor4312 opened this issue Jun 1, 2021 · 1 comment
Closed
2 tasks done

Test js-debug names support #125018

connor4312 opened this issue Jun 1, 2021 · 1 comment
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues testplan-item
Milestone

Comments

@connor4312
Copy link
Member

connor4312 commented Jun 1, 2021

Refs: #12066

Complexity: 3

Create Issue


Identifiers in JavaScript can be renamed during compilation. We now support dealing with these renames, provided the tool emits them correctly:

  1. Use nightly (stable coming in a day or two)
  2. Compile or minify some code that can rename and remap names (you can check this since there should be a non-empty "names" array in the sourcemap). Terser is one tool that works, here's an example of a command for it.
  3. Debug it. You should be able to use renamed variables by the original name in:
    • The variables view (it should show variables' original name), including the "copy" context menu action
    • The Watch view
    • The Debug Console/repl

There are some caveats:

  • If you test with a minifier, these will often reuse renames between scope. We don't deal with this.
  • This is not supported in breakpoint conditions or logpoints (since we don't statically know what scope they will be hit in until it happens)
@connor4312 connor4312 added this to the May 2021 milestone Jun 1, 2021
@ghost ghost assigned weinand and bamurtaugh Jun 1, 2021
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jun 1, 2021
@weinand
Copy link
Contributor

weinand commented Jun 1, 2021

@connor4312 js-debug's support for "name" mapping is very cool!

And it works for hovers and inline values too:

2021-06-01_16-22-38

@weinand weinand removed their assignment Jun 1, 2021
@bamurtaugh bamurtaugh removed their assignment Jun 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues testplan-item
Projects
None yet
Development

No branches or pull requests

3 participants