Not planned
Description
The scheduling profiler currently shows "unsupported version" message if you import a performance trace with no marks.
It incorrectly assumes the lack of an explicit version mark indicates an earlier version of the data which didn't include marks, but in the event that there are no marks at all we should infer that a production version of React DOM was being used instead and show a different error.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
byronluk commentedon Aug 21, 2021
Hi @bvaughn, mind if I pick this up?
bvaughn commentedon Aug 21, 2021
Sure thing, @byronluk.
byronluk commentedon Aug 21, 2021
Thanks!
Regarding your comment-
do you mean no marks that were generated by React? (just want to double check since I'm not too familiar with the devtools profiling 😅).
If so, I'm thinking the best way to check for this is to see if any React-related profiling data was generated in
profilerData
-react/packages/react-devtools-scheduling-profiler/src/import-worker/preprocessData.js
Line 853 in f51579f
Specifically checking if any these fields were populated -
batchUIDToMeasuresMap
,componentMeasures
,schedulingEvents
,suspenseEvents
.Does this sound like a sound approach?
bvaughn commentedon Aug 22, 2021
Yes. So a browser performance trace was recorded from a site running the React production bundle (no profiling features enabled) or even a website that wasn't using React at all.
Sure.
Realistically it's probably sufficient to check
schedulingEvents.length > 0
andlaneToReactMeasureMap.size > 0
. Seems highly unlikely that a valid profile wouldn't contain at least some of those.byronluk commentedon Aug 23, 2021
Thanks for the guidance!
Since
laneToReactMeasureMap
gets pre-initialized with values here:react/packages/react-devtools-scheduling-profiler/src/import-worker/preprocessData.js
Lines 848 to 851 in 045156c
I ended up checking
batchUIDToMeasuresMap
instead. It was simpler this way and I figured it has the same effect since both maps end up being populated under the same scenario in themarkWorkStarted
function:react/packages/react-devtools-scheduling-profiler/src/import-worker/preprocessData.js
Lines 154 to 167 in 045156c
Hopefully that's okay. I submitted a PR here: #22157
bvaughn commentedon Aug 23, 2021
Good call
stale commentedon Jan 9, 2022
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
github-actions commentedon Apr 10, 2024
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!