-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: Streamline loading replays for hydration diffs in Issue Details #88028
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
function wrapInSection(render: () => ReactNode) { | ||
return function () { | ||
return ( | ||
<InterimSection | ||
type={SectionKey.HYDRATION_DIFF} | ||
title={t('Hydration Error Diff')} | ||
> | ||
{render()} | ||
</InterimSection> | ||
); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just pull this out into a component with children?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scttcper it gets formatted out to more line if it's a React component :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that seems fine
return ( | ||
<Fragment> | ||
{input} | ||
{render(replaySlug)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo it's kind of confusing to have two different rendering methods in this component -- I don't really know how they're used but what if they were two components ReplaySlugChooser and ReplaySlugChooserWithLoaderStuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll pass back over this chooser and clean it up.
it's used by some /stories/
files so people can load up real reply data and see the video components working together, so the two interfaces kind of optimize for keeping the stories readable right now.
…88028) Before we had two 'placeholder' thing that would render while we wait for the hydration diff preview to load up: - A `<LoadingIndicator />` while we're lazy-loading the `replayDiffContent.tsx` file - Then `<Placeholder/>` while we load the replay data over ajax This resulted in janky loading swapping one placeholder for another. Also, we weren't properly handling all loading states before, so if the replay was missing or archived it looked janky. Now that `<ReplayLoadingState>` is in place, all cases are handled. For example: | Before | After | | --- | --- | | <img width="846" alt="SCR-20250326-mjkc" src="https://github.com/user-attachments/assets/68053fcf-5a2d-44aa-850f-f85255e5526e" /> | <img width="841" alt="SCR-20250326-mjmr" src="https://github.com/user-attachments/assets/c7ffbbcc-9193-46ea-8f37-1df3e4245dac" /> | Along the way i changed the interface to the new `<ReplayLoadingState>`. Now it takes the result of `useLoadReplayReader` as a prop. This will make it possible to separate loading and rendering, so we can deal with logging that sometimes happens, or in the case of Traces, the loading happens very far away and props get drilled down.
Before we had two 'placeholder' thing that would render while we wait for the hydration diff preview to load up:
<LoadingIndicator />
while we're lazy-loading thereplayDiffContent.tsx
file<Placeholder/>
while we load the replay data over ajaxThis resulted in janky loading swapping one placeholder for another.
Also, we weren't properly handling all loading states before, so if the replay was missing or archived it looked janky. Now that
<ReplayLoadingState>
is in place, all cases are handled. For example:Along the way i changed the interface to the new
<ReplayLoadingState>
. Now it takes the result ofuseLoadReplayReader
as a prop. This will make it possible to separate loading and rendering, so we can deal with logging that sometimes happens, or in the case of Traces, the loading happens very far away and props get drilled down.