Comments (4)
Also, would there be a benefit to using Reacton within a class structure?
We have discussed this quite a bit. I think the only benefit is that it doesn't look so unfamiliar to Python users (I guess that is also what drives you to a class, right?).
The downside of a class is that we need to be clear about the lifetime of self
, and can its properties be mutated? We can mirror this from the ReactJS world, but it also requires a decorator to make sure that outside of the class, it's state cannot be mutated (otherwise, why no stay with regular ipywidgets).
This is a very interesting topic, however, with no easy answers, so any feedback (like this) is very welcome.
My main question to you is, why would you want this? Is there a benefit from using classes over a (decorator) function?
from reacton.
My main question to you is, why would you want this? Is there a benefit from using classes over a (decorator) function?
I'm not sure I can answer that well. A class structure generally helps to provide a clean API to programmatically control or interact with the web-app. By having the Widgets outside of this class structure would make it harder for variables to be passed between the widgets and would be harder to produce clean reliable code.
Generally speaking, I am trying to determine some best practices for to develop Python web-apps. We are currently using a combination of Dash, Streamlit and Voila. Streamlit is great for small apps and has a consistent look and feel. But Voila (with Ipyvuetify) is better for larger more complex web-apps. But having multiple web-app frameworks and no consistent standards has caused a bit of a maintenance nightmare. So I would like to reduce the number of web-app frameworks (ditch Streamlit and Dash and only use Voila) and create coding standards for the Voila apps. However, Jupyter Widgets requires more callback functions than a Streamlit app, thus Voila is perceived to be harder to setup so it might be hard to sell this idea to the team. I was hoping Reacton would ease those pains and help our transition to Voila only web-apps.
I would love to see a showcase example of a large Voila or Jupyter Widget project, ideally using a mixture of ipyvuetify, plotly, bqplot etc. Perhaps I should evaluate Solara! I've just been looking through the Solara tutorials. I would be very interested in how an experienced software developer would structure a big project. But there doesn't seem to be many teams able to share those projects (which must be frustrating for you).
from reacton.
A class structure generally helps to provide a clean API to programmatically control or interact with the web-app. By having the Widgets outside of this class structure would make it harder for variables to be passed between the widgets and would be harder to produce clean, reliable code.
I think that arbitrary interaction (n objects can have n^2 interactions) makes it very difficult to understand larger applications. Or am I misunderstanding what you meant?
In the case of Reacton, there are no widgets outside of any structure. The elements (which replace the widgets) are completely isolated in the scope of the function, nobody can mess with them except the component itself. I think this 'limitation' makes it easier to reason about a component.
I was hoping Reacton would ease those pains and help our transition to Voila only web-apps.
I am personally convinced by this. Actually, I think it's more Solara that will help you here since Reacton is quite bare-bone.
There is one project that we work on that is source-visible, but not open source: https://github.com/dominodatalab/low-code-assistant (docs at https://dominodatalab.github.io/low-code-jupyter-docs/ with some screen capture available). (Again, not open source, it has copyright, but it may give an idea of how to structure a larger application)
Without Solara, we (@mariobuikhuizen and I) would be unable to create an app like this, or with way more time, more bugs, and a slower pace.
I do plan to write more documentation on our views on how to write re-usable components/libraries, and how to write larger apps (they have different requirements/needs).
If you don't mind, I'd like to do a video call with you to discuss this some more, is that ok? (If possible, can you share your email address with me at [email protected])
from reacton.
Note that low-code-assistant by domino is now called domino code assist and is no longer source visible either. Solara, and the website at https://github.com/widgetti/solara/ is an example of a larger (open source) project.
from reacton.
Related Issues (20)
- Can it be used on fastapi? HOT 1
- Markdown example does not work with myst_parser>=0.18 HOT 1
- Reacton is Awesome HOT 6
- jupyterlite demo - `No module named 'reacton'` HOT 2
- Amazing work - quick question HOT 13
- Image placeholder HOT 4
- minor correction in docs HOT 1
- Matplotlib plots not rendering properly in output widgets. HOT 4
- SelectionRangeSlider Options List Not Updating HOT 4
- get_widget can fail
- Deprecated Warning Widget.widgets is deprecated
- How to use VuetifyTemplate method? HOT 1
- Ipyvuetify DataTable with Select in a column HOT 2
- Qt HOT 3
- Reacton is not installed in jupyterlite environment
- ipywidgets does not cover DatetimePicker
- use_event is combination with solara.SideBar gives unclear error
- shared elements test for bqplot pass in tests, but fail in solara
- Element keys set with Reacton `.key(...)` are not recognized by the ipyvuetify transition group
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reacton.