py-editor
run buttons now display a spinner when disabled, which occurs when the editor is running code.
- Added the
xterm
attribute topy-config
. When set toTrue
orxterm
, an (output-only) xterm.js terminal will be used in place of the default py-terminal. - The default version of Pyodide is now
0.23.2
. See the Pyodide Changelog for a detailed list of changes. - Added the
@when
decorator for attaching Python functions as event handlers - The
py-mount
attribute on HTML elements has been deprecated, and will be removed in a future release.
- Added logic to react to
py-*
attributes changes, removal,py-*
attributes added to already live nodes but alsopy-*
attributes added or defined via injected nodes (either appended or viainnerHTML
operations). (#1435)
- Added the ability to optionally use
<script type="py">
,<script type="pyscript">
or<script type="py-script">
instead of a<py-script>
custom element, in order to tackle cases where the content of the<py-script>
tag, inevitably parsed by browsers, could accidentally contain HTML able to break the surrounding page layout. (#1396)
- Added a
docked
field and attribute for the<py-terminal>
custom element, enabled by default when the terminal is inauto
mode, and able to dock the terminal at the bottom of the page with auto scroll on new code execution.
- Restored the
output
attribute ofpy-script
tags to routesys.stdout
to a DOM element with the given ID. (#1063) - Added a
stderr
attribute ofpy-script
tags to routesys.stderr
to a DOM element with the given ID. (#1063)
- The
output
attribute ofpy-repl
tags now specifies the id of the DOM element thatsys.stdout
,sys.stderr
, and the results of a REPL execution are written to. It no longer affects the location of calls todisplay()
- Added a
stderr
attribute ofpy-repl
tags to routesys.stderr
to a DOM element with the given ID. (#1106) - Resored the
output-mode
attribute ofpy-repl
tags. Ifoutput-mode
== 'append', the DOM element where output is printed is not cleared before writing new results. - Load code from the attribute src of py-repl and preload it into the corresponding py-repl tag by use the attribute
str
in yourpy-repl
tag(#1292) - <py-repl> elements now have a
getPySrc()
method, which returns the code inside the REPL as a string.(#1516)
- Plugins may now implement the
beforePyReplExec()
andafterPyReplExec()
hooks, which are called immediately before and after code in apy-repl
tag is executed. (#1106)
- introduced the new experimental
execution_thread
config option: if you setexecution_thread = "worker"
, the python interpreter runs inside a web worker - worker support is still very experimental: not everything works, use it at your own risk
- Fixes #1280, which describes the errors on the PyRepl tests related to having auto-gen tags that shouldn't be there.
- Py-REPL tests now run on both osx and non osx OSs
- migrated from rollup to esbuild to create artifacts
- updated
@codemirror
dependency to its latest
- Add docs for event handlers
- Fixed an issue where
pyscript
would not be available when using the minified version of PyScript. (#1054) - Fixed missing closing tag when rendering an image with
display
. (#1058) - Fixed a bug where Python plugins methods were being executed twice. (#1064)
- When adding a
py-
attribute to an element but didn't added anid
attribute, PyScript will now generate a random ID for the element instead of throwing an error which caused the splash screen to not shutdown. (#1122) - You can now disable the splashscreen by setting
enabled = false
in yourpy-config
under the[splashscreen]
configuration section. (#1138)
- Fixed 'Direct usage of document is deprecated' warning in the getting started guide. (#1052)
- Added reference documentation for the
py-splashscreen
plugin (#1138) - Adds doc for installing tests (#1156)
- Adds docs for custom Pyscript attributes (
py-*
) that allow you to add event listeners to an element (#1125)
- The py-config
runtimes
to specify an interpreter has been deprecated. Theinterpreters
config should be used instead. (#1082) - The attributes
pys-onClick
andpys-onKeyDown
have been deprecated, but the warning was only shown in the console. An alert banner will now be shown on the page if the attributes are used. They will be removed in the next release. (#1084) - The pyscript elements
py-button
,py-inputbox
,py-box
andpy-title
have now completed their deprecation cycle and have been removed. (#1084) - The attributes
pys-onClick
andpys-onKeyDown
have been removed. Usepy-click
andpy-keydown
instead (#1361)