react-diff-viewer-continued icon indicating copy to clipboard operation
react-diff-viewer-continued copied to clipboard

Add Internal loading Prop for Large Diffs

Open bpetii opened this issue 8 months ago • 6 comments

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.

bpetii avatar Apr 01 '25 08:04 bpetii

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

reinrl avatar Apr 21 '25 14:04 reinrl

+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!

yangzi0210 avatar Apr 27 '25 06:04 yangzi0210

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!

puneet-goel avatar Apr 27 '25 07:04 puneet-goel

@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.

Aeolun avatar May 12 '25 05:05 Aeolun

Hi @Aeolun,

Please review my Pull request: https://github.com/Aeolun/react-diff-viewer-continued/pull/71 Let me know if I need to change something.

puneet-goel avatar May 17 '25 17:05 puneet-goel

Hi @Aeolun,

Did you get a chance to look at my pull request?

puneet-goel avatar Jul 12 '25 12:07 puneet-goel