Make it possible to pre-load or autorun py-editor setup #2120
MarcSkovMadsen
started this conversation in
Proposals
Replies: 1 comment 9 replies
-
the editor bootstraps only on run because multiple editors are allowed and the page would be fully busy otherwise but we did, in fact, discussed the ability to autorun. For the time being, you can add an document.getElementById('that-script').target.querySelector('button').click(); This would run that specific editor code ASAP so I hope as workaround this can unblock you. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to use py-editor with Panel. The first time you click the run button it takes a long time and the user is not informed why. Only that he/ she has to wait via a loading spinner.
I would like to be able to minimize the time it takes to run by preloading the config and optionally some python code.
You can find a minimal example of what I believe I should be able to do here #2119. The only thing missing is the possibility to add a
preload
orautorun
attribute on the<script type="mpy-editor" config="./config.toml" env="shared" setup>
to trigger a run as soon as possible.Alternative
As an alternative is should be described how-to implement this use case if it can already be done via Javascript or Python.
Beta Was this translation helpful? Give feedback.
All reactions