Would you be interest in a PR for fleshing out the skija run*
config options? I have something hacked together at the moment to enable window height/width and handlers but could flesh it out more over the next couple days to match the skia options (or one of the other platform implementations if there's another one that's better to copy)
@jjttjj, that sounds great! Some thoughts about run
that I haven't had time to implement or completely think through:
• Currently, none of the run
functions say anything about what run
should return. Probably a map and we can start defining keys for basic things like repaint, quit, on-close, etc?
• Some of the backends can be run synchronously or asynchronously. Currently, run and run-sync are separate functions, but maybe it's better if it was just an option?
• If async were an option, that brings up another issue. How should unrecognized options be handled? Tolerating extra options makes it easier to write code that's compatible with multiple backends. Silently ignoring options (ie. tolerating extra options) can make it frustrating to debug code that's not working (eg. you passed {:async true}
, but it runs synchronously anyway).
• I think it's tempting to try to coerce options from different backends into the same option keyword, but we should only reuse the same option keyword across multiple backends if they are exactly the same. Tending towards backend specific options makes it harder to write code that works across multiple backends, but makes it easier to get everything just right for a specific backend. I think the latter is more important than the former.
I wouldn't say any of the platform run
implementations is particularly exemplary. The two most used backends are skija and skia so that seems like a good place to start. If you're feeling ambitious, vdom and terminal present fairly different environments compared to the skia* options.
As a clarification, the bullet points above are just a brain dump of everything I could think of related to the run
functions. Not every point needs to be addressed all at once or at all (depending on if better options are discovered).
Sounds good, yeah it's useful to have the brain dump. I pushed the minimal stuff I have currently here: https://github.com/jjttjj/membrane/tree/skija-features (just adding width/height options and fixing what I think is a bug in Scale. Will be continuing work slowly for the next few days though
looks great. the scale diff definitely looks like that was a bug. 🐛
Great! I'll start digging in soon