Skip to content

Add pyodide version of calculator#23

Closed
bmaranville wants to merge 42 commits intopython-periodictable:masterfrom
bmaranville:pyodide
Closed

Add pyodide version of calculator#23
bmaranville wants to merge 42 commits intopython-periodictable:masterfrom
bmaranville:pyodide

Conversation

@bmaranville
Copy link
Contributor

This PR:

  • modifies nact.py so that the cgi import is lazy (not compatible with pyodide, can't be imported)
  • adds a new single-page app index_pyodide_optimized.html that shows the interface immediately, but loads pyodide and dependencies in the background in a webworker
    • if a user clicks calculate buttons before the worker is ready, a spinner appears until the calculator is loaded, then it shows the result
  • adds some deploy scripts for adding this as a static resource on a traditional webserver
    • vendors pyodide, jquery, and wheels.

@pkienzle
Copy link
Contributor

We don't want to maintain four different versions of index.html. Any way to consolidate them, or to move common components into other files? Moving the javascript and css to separate files is an obvious step. Can the html be set up as an include as well?

@bmaranville
Copy link
Contributor Author

Sorry, two of those are not really needed and can be dropped... html includes aren't really a thing anymore, but yes the CSS can be shared, as can most of the JS.

@bmaranville
Copy link
Contributor Author

superseded by #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants