The people working on wasm support desires the ability to load wasm sources in the debugger, which can be *huge*. We need to figure out how to support this use case, because while we've improved our handling of large files, users still have to wait a long time for very large files to be loaded. wasm files are going to be the largest ones we've ever seen, so CodeMirror might not even be able to handle it. We talked about a few ideas: * Load a "collapsed" version of the source, so you'd only see the function definitions, and could interactively expand them somehow. This would require good enough support from CodeMirror for doing this expansion. * Write our own simplistic editor that only requests parts of the source at a time (and would kick in for files >50MB or something). This would intentionally be simplistic: no syntax highlighting or fancy features. The scrollbar could be inaccurate (show what portion of the current slice is scrolled) or no scrollbar at all. I think those were the only 2 ideas. These are ordered by complexity. The downsides for creating our own editor is that it would end up being a lot of work I think, and users would inevitably complain about the lack of features and we'd slowly implement a whole editor. I'd also like to have a test case that we can benchmark against. Once we can load a wasm source in the editor, we should see just how bad CodeMirror is. From there we can see if there are any simpler options, i.e. features in CodeMirror that we can leverage. Maybe we can do the collapsed idea. And worst case, we can experiment with our own dumb editor.
mbx (+cc) said he dived into VS code's editor and that it was pretty good, maybe better at handling very large source files.
This is not something we're working on right now, but would like to look into in the near future. Therefore, I'm marking this as P2.
Created attachment 8816514 [details] Nightly_and_Air_Mozilla___Mozilla__in_Video.png It looks like Chrome might have found a way to do this. Attaching a screenshot.
Created attachment 8816567 [details] localhost_3000_and_1____Repos_rust-wasm-example_examples__bash__and_README_md__index__↔_README_md_-_rust-wasm-example.png
FWIW, wasm-debugger integration is ongoing in bug 1286948 (see also https://www.youtube.com/watch?v=R1WtBkMeGds). This bug is focused on just the (perf, UI) scalability problem of ginormous sources.