SSR and NiceGUI: A solid attempt! (no longer stuck) #4554
Replies: 5 comments 3 replies
-
Got some resultsPatch the Quasar as said here: quasarframework/quasar#11424 (comment) Then you get: ![]() Sounds familiar? That's because it is the exactly same HTML elements by the end the page is rendered Paste it into templates/index.html like this ![]() Then, volia, NiceGUI with Server-Side Rendering (SSR)! Even blocking nicegui.js, which makes ![]() Considerations going forward...But, obviously this won't work. This is very much alpha. The following questions needs to be answered:
The following things have to be done:
@falkoschindler This is going to be even crazier than the ACID PR, and I don't feel I am able to make such a PR on my own effort. Let's think before we act? |
Beta Was this translation helpful? Give feedback.
-
Works to use https://github.com/samwillis/nodejs-pypi which offers NodeJS v18.4.0, just enough to generate the HTML elements after patching the Patching guide:
![]() This could work! |
Beta Was this translation helpful? Give feedback.
-
Might be a good idea to separate this to a different package, think: |
Beta Was this translation helpful? Give feedback.
-
Why do you want SSR (Server-Side Rendering)? What would be the benefit? Is a pre-rendered HTML payload really smaller than our JSON containing the definition of UI elements? Isn't it better to distribute the rendering work to the clients instead of doing all the work on a centralized server? |
Beta Was this translation helpful? Give feedback.
-
Well, getting SSR working was easier than I expected, because of the helpful library https://pypi.org/project/nodejs-wheel/ So, check out #4557. Though, more discussion on pros and cons is still needed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Related to #637
TL-DR: Want to do SSR. Vue alone, fine. With Quasar, blows up terribly and can't debug. Need help. If we make it work, SEO and page load times will take a big boost.
Steps to reproduce:
Note: the
elements
is taken from:Inspect the html to get it.
Issue
If you comment out the line
app.use(Quasar, {})
, you see:So the server-side rendering is working, but just that Quasar is not included into the Vue app.
If you then leave
app.use(Quasar, {})
uncommented, you'll see perhaps the most opaque error you'll ever see in your life.So, I am stuck. Cannot proceed further. If I make it work, we can invoke the SSR on every page load, making every NiceGUI page serve valid HTML, boosting SEO and initial page load speeds.
Beta Was this translation helpful? Give feedback.
All reactions