-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136251: Improvements to WASM demo REPL #136252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
….worker.mjs can use it
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a full review, just saw some style problems :)
updateHistory(){ | ||
if (this.historyIndex !== -1){ | ||
this.historyBuffer[this.historyIndex] = this.input; | ||
}else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit:
}else{ | |
} else { |
} | ||
|
||
updateHistory(){ | ||
if (this.historyIndex !== -1){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit:
if (this.historyIndex !== -1){ | |
if (this.historyIndex !== -1) { |
<div class="button-container"> | ||
<button id="run" disabled>Run</button> | ||
<button id="run" disabled>Run Code</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<button id="run" disabled>Run Code</button> | |
<button id="run" disabled>Run code</button> |
} | ||
}; | ||
|
||
clearLine(){ | ||
this.xterm.write('\x1b[K') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.xterm.write('\x1b[K') | |
this.xterm.write('\x1b[K'); |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
thanks, @sobolevn! i just ran |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
I'm including a couple of fixes for the WASM demo, which for me made the demo "just work" out of the box for me with a build from following the instructions on this page:
HEAPU32
at build time sincepython.worker.mjs
expects it to be there (for determining the version number)xterm.js
I also made a few changes to try to improve the usability of the web REPL, also included here:
textarea
with Ace code editor.index.html
instead ofpython.html
so that the URL shown in the terminal when runningserver.py
takes you to the demo (without needing to append/python.html
)I also put up a demo here that shows the result of a fresh Emscripten build with these changes.
There's definitely still room for improvement here (for example, #124621 suggests updating the demo to use PyREPL), but I'm sharing these changes in case they're useful in the meantime.
Related Issue: #136251