notpushkin / pyrract

A React-esque library for Python
The Unlicense
13 stars 0 forks source link

High-level Toga API #4

Open proofit404 opened 7 years ago

proofit404 commented 7 years ago

Hello.

Thank you for this repository. I think it address very important issue for toga. Right now writing toga applications looks like manual build widgets hierarchy with inline css.

It is important to have such low level interface for tricky UIs, but in general programming API should be more declarative.

As preparation step for my PyCon Belarus talk I wrote declarative widgets tree formed in the jade/pug template. It is possible to move css properties into separate file and then apply those rules to the tree before widgets generation.

Also there are pyxl library hack running inside browser with Batavia.

https://github.com/proofit404/proofit404.github.io/tree/master/talks/the-right-bees

I think we can develop new layer of high level API for toga. Personally I want to see something component based for UI and probably kind of redux port as another little project for state management.

Also I think this projects should be part of the pybee organization to gain more popularity.

Let's discuss our thoughts in this issue first.

cc @freakboy3742

notpushkin commented 7 years ago

Thanks for bringing this up, Artem! I agree that a real high-level API for Toga would be awesome. Also, I think that sticking to React design and ideology (while probably simplifying some things occasionally) would be great as well so that those who come from the frontend webdev world would already know how to deal with it.

On pyxl: would be awesome to use it, but it seems like it's eared towards classic HTML more for now. We can always fork it and adapt for our needs, though.

On Redux: there are already some implementations like Pydux by @usrlocalben or aioredux by @ariddell, we might use these (if they'll work with Toga, that is; I haven't tested yet).

notpushkin commented 7 years ago

@proofit404 And by the way, any chance to see your talk's recording? Haven't found it on PyCon's website.

proofit404 commented 7 years ago

Here is the video of my talk (in Russian): https://www.youtube.com/shared?ci=KB0DqG_oOa4

notpushkin commented 7 years ago

So OK, the primary problem I've faced is that there's no way to dynamically remove a child element (https://github.com/pybee/toga/issues/30) which is pretty crucial for React-ish behavior.

notpushkin commented 7 years ago

In the time being, we could try develop against Qt or something like that. I really like the idea behind Toga, but the implementation is a bit too alpha-quality for now :(