Skip to content

Add Internal loading Prop for Large Diffs #66

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

Open
bpetii opened this issue Apr 1, 2025 · 5 comments
Open

Add Internal loading Prop for Large Diffs #66

bpetii opened this issue Apr 1, 2025 · 5 comments

Comments

@bpetii
Copy link

bpetii commented Apr 1, 2025

Problem Statement
When handling large diffs, react-diff-viewer-continued can cause some performance issues, leading to UI freezing while parsing large inputs.

Proposed Solution
Introduce an internal loading prop that allows developers to customize the loading state when rendering large diffs. This could be implemented as:

A customizable loadingText prop to render a custom loader.

@reinrl
Copy link

reinrl commented Apr 21, 2025

+1 (just came back to the docs to see if this was already a thing, and then headed to issues next)

@yangzi0210
Copy link

yangzi0210 commented Apr 27, 2025

+1 @Aeolun
This is very important. When it exceeds 1k lines, there will be some lag. Using a loading state can easily but effectively solve this problem.
If you could help, I would greatly appreciate it!

@puneet-goel
Copy link

Hi @Aeolun ,

I'd love to help with this! Could you please assign this issue to me?

I can start working on implementing the loadingText prop, and I also have another approach in mind — using a virtualized window to render only the content currently visible in the user's viewport. This would significantly optimize the rendering performance.

Thanks a lot!

@Aeolun
Copy link
Owner

Aeolun commented May 12, 2025

@puneet-goel

I can start working on implementing the loadingText prop, and I also have another approach in mind — using a virtualized window to render only the content currently visible in the user's viewport. This would significantly optimize the rendering performance.

If you do want to do that, please go ahead. I don't currently have time to do so, but would be happy to merge it.

I don't think a loading prop will help since the UI will just freeze the moment the loading prop disappears. I guess in most cases you wouldn't even see it.

@puneet-goel
Copy link

Hi @Aeolun,

Please review my Pull request: #71
Let me know if I need to change something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants