The new GitHub Code View brings users many new features to improve the code reading and exploration experiences, and we overcame a number of unique technical hurdles in order to deliver those features without compromising performance.
This should be required reading for anyone who thinks that frontend is easy.
Also, if anyone thinks this is a limitation of the web, I’d challenge you to try to create an app that displays 18,000 lines of syntax-highlighted, findable text using another popular toolkit like .NET, Qt, or Cocoa. They’ll all get bogged down if you try to naively put all of that content in a single view and expect built-in scrolling and find features to just work, quickly. Pretty much the only way to make something like that work involves a lot of tricks behind the scenes, no matter what platform.
I’m really happy they landed on a solution that not only delivers high performance, but supports the browser’s native Find function and accessibility. I think some people could have anticipated those problems, but far more important is that they listened to user feedback and pivoted when their first idea didn’t make users happy.
I’d challenge you to try to create an app that displays 18,000 lines of syntax-highlighted, findable text using another popular toolkit like .NET, Qt, or Cocoa
I can’t speak for .NET or Qt, but in “Cocoa” (AppKit is the proper name) it’s not difficult at all. I’ve done it.
Mind you if you want syntax highlighting with editable text… and good performance… yeah that’s hard. GitHub hasn’t tackled that though. They have syntax highlighting in their editor but it’s a terrible implementation.
But yeah, HTML/JavaScript is an entirely different beast especially when you need to target multiple browsers and not just Electron. This is some seriously impressive work by the GitHub team. I do wonder though, if their effort might’ve been better spent by integrating https://vscode.dev into their code editor/viewer.
This should be required reading for anyone who thinks that frontend is easy.
Also, if anyone thinks this is a limitation of the web, I’d challenge you to try to create an app that displays 18,000 lines of syntax-highlighted, findable text using another popular toolkit like .NET, Qt, or Cocoa. They’ll all get bogged down if you try to naively put all of that content in a single view and expect built-in scrolling and find features to just work, quickly. Pretty much the only way to make something like that work involves a lot of tricks behind the scenes, no matter what platform.
I’m really happy they landed on a solution that not only delivers high performance, but supports the browser’s native Find function and accessibility. I think some people could have anticipated those problems, but far more important is that they listened to user feedback and pivoted when their first idea didn’t make users happy.
I can’t speak for .NET or Qt, but in “Cocoa” (AppKit is the proper name) it’s not difficult at all. I’ve done it.
Mind you if you want syntax highlighting with editable text… and good performance… yeah that’s hard. GitHub hasn’t tackled that though. They have syntax highlighting in their editor but it’s a terrible implementation.
But yeah, HTML/JavaScript is an entirely different beast especially when you need to target multiple browsers and not just Electron. This is some seriously impressive work by the GitHub team. I do wonder though, if their effort might’ve been better spent by integrating https://vscode.dev into their code editor/viewer.