debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[breakpoints] refactor the breakpoint domain

Open nyrosmith opened this issue 9 years ago • 8 comments

I think there are some things missnamed inside the breakpoint domain which can lead to confusion. Personally I had a really hard time finding out what the source code really is doing.

Some examples: ToggleBreakpoint : it doesn't toggle anything but adds / removes breakpoints pendingBreakpoint could be named "persisted breakpoint" to be more concrete.

I also think that an action which adds a breakpoint if it not exists or adds/edits/removes the condition of a breakpoint is not really predictable and could cause lots of headache in the future.

How do you think about this @codehag @jasonLaster

nyrosmith avatar Oct 02 '17 15:10 nyrosmith

/claim

nyrosmith avatar Oct 06 '17 15:10 nyrosmith

Thanks for claiming the issue! :wave:

Here are some link for getting setup, contributing, and development tips. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Oct 06 '17 15:10 claim

I talked to @jasonLaster and I'll start with that because it's a great opportunity to get a better understanding of the code base

nyrosmith avatar Oct 06 '17 15:10 nyrosmith

Hey, @nyrosmith still interested in this? It's a tough one because we're still trying to figure out what the right refactor is.

jasonLaster avatar Oct 27 '17 21:10 jasonLaster

@jasonLaster true so let's close this until we figured out how we want to habe it

nyrosmith avatar Oct 31 '17 15:10 nyrosmith

Re-opening with a proposal for toggling breakpoints. We currently have a couple toggle actions and they're not very clear. I think it would be nice to:

  1. move them into their own module
  2. add some docs and simpler names
  3. add jest tests around the code branches. (no bp, bp disabled, ...)

Here is a branch with my proposal! https://github.com/devtools-html/debugger.html/compare/master...jasonLaster:toggle?expand=1

jasonLaster avatar Nov 29 '17 00:11 jasonLaster

here is another similar refactor for some other actions https://gist.github.com/jasonLaster/0a3d9231e03a38c9e983023f85b9e305

jasonLaster avatar Jun 27 '18 19:06 jasonLaster

closing as this is not a priority. We can always send people here if they are looking for a refactor/code health project

jasonLaster avatar Aug 03 '18 14:08 jasonLaster