Closed julienw closed 2 months ago
Name | Link |
---|---|
Latest commit | fb783d1df807b018d48c01934ca0bb34cb095185 |
Latest deploy log | https://app.netlify.com/sites/mozilla-perfcompare/deploys/66ace84a45513100093e2505 |
Deploy Preview | https://deploy-preview-700--mozilla-perfcompare.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Ah the tests are failing, weird because I tested locally... let me fix that. Update: Should be fixed now
Attention: Patch coverage is 93.75000%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 82.84%. Comparing base (
2248e6d
) to head (fb783d1
).
Files | Patch % | Lines |
---|---|---|
src/components/CompareResults/RevisionRow.tsx | 88.88% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@julienw
"From the react profiler, I found that it's rerendered because "context changed", that is the context from react router."
Do you mind showing how you found that in the react profiler? I want to get better at reading profiles in general :P
@julienw
"From the react profiler, I found that it's rerendered because "context changed", that is the context from react router."
Do you mind showing how you found that in the react profiler? I want to get better at reading profiles in general :P
When you look at a recording in the react profiler, you see all the individual renders in the top right rectangle. You can click on one of them. On the view below, all the colored item are the ones that rendered during that render cycle. By hovering them, the profiler tells you why they were rendered: props changed, state changed, context changed, parent rendered, etc. Sometimes you can get some more information (for props I think we know which props have changed), but for contexts not much. So then this requires some digging in the component itself, to guess what might use a context.
That's about it!
Thanks beatrice for the review!
This issue is especially visible when changing the framework... but only after removing the
reloadDocument
property, which I'm not doing in this deploy preview, so you won't be able to check this from the deploy preview. You can checkout the pull request locally and removereloadDocument
to check for yourself.The issue is that the table is rerendered again even though nothing changed yet. From the react profiler, I found that it's rerendered because "context changed", that is the context from react router. This happens when using
useLoaderData
(see the issue I filed in https://github.com/remix-run/react-router/issues/11864).So I fixed this through 2 commits:
Await
so thatResultsTable
can be a memoized component. IndeedResultsMain
gets the spurious rerender because of its use ofuseLoaderData
.useLoaderData
inRevisionRow
, and more work was needed here. Maybe this could be reverted if https://github.com/remix-run/react-router/issues/11864 is fixed later...