Replies: 14 comments 36 replies
-
Not my project but could you explain in more detail how it would help and where it would replace/enhance the current reactivity ? |
Beta Was this translation helpful? Give feedback.
-
Ahh. IIRC Vue2 had a similar issue. I do a lot of UI with arrays of data represented as SVG elements and Vue2 did not notice any changes to the contents of an array - which was dynamic based on further UI changes. In the end I abandoned Vue2 because of the manual overhead for my case. Vue3 fixed this with deeper introspection? and a complete overhaul as well. I haven't experimented yet with puepy to see how it work in my use case.. soon... Does this sound like an example of what you mean ? |
Beta Was this translation helpful? Give feedback.
-
What an intriguing project. The lack of dataclass support in micropython does indeed rule it out for micropython support. I wonder if I could add it as an optional dependency? Something like a plugin you can install if needed for larger projects? That could get messy though if you're commingling code that expects deep observation with code that does not, so it would need to be explicit. I'll tinker around with it. I definitely want a deep observer feature of state changes but it seemed too complex for the effort and I gave up. Having a plugin you can install to get that functionality for Pyodide might be ideal. |
Beta Was this translation helpful? Give feedback.
-
Does not look like an easy road. Of the two dependencies, trying to just run a "Hello, World" in MicroPython with the dependencies available as wheels:
With enough time, it is probably feasible to vendor the packages in and make the necessary changes. dictdiffer project could possibly even take in any reasonable changes, ProxyTypes would probably be better kept as vendored. |
Beta Was this translation helpful? Give feedback.
-
These would be good to raise on the discord to ntoll, jellglass. We might get some traction as ntoll has connections to micropython chief dev. |
Beta Was this translation helpful? Give feedback.
-
Just following up on this, I think the best approach here is to have an optional dependency for this on the Pyodide runtime. It'll be a little tricky because I don't want to expand the runtime/downloaded codebase too much for optional dependencies, so the idea would be to put a really minimal hook into PuePy, then if syncx and maybe a puepy plugin are installed (via micropip), have the option to use them the same way you can optionally use a router. So then, my concern then is, I don't have two behaviors for component developers. It would be weird if state works one way for when syncx isn't installed, then another if it is, but as a component developer you have no idea which it is. One solution there is to have a per-component flag: something like |
Beta Was this translation helpful? Give feedback.
-
As soon as I have some time, I could take a look at which parts of the dependencies of syncx are really needed, and try to see if I could build a bespoke light-weight no-dependencies mpy-compatible version for PuePy. |
Beta Was this translation helpful? Give feedback.
-
Ok, here you can see a running example of where I am with this, on MicroPython. The Where we are:
Some MicroPython fun I had along the way, in addition to the previous topics discussed here.
|
Beta Was this translation helpful? Give feedback.
-
A little status update on making the introspection work:
For the last one, I looked at MicroPython source code here and compared it to CPython source, and I am not C-worthy enough to start creating a PR. Maybe if @Neon22 could take it up with the MicroPython contacts to see if the assumption that Meanwhile, |
Beta Was this translation helpful? Give feedback.
-
The version now here also handles the custom objects. |
Beta Was this translation helpful? Give feedback.
-
I posted on Webassembly portion of micropython hoping for some guidance/help here: This was because ntoll suggested I did on the Discord forum for pyscript. |
Beta Was this translation helpful? Give feedback.
-
Chris laffra has contributed this to the discussion: In case this helps, PySheets (which uses PyScript with MicroPython for the UI) uses a Model-View architecture for the cells in a spreadsheet. I override setattr to inform listeners that something changed in the model. This works fine on "standard" PyScript releases for me. See https://github.com/PySheets/pysheets/blob/main/src/static/models.py#L184 |
Beta Was this translation helpful? Give feedback.
-
I experimented with this a bit. Something I do wonder is how (if at all), we'd want to handle If you have deep keys, how would that work? Maybe not at all? |
Beta Was this translation helpful? Give feedback.
-
Just following up, I want to get this into 0.5.0. I'm not quite sure how it's best to integrate this into the current codebase and integrate with or replace ReactiveDict, which is pretty foundational to PuePy. I'm still letting it marinade a bit, though admittedly I've been pretty busy the past few weeks with both my "real" job and family stuff. In the mean time, if you have any ideas, feel free to post them or open a pull request. My general plan thinking is that I want to use a deep parameter to |
Beta Was this translation helpful? Give feedback.
-
Hello Ken
Would you be interested in making the state deeply reactive by default? If yes, we could look into integrating my syncx project, with features like:
All the code and dependencies are pure python, but would need to experiment to see if MicroPython is feasible for a limited feature set (e.g. no dataclasses).
Beta Was this translation helpful? Give feedback.
All reactions