Open sspickle opened 10 months ago
Where the editor is being interacted with seems to be in apiGet() function. Which loads in the ACE editor for the computer and the GSedit for mobile (Which I have no idea what or where that is coming from.).
apiGet({ if (Mobile device) { var editor = GSedit } else // Not mobile { var editor = ace.edit(page.find(".program-editor").get(0)); // A bunch of customization for the ACE editor like style, mode, etc. }})
Also here is public replit where I put comments on most lines to try and understand what was happening. You can see if it helps you guys understand it better, you can also edit it if you want if there is something I missed. The code is in the src/App.jsx.
Good work Ethan!
The mobile editor implementation is here:
The non-mobile editor implementation is described here:
Of course Monaco is described here:
https://microsoft.github.io/monaco-editor/
The apiGet
function is implemented here:
It's a little bit like the built-in fetch
function we used in project 6, except that rather than returning a promise it accepts a callback function as a second argument as you describe.
You can see where it's switching between the non-mobile and mobile editor implementation here:
Maybe we could set up a replit or a testing repo that could contain a skeleton implementation that you could use to familiarize yourselves with the monaco editor's configuration? Would that help?
Remember that there is also an older svelte-kit implementation of a WASM based WebVPython editor/runner here that you can consult when designing the Monaco integration. This uses typescript and svelte-kit, so it's certainly not a copy/paste situation, but you can still learn a lot from this example.
Most of the interaction happens here
This issue is to read this code, identify what's going on, and formulate a plan to replace the editor with Monaco.