[next] Provide less magic around the display#1673
[next] Provide less magic around the display#1673WebReflection merged 1 commit intopyscript:nextfrom WebReflection:better-display-with-target
Conversation
ntoll
left a comment
There was a problem hiding this comment.
This looks a LOT simpler, is easier to understand and is a smaller change (while fulfilling the outcome of the referenced discussion). Thank you. 👍
I see there's outstanding conflicts that need resolving before we can merge.
|
@ntoll thanks for the review and I am happy you like it ... I think I like it too as it's way easier to reason about what's going on and yet PyScript classic code and use cases with explicit I have a stretch goal in mind though: provide a way to reference the main thread running script/tag via workers, so that beside |
|
@WebReflection my intuition is that if we can provide a way for folks never to worry about from where they're running their code (be that in the main thread or a worker), and we do so transparently and consistently, then we're winning. If we don't do this, many folks will bodge together a half-finished very bespoke version of what we could build as a generalised capability (and by building such a thing, we are thus saving many folks a lot of time and effort to work out how to make it work). I imagine others will have thoughts too... @hoodmane @fpliger @antocuni @tedpatrick |
hoodmane
left a comment
There was a problem hiding this comment.
Looks much better to me, thanks @WebReflection!
|
right ... a couple of changes were needed to provide better worker support for non |
|
Yup, we're good here. Unless anyone is against this current state and demo results, I'm going to merge it so that |
|
🎉 |
|
Apologies that I missed the chance to jump in on the original conversation, but I echo all that was said - definitely appreciate the reduced magic of this version, and think it will be simpler and easier for users to understand. Thanks Andrea! |
Description
This MR addresses this discussion concerns and provide n alternative that (imho) seems to be reasonably good enough, combining the minimum amount of "magic" and @hoodmane suggestions.
Changes
targetid whenever the worker usesdisplaydisplayas a getter from the Python modulecurrent_target()method that returns whatevercurrent_targetis on the main that is executing the codeid) as they need/pleasecurrent_targetwill always be the same script/tagimportChecklist
docs/changelog.md