-
Notifications
You must be signed in to change notification settings - Fork 334
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
Render more while reloading only some resources #2480
Render more while reloading only some resources #2480
Conversation
`componentDidMount` is called after the first render. A lot of components used it to call `setState`, which causes a second render.
Not sure why this wasn't the case without this change. The only difference here is that the same array is reused in every render.
These used to (mostly) arrive at the old already unmounted components. Now they would render briefly until the latest response is received.
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.
This is a massive improvement to UX. I need clarification on some changes, but otherwise this is great.
return ( | ||
this.state.ellipses || ( | ||
<span dangerouslySetInnerHTML={{ __html: " " }} /> | ||
) | ||
); |
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.
Why the space is ellipses doesn't exist? And why use dangerouslySetInnerHTML
for this?
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.
Modlog title collapses when it cycles to the empty string
Looks like <span> </span>
does work. Thought i tried that. I'm moving it to modlog directly.
@@ -64,7 +65,7 @@ export function SubscribeButton({ | |||
> | |||
{I18NextService.i18n.t("subscribe")} | |||
</button> | |||
<RemoteFetchModal communityActorId={actor_id} /> | |||
<RemoteFetchModal show={false} communityActorId={actor_id} /> |
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.
Why is show
hard-coded to false?
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.
Going to make it optional in modalMixin
.
@matc-pub would you be willing to help with lemmy-ui PRs, and be a codeowner? It'd be much appreciated. |
I can give it a try. |
This change can keep components mounted when the next URL matches the current
route. This allows components to keep rendering some resources while reloading
others.
Commit ff5a391 contains most of the markup changes without running prettier, the follow up commit is only running prettier.
Changes
Home, Community
Post
/post/:post_id/:comment_id?
(/comment/:comment_id
still works)Search
Modlog
Profile
Spinners
Prompt
Inbox
Other changes