The CircuitPython Code Editor's USB mode is the most recent mode to be added. It was originally written to use Chrome's File System API to allow direct manipulation of files on a microcontrollers USB CIRCUITPY drive. This worked well for the most part, but there were boards that didn't have native USB ports and thus didn't have a CIRCUITPY drive, such as the Adafruit HUZZAH32, an ESP32-based development board.
Taking a cue from other code editors such as Thonny that allow file manipulation through the REPL, the Code Editor was recently expanded to include similar functionality. For boards that have a CIRCUITPY drive, since the file system is mounted as read-only, the File System API is still used. When the board connects, the board is queried about whether it is mounted as read-only and the appropriate connection method is automatically selected.
For interacting with the REPL, the Code Editor uses the CircuitPython REPL JS library. This was originally written to interact with the REPL in the same way a user would use it, but was updated to use a special REPL mode called Raw Paste Mode. This allows less chatter and better control of code output and error messages and was intended specifically for code editors to interact.
The REPL library was also given a class of functions that allow File Operations to be performed and is where much of the power of the USB mode update was added.
Text editor powered by tinymce.