-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Execute pys-on* events when triggered, not at load #686
Conversation
Will check this more closely tomorrow morning. |
Well, by the powers of me and VSCode visual merge combined, I have screwed up merging the commit to fix the examples. I'll have to fix that tomorrow. Sorry! |
Merging is soo 😅 visual or not, is so often confusing |
439c0b2
to
2efad34
Compare
I think what's happening here is that Madhur changed a couple of things related to how we run Pyodide and now the tests are expecting this behavior. |
Thanks for pointing that out - makes sense to me. I see 2 failing integration tests, one is now fix, the other is odd:
I also had Are there other tests that are failing in your environment? (Still to-do is @fpliger's note on the issue (#685) to leave the pys-on* events with their current behavior, but mark them and their behavior as deprecated.) |
Mimicing the behavior of Javascripts 'onLoad' event, we should not be executing the use code at page-load time, only when the event is triggered.
for more information, see https://pre-commit.ci
f4a7084
to
02a7178
Compare
I've just rebased everything on main to test it on the latest version of the code and it doesn't seem to be working.
Okay, maybe this is another good candidate for us to remove from pyscript -> collective. |
+1 on moving it to the collective. The examples is too out of pyscript-core that makes sense for the core devs not maintaining it directly. @freakboy3742 any thoughts? test_repl2 seems to be working for me locally. For |
Yes +1 on PyScript Collective as home for the neat examples |
Moving the examples out of the core repo makes sense to me. FWIW: I'm hoping to spend some time working on the Toga web backend (and adding a Briefcase web backend) in early October, so I should have some updates for the Toga demos in the near future. |
Sounds good all - I won't worry about the Toga Example failing for the moment, if that's being moved into the collective.
Thanks @marimeireles and @fpliger - I'll rebase locally have a look at these and see if I can figure out what's happening. Interesting that there are different results for each of us. I've mostly been testing on a (slow-ish) Linux VM. Maybe I'll try setting up to test on a faster Windows box, to see if there's a potential timeout or race condition or something going on here... Edit: Ah, nevermind about testing on Windows - |
…tests (pyscript#747) * Create custom elements when the runtime finishes loading * Remove xfails and fix repl integration test * Fix commented ignore * Address Antonio's comments * Fix bad rebase * Make ure to wait for repl to be in attached state before asserting content * Move createCustomeElement up so it runs before we close the loader, xfail flaky d3 test * Fix xfail
updates: - [github.com/pre-commit/mirrors-eslint: v8.23.0 → v8.23.1](pre-commit/mirrors-eslint@v8.23.0...v8.23.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The new deprecation of |
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.
@JeffersGlass Thank you so much for the contribution and for the patience to move this through! This is a great PR! It also anticipates some of the optimizations we need to do to move things when the are ready (like deferring custom elements creations). We'll need to keep you a PyScript shirt the next time we have them! 😄
Merging since the failing tests is due to the doc changes and not related to the code changes.... |
Thanks @fpliger! More than happy to work through this, and honestly got to learn a lot more about the integration-test architecture along the way, which was good fun and I think will be very useful. |
This is such great PR, srsly. |
Pys-on*
attributes should behave the same as Javascripton
attributes (onClick, onKeyDown, etc.), which executed at event-trigger-time and not passed a reference to a function. (See, for example, freecodecamp for examples in Javascript.)Fixes #685 - see example code in that issue for illustration.