Skip to content

Migrate to Debugger.setBreakpointByUrl #1076

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

Closed
grouma opened this issue Jul 22, 2020 · 2 comments · Fixed by #1078
Closed

Migrate to Debugger.setBreakpointByUrl #1076

grouma opened this issue Jul 22, 2020 · 2 comments · Fixed by #1078

Comments

@grouma
Copy link
Member

grouma commented Jul 22, 2020

We currently set breakpoints by script ID. This has a number of drawbacks, especially around re-establishing breakpoints. There is an API to set breakpoints by URL. This API has the benefit of persisting across reloads.

Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

@natebosch
Copy link
Member

Would the URL point into the .js file or would it consider a source map? What happens if the JS code is shifted around in the reload, does that cause any issues?

@grouma
Copy link
Member Author

grouma commented Jul 28, 2020

The URL would point to the containing module of the Dart file which would be a .js file. If the code get's shifted around we would have the same issue as Chrome does today which sets breakpoints as a per line basis.

grouma added a commit that referenced this issue Aug 3, 2020
- Use `setBreakpointsByUrl` to set breakpoints using a regex based on the module path
- Chrome now handles re-establishing breakpoints upon refresh so remove the corresponding deprecated argument

Closes #1076
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 a pull request may close this issue.

2 participants