Stop using context in React components where it isn't relevant
Categories
(DevTools :: Debugger, task)
Tracking
(firefox116 fixed)
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(4 files, 3 obsolete files)
In some places, we are setting a context properties but that's unused.
In some other places, we pass a context, but the action isn't specific to a given page so we shouldn't do any context assertion (example project root).
Last but not least in many places we use context to cancel dispatching some actions if the React component migrated to a new context. But instead we could more simply check if the input argument is still valid. For example when selecting thread/frame we could check if it is still in the redux store... and valid.
Assignee | ||
Comment 1•11 months ago
|
||
This data isn't related to a particular thread.
We assume that the project directory root works across reload.
Also clarify that project root data is a SourceTreeItem uniquePath.
Updated•11 months ago
|
Assignee | ||
Comment 2•11 months ago
|
||
Assignee | ||
Comment 3•11 months ago
|
||
This action doesn't really benefit from context assertions.
Instead we could only verify that the to-be-selected thread still exists.
In order to do that, the pause reducer now store the list of active threads.
Stop trying to select the top thread on startup early as the related target/thread
isn't registered yet.
Assignee | ||
Comment 4•11 months ago
|
||
When adding, updating and deleting expressions, this is rather like a UI action
and isn't contextual to a given page. We shouldn't try to stop these actions.
Also move "deleteExpression" to non-thunk action and make "getMappedExpression"
an utility function instead of an action as it doesn't dispatch any nested action.
Update some jsdoc and simplify "addExpression".
Assignee | ||
Updated•11 months ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e5b0a42b554 [devtools] Stop using context for project root actions. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/ab974ebe59e5 [devtools] Remove unused context variables. r=devtools-reviewers,bomsy
Comment 6•11 months ago
|
||
bugherder |
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4651551a6ca0 [devtools] Stop using context for select thread action. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/efd8b9a86eb6 [devtools] Stop passing context for expression actions which shouldn't be cancelled. r=devtools-reviewers,bomsy
Comment 8•11 months ago
|
||
bugherder |
Assignee | ||
Comment 9•11 months ago
|
||
All these three actions aren't related to any thread/source and shouldn't be cancelled.
Assignee | ||
Comment 10•11 months ago
|
||
This is no longer an action but a custom method on Preview/index.js.
Also fix the missing clearPreview method passed manually from Popup to ExceptionPopup.
Assignee | ||
Comment 11•11 months ago
|
||
These are rather a UI actions which shouldn't be dismissed.
Assignee | ||
Comment 12•11 months ago
|
||
Let me open a cloned bug for the other patches as the merge day get closer.
Comment 13•11 months ago
|
||
Comment on attachment 9341628 [details]
Bug 1839191 - [devtools] Stop using context for selectSourceURL, setPendingSelectedLocation and clearSelectedLocation.
Revision D182407 was moved to bug 1841041. Setting attachment 9341628 [details] to obsolete.
Comment 14•11 months ago
|
||
Comment on attachment 9341629 [details]
Bug 1839191 - [devtools] Remove useless cx argument passed to clearPreview.
Revision D182408 was moved to bug 1841041. Setting attachment 9341629 [details] to obsolete.
Comment 15•11 months ago
|
||
Comment on attachment 9341630 [details]
Bug 1839191 - [devtools] Remove context from removeAllBreakpoints and toggleSourceMapIgnoreList actions.
Revision D182409 was moved to bug 1841041. Setting attachment 9341630 [details] to obsolete.
Description
•