You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you click on the filename on the left, to look at diff, and if the diff is really large (for example, compiled javascript bundle) the application will freeze for 30-60 seconds.
@mib32 to reproduce this locally, could you give an idea of how many lines are in the diff output? If you can give a snapshot of the app at this point I can give you the command to run so I can get an idea of how big the diff is...
@benrondeau I retested this and the issue is still the same. I'm looking into alternative editors but that's going to take time to evaluate accurately due to all the integration we rely on in Codemirror.
If the issue with Codemirror cannot be mitigated quickly, can you add a conditional in the source code which only render certain file sizes (>1mb) or types (.map) if the user wants? This would leave the functionality intact while resolving the UI rendering block
Yup, as @j-f1 noted I hope the other heuristic will catch minified files. But they are pretty arbitrary, so if it doesn't, let us know and we'll adjust them!
We had some chats with the Atom team about this early in development, and experimented with extracting the relevant bits, but things were too tightly coupled to the rest of the codebase for us to do it in a sane way. But that was ~1yr ago, maybe it's more reusable now?
Highlight → Split by \n → Render to <DiffLine /> component → Put in groups of n in <DiffChunk /> components in a <List /> (where n is high enough so that the list doesn’t have to manage thousands of elements, but small enough that there won’t be a massive blank space at the bottom of the diff)
Activity
shiftkey commentedon May 22, 2017
@mib32 to reproduce this locally, could you give an idea of how many lines are in the diff output? If you can give a snapshot of the app at this point I can give you the command to run so I can get an idea of how big the diff is...
mib32 commentedon May 22, 2017
@shiftkey It is a big single line file with size of

5656581bytes, that was deleted - so the diff also5656581bytes big.shiftkey commentedon May 22, 2017
@mib32 could you open the repository in the terminal, run this command and tell me how many lines it is?
I think I've got that path right.
mib32 commentedon May 22, 2017
@shiftkey There's just 8 lines.
shiftkey commentedon May 22, 2017
@mib32 of course, because it's a sourcemap file 🤦♂️
Anyway, that gives me enough to dig into.
shiftkey commentedon May 30, 2017
Looks like we spend a lot of time in
updateHeightsInViewport.Particularly this line?
veeramarni commentedon Jun 5, 2017
Is it because of using codemirror?
benrondeau commentedon Aug 31, 2017
Any update on a solution? Thanks
shiftkey commentedon Aug 31, 2017
@benrondeau I retested this and the issue is still the same. I'm looking into alternative editors but that's going to take time to evaluate accurately due to all the integration we rely on in Codemirror.
benrondeau commentedon Aug 31, 2017
If the issue with Codemirror cannot be mitigated quickly, can you add a conditional in the source code which only render certain file sizes (>1mb) or types (.map) if the user wants? This would leave the functionality intact while resolving the UI rendering block
shiftkey commentedon Aug 31, 2017
@benrondeau I've moved that suggestion over to #2596 to discuss further alongside tracking this issue
8 remaining items
joshaber commentedon Oct 23, 2017
Yup, as @j-f1 noted I hope the other heuristic will catch minified files. But they are pretty arbitrary, so if it doesn't, let us know and we'll adjust them!
benrondeau commentedon Oct 23, 2017
Thanks!
mib32 commentedon Nov 26, 2017
Why aren't we using Atom.
shiftkey commentedon Nov 26, 2017
We had some chats with the Atom team about this early in development, and experimented with extracting the relevant bits, but things were too tightly coupled to the rest of the codebase for us to do it in a sane way. But that was ~1yr ago, maybe it's more reusable now?
mourner commentedon Nov 26, 2017
But why use an editor component in the first place? Any comment on this? The diff is read only after all, and diff color highlighting is very simple.
j-f1 commentedon Nov 26, 2017
Highlight → Split by
\n→ Render to<DiffLine />component → Put in groups of n in<DiffChunk />components in a<List />(where n is high enough so that the list doesn’t have to manage thousands of elements, but small enough that there won’t be a massive blank space at the bottom of the diff)shiftkey commentedon Nov 26, 2017
We get a lot of stuff for free from using Codemirror:
I'm not opposed to improvements around this area, but please keep in mind what is currently supported.
mourner commentedon Nov 26, 2017
@shiftkey CodeMirror seems like a huge overkill for those things, so there's a nice room for improvement here.
shiftkey commentedon Nov 26, 2017
@mourner is this something you're interested in contributing to?
mourner commentedon Nov 26, 2017
Maybe some day. :) I realize this might be a much bigger chunk of work than it seems, just wanted to capture a possible solution in comments.
joshaber commentedon Nov 27, 2017
CodeMirror also gives us soft wrapping and a path forward if/when we wanna add inline editing (e.g., resolving merge conflicts).
I'm not thrilled with CodeMirror either, but I haven't seen an alternative that addresses all our use cases yet.