Skip to content

Commit

Permalink
Bug 1824705 - [devtools] Add support for sourcemaps ignore list r=dev…
Browse files Browse the repository at this point in the history
…tools-reviewers,nchevobbe

Also there is a patch to add support for ignoreList to the sourcemap library
mozilla/source-map#481

Differential Revision: https://phabricator.services.mozilla.com/D174357

UltraBlame original commit: b9d5882be65c92031cbabee86baac1a52e018246
  • Loading branch information
marco-c committed May 31, 2023
1 parent ed9662e commit df814df
Show file tree
Hide file tree
Showing 30 changed files with 1,271 additions and 55 deletions.
33 changes: 29 additions & 4 deletions devtools/client/debugger/src/actions/breakpoints/modify.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ getBreakpointsList
getPendingBreakpointList
isMapScopesEnabled
getBlackBoxRanges
isSourceMapIgnoreListEnabled
isSourceOnSourceMapIgnoreList
}
from
"
Expand Down Expand Up @@ -653,13 +655,18 @@ client
thunkArgs
;
const
breakpoint
state
=
getBreakpoint
(
getState
(
)
;
const
breakpoint
=
getBreakpoint
(
state
initialBreakpoint
.
location
Expand All @@ -670,9 +677,26 @@ blackboxedRanges
=
getBlackBoxRanges
(
getState
state
)
;
const
isSourceOnIgnoreList
=
isSourceMapIgnoreListEnabled
(
state
)
&
&
isSourceOnSourceMapIgnoreList
(
state
breakpoint
.
location
.
source
)
;
if
Expand Down Expand Up @@ -704,6 +728,7 @@ breakpoint
location
.
line
isSourceOnIgnoreList
)
)
{
Expand Down
7 changes: 4 additions & 3 deletions devtools/client/debugger/src/actions/sources/blackbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ from
selectors
"
;
export
async
function
_blackboxSourceActorsForSource
blackboxSourceActorsForSource
(
thunkArgs
source
Expand Down Expand Up @@ -579,7 +580,7 @@ source
)
;
await
_blackboxSourceActorsForSource
blackboxSourceActorsForSource
(
thunkArgs
source
Expand Down Expand Up @@ -1182,7 +1183,7 @@ sources
)
{
await
_blackboxSourceActorsForSource
blackboxSourceActorsForSource
(
thunkArgs
source
Expand Down
69 changes: 69 additions & 0 deletions devtools/client/debugger/src/actions/sources/newSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ sources
/
import
{
PROMISE
}
from
"
.
.
/
utils
/
middleware
/
promise
"
;
import
{
insertSourceActors
}
from
Expand Down Expand Up @@ -163,6 +179,18 @@ prettyPrint
;
import
{
toggleSourceMapIgnoreList
}
from
"
.
.
/
ui
"
;
import
{
selectLocation
setBreakableLines
}
Expand Down Expand Up @@ -588,6 +616,29 @@ wasm
}
)
;
dispatch
(
{
type
:
"
ADD_SOURCEMAP_IGNORE_LIST_SOURCES
"
[
PROMISE
]
:
sourceMapLoader
.
getSourceMapIgnoreList
(
source
.
id
)
}
)
;
}
}
catch
Expand Down Expand Up @@ -1081,6 +1132,24 @@ ranges
;
}
}
if
(
prefs
.
sourceMapIgnoreListEnabled
)
{
await
dispatch
(
toggleSourceMapIgnoreList
(
cx
true
)
)
;
}
}
;
}
Expand Down
146 changes: 146 additions & 0 deletions devtools/client/debugger/src/actions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ getQuickOpenEnabled
getSource
getSourceContent
getMainThread
getIgnoreListSourceUrls
getSourceByURL
getBreakpointsForSource
}
from
"
Expand Down Expand Up @@ -109,6 +112,30 @@ editor
;
import
{
blackboxSourceActorsForSource
}
from
"
.
/
sources
/
blackbox
"
;
import
{
toggleBreakpoints
}
from
"
.
/
breakpoints
"
;
import
{
copyToTheClipboard
}
from
Expand Down Expand Up @@ -1134,3 +1161,122 @@ shouldHide
}
;
}
export
function
toggleSourceMapIgnoreList
(
cx
shouldEnable
)
{
return
async
thunkArgs
=
>
{
const
{
dispatch
getState
}
=
thunkArgs
;
const
ignoreListSourceUrls
=
getIgnoreListSourceUrls
(
getState
(
)
)
;
/
/
Blackbox
the
source
actors
on
the
server
for
(
const
url
of
ignoreListSourceUrls
)
{
const
source
=
getSourceByURL
(
getState
(
)
url
)
;
await
blackboxSourceActorsForSource
(
thunkArgs
source
shouldEnable
)
;
/
/
Disable
breakpoints
in
sources
on
the
ignore
list
const
breakpoints
=
getBreakpointsForSource
(
getState
(
)
source
.
id
)
;
await
dispatch
(
toggleBreakpoints
(
cx
shouldEnable
breakpoints
)
)
;
}
await
dispatch
(
{
type
:
"
ENABLE_SOURCEMAP_IGNORELIST
"
shouldEnable
}
)
;
}
;
}

0 comments on commit df814df

Please sign in to comment.