Replies: 2 comments 6 replies
-
|
This is the point exactly. I have not spent enough time with the docs yet to make up my mind, but its clear that index.js and app.js need a full revamp (I mean ripping it out and redoing it kind of). Also the draw logic of the dashboard elements needs rethinking (currently we make a decision to redraw on every incoming message instead of targeting the component that changed (since dashboard layout only changes via setting or refresh). The issue is (and that may be my lack of understanding of lit) is that since we use a top-down approach we need to update the full tree we cannot targettedly aim for a specific component. So this does not work (unless you call requestUpdate()): however, if you call reqeustUpdate() in the parent it will flag shouldChange for all child components essentially rerendering (calling render() on) every element. So this is equivalent to replacing the whole appState so the change detection flows down but that will trigger all elements as all reference are invalidated. I am pretty sure that signals() will remedy this where data is not passed from top but rather injected via a service from the data layer. This way the component will know if it really has changed or not |
Beta Was this translation helpful? Give feedback.
-
|
Please find below the high level plan for changing the data layer and other parts of the front end for 0.9.8: Change plan
RXjs and LIt: https://medium.com/netanelbasal/lit-rxjs-made-for-each-other-ace3d13f3c24 This provides a very good interop handler example for the Rxjs observables and Lit component templates. It manages subscription/unsubscriptoin automatically and with these rxjs usage in the template becomes much simpler. note: I am still digesting the docs and the biggest question for me currently is how efficient the injection of the dependency services directly into the component but based on this article and this video on context specifically on lit context and dependency injection it seems doable, though I am not 100% sure if best practice is that this should be used for values only (if this is the case we can inject the specific getter on the data services but I prefer injecting the whole class) even though the docs states that this is for service as well While I understand that this is seemingly a big change (code wise I think this is not that big apart from typescript migration) but the above structure would have a lot of benefit on the long term:
If someone would raise that this may be an overkill I would argue that we do not know what the future of this GUI is on the long term. Where it may develop. The point (and hence the aim) of the above that would serve as solid foundation for any potential extention of the GUI. I understand that there are way to do incremental steps but it will just abstract the main issue that is at the root of the current GUI architecture which is how data is being handled (updated/read etc.).
Please feel free to detail them here. Rational behind build tool migrationBenefits and rational on build tool migration (I am rooting for this so cons must be raised by someone else :D:D:D ): Vite/Vitest (Overall: everything is in one place one config)
TypeScript migration
I am happy to receive feedback (any kind):D |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve been looking through the lit docs and thinking about some if the problems laid out in #173 and #170 regarding reactivity.
The points around legibility and maintainability are valid. And I think a lot of the trouble with following along is inconsistency with the patterns; through what means data flows in (or, maybe one day, out), what the scope/responsibility of a component is, how we’re rendering that component, etc.
We’ve got dishes in the oven and cutlery in the fridge, so to speak.
lit does offer tools and opinions in this regard. It’s just not strict about enforcing them. I think standardizing the handful of components here would make the Frontend
If we follow rules, it’s easy to know what goes where if we ever switch to something else
I think @Abasz has touched on many of the same points. But I wanted to bring up the refactor as a “project” for the next release, so that we’re all aware of each other’s construction zones😊
after laying this groundwork, I think it’d be a cinch to move on to planned workouts, etc.
Pretty excited about the idea. If you’ll have me, of course.
Beta Was this translation helpful? Give feedback.
All reactions