Add Internal loading Prop for Large Diffs
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.
+1 (just came back to the docs to see if this was already a thing, and then headed to issues next)
+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!
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
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.
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.
Hi @Aeolun,
Did you get a chance to look at my pull request?