Closed
Bug 1757401
Opened 3 years ago
Closed 3 years ago
Use new source object's thread attribute to simplify reducers
Categories
(DevTools :: Debugger, enhancement)
DevTools
Debugger
Tracking
(firefox99 fixed)
RESOLVED
FIXED
99 Branch
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Bug 1757375 just added a thread
attribute on all redux source objects.
This should help get rid of various selectors which were computing this data out of the source actors related to a the given source.
We can replace these couple of selectors with a simple attribute access!
export function getThreadForSource(state, sourceId) {
const actors = getSourceActorsForSource(
state,
isOriginalId(sourceId) ? originalToGeneratedId(sourceId) : sourceId
);
if (!actors || !actors.length) {
console.error(`Error no source actors exist for source ${sourceId}`);
return null;
}
return getThread(state, actors[0].thread);
}
const queryThreadsBySourceObject = makeReduceAllQuery(
actor => ({ thread: actor.thread, source: actor.source }),
actors =>
actors.reduce((acc, { source, thread }) => {
let sourceThreads = acc[source];
if (!sourceThreads) {
sourceThreads = [];
acc[source] = sourceThreads;
}
sourceThreads.push(thread);
return acc;
}, {})
);
// Used by threads selectors
export function getAllThreadsBySource(state) {
return queryThreadsBySourceObject(state.sourceActors);
}
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•3 years ago
|
||
Surprisingly, this patch doesn't trigger any improvement in DAMP:
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=876b11e2b43580b9c2132a007e1617330ec1b10a&originalSignature=3130994&newSignature=3130994&framework=12&originalRevision=929c91f244b5c939c2f0b99357ead3cd243e88d6&page=1&showOnlyConfident=1
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/10e5ac539c0d
[devtools] Simplify source selectors thanks to thread attribute on sources. r=bomsy
Comment 4•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox99:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•