Closed Bug 1692827 Opened 3 years ago Closed 3 years ago

Stop using "will-navigate" in the debugger

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 1 open bug)

Details

We should stop using navigate/will-navigate and instead use target-available/destroyed callbacks, or document-events. See meta bug 1632141.

The debugger is using will-navigate at https://searchfox.org/mozilla-central/rev/8cb90829ccf18f95cd75d8419c84729c754a8e83/devtools/client/debugger/src/actions/navigation.js#26

It triggers the following cleanup:

    sourceQueue.clear();
    sourceMaps.clearSourceMaps();
    clearWasmStates();
    clearDocuments();
    parser.clear();

And emits a NAVIGATE action, which is used to reset the state in many reducers:
https://searchfox.org/mozilla-central/search?q=case+%22NAVIGATE%22&path=&case=true&regexp=false.

(note: the debugger also uses the target's "navigate" event but this is not related to the NAVIGATE action).

We should try to use onTargetAvailable instead.

Suggested complexity: intermediate

Component: Framework → Debugger
Summary: Stop using will-navigate in the debugger → Stop using "will-navigate" in the debugger

Just remembered that we can't fully do any of that until all our frame targets are bound to the lifecycle of the window global.
In the meantime we still need to support old targets which persist after navigation reload.

Closing for now, I think the only actionable thing we could do for now is making sure we have tests covering the will-navigate codepath.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
Whiteboard: dt-fission-m3-triage
You need to log in before you can comment on or make changes to this bug.