micropython / micropython-lib

Core Python libraries ported to MicroPython
Other
2.3k stars 981 forks source link

webrepl: Changes for more webrepl features while making it smaller. #814

Open felixdoerre opened 4 months ago

felixdoerre commented 4 months ago

This change:

The change should be compatible with the current micropython version, however a new webrepl client needs to be deployed under https://micropython.org/webrepl/

Currently, to help you testing, I've adjusted the default URL to https://felix.dogcraft.de/webrepl/, where I host the corresponding draft "new" webrepl client. I've pushed the modified js code here, if you want to take a look: https://github.com/felixdoerre/webreplv2. I'm not completely sure, if I should open a PR in https://github.com/micropython/webrepl, as this seems to be the authoritative source of the client, but the repo seems to be abandoned for some time now.

The new webrepl client currently features (See also #13540):

Currently the "mount" feature has to be activated "manually" (by calling hookme() from the developer tools, and then executing __mount() in the repl manually). Also the UI for the file browser might not be super intuitive yet (the + for upload and mounting a local folder might be too small and not clear enough). So I'm hoping for UI improvement suggestions.

If you want, I can split the mount and the mip implementation into separate PRs, but the file-browser and this PR are dependent on each other.

With this change the _webrepl module from micropython is not needed anymore and can be removed.

Carglglz commented 4 months ago

@felixdoerre this could be a good opportunity to add SSL support to WebREPL using SSLContext see https://github.com/micropython/micropython/pull/5611#issuecomment-1314686679 👍🏼

felixdoerre commented 3 months ago

I've pushed a few adjustments and an (optional) bonus commit to allow specifying an ssl context.