-
-
Notifications
You must be signed in to change notification settings - Fork 321
New WebUI Framework #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll try to setup example prototype with |
thank you, I have watched quickly one preact tutorial and it is a complete new world for me... |
May be embedded page could be a good start for a prototype - it is not complex and could give a size reference also |
I've created base app with The size of bundled index.html (html + css + js) is just run Build can be done with I've disabled some of the bootstrap components => https://github.com/aganov/esp3d-ui/blob/master/src/stylesheets/_bootstrap.scss We can bring them back by uncommenting in the scss file.
This is the SPA project structure. I'm using React with hooks => https://reactjs.org/docs/hooks-intro.html. Preact is just lightweight 3.4kB implementation of React.js. We will need some global state so I choose to use Here is screenshot from the "app" I've added some random generated properties to illustrate dom rerendering... // This should be polled from websocket for example
useInterval(() => {
const positions = ["X", "Y", "Z"]
const tempKeys = ["T1", "B"]
store.dispatch("positions/update" + positions[Math.floor(Math.random() * positions.length)], Math.floor(Math.random() * 225))
tempKeys.forEach(key => store.dispatch("temperatures/update", { key, value: Math.floor(Math.random() * 215) }))
}, 1000) Btw, if you find React.js a big bite for you, we can use Vue.js + vuex It has short and sweet learning curve but the bundle size will increase a lot (Vuejs is |
Wow that was fast 🐱 - I need to read all that and digest it ok going to bootstrap@4 is good. I will test the sample code and read it this afternoon and report - I may have a tons of questions - sorry in advance 😸 |
Thank you - I have started reading several tutorials about Preact, including https://github.com/developit/preact - fall asleep watching last one 😸 Is Preact very different than React ?- as I found serveral tutorials and books for React also @aganov as you seems mastering it, the does the script building can also compress the index.html, I guess yes reading that : https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a but did you it already |
Almost everything you can find for react will apply to preact. Here you can read about the differences. Keep in mind that after releasing |
Ok thank you. I have tested the prototype and UI is 100% identical unlike current one on every browsers I tested, very good. |
About compression. Some fine tuning is needed there, involving |
|
Found this for reference : https://github.com/ooade/awesome-preact looks interresting |
Additionnaly I found a size comparaison of simple hello world apps @aganov I have one question related to bootstrap and grid display as you looks WebDesign guru 😸.
and I also played with |
You can check bootstrap's references about flexbox https://getbootstrap.com/docs/4.0/utilities/flex/ also this references about display-ing and hiding stuff https://getbootstrap.com/docs/4.0/utilities/display/ The doc about responsive-breakpoints is very useful too
https://getbootstrap.com/docs/4.3/layout/overview/#responsive-breakpoints |
My mistake I did not checked 4.0 |
@aganov do you use gitter ? It use Github ID so no need to create new account |
https://feathericons.com/ looks good, they seems cover all current needs |
Was busy these days but will continue on this soon |
This lib looks nice for popup https://popper.js.org/ |
Ok, I am super late in learning PreactJS I need to lear a lot of new concepts - understand them is not hard but use them is another story ... |
Ok learning curve is slow but I did not spent as much time as I wanted - still a lot to learn but in same time need to define the new UI I choose to go to a header always visible , the menu in header should collapse if width is too low (TBD) the Dashboard will be main UI, top will have a status area for print status / DHT temperature, wifi status, etc and TBD I am not sure yet how it will be displayed but it is a start Feedback / suggestions are welcome as usual |
@aganov thanks again a lot for your sample code - it is a tremendous help for me to understand how preact works, I won't be able to do anything without it - it is hard to start from scratch on such tech with so little tutorial available and out of date due to permanent evolution. I am on router part, and next coming are storage and hooks parts - I feel exausted already just thinking of them 😜 |
This looks really great :-) Will it be 3.0? |
Well framework should be this one yes. UI itself is not yet defined, I am super late on this. I should finish the fw base soon so I could focus on WebUI hopefully |
Ok still late on this but todo list is skrinking 😉 |
Some update: The UI design itself is not yet defined but :
the header should be present only in PC / high res, for phone / low res menu should be responsive the Camera should allow to have 3 views: A confortable UI in tablet / phone as option vs a reactive UI = mobile view Limit modal windows for messages / alert / notification only - so no modal overlap unlike 2.1 any suggestion is welcome of course 😁 |
Done week 1 :1 - Dev server can be used to simulate all UI including basic queries so it will save time in pre-tests Conclusion : so far so good 😸 Done week 2:1 - Test translation libraries and identify the good one among:
2 - Identify/test a chart library for the temperatures for 3D printers (current smoothie is 10KB gzipped):
Any suggestion of small foot print lib is welcome 3 - test axios vs fetch
4 - training/tests on Preact Hooks, Preact code syntax and scss syntax 👨🎓 Done week 3:1 - port GET http queries manager from 2.1 using Done week 4:1 - add POST query and post upload to http queries manager 👨🎓
Feel free to comment if any missing 😸 |
We willl have modern Html5 streaming control instead of flash, right?
|
@DanielYWoo what flash are you talking about ? there is not flash in code |
From the project homepage, camera tab, looks like a flash player. |
ho this come from camera, not from esp3d, esp3d just use ip and display camera page in frame for ip cam |
I think it is time to close this topic - I am still on learning curve about the good practice and still got some Preact crash but I mostly handle them by trial/error discussion is now more here : #94 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I got feedback from aganov:
here my answer:
Because it is a good discussion - lets discuss
The text was updated successfully, but these errors were encountered: