I've been also working on the SSR version of your ...
# kilua
r
I've been also working on the SSR version of your app, but I've found some issues which are making the process a bit harder. These are not Kilua issues but more of general SSR problems. First, you are generating random content and it is generated directly in a view layer, like this: https://github.com/shubhamsinghshubham777/SpotifyClone/blob/main/src/commonMain/kotlin/components/MainBody.kt#L161
With SSR, this content is generated on the server side, transferred to the browser, rendered and then re-generated with different random values and re-rendered once again. So it flickers and it's not good effect for users.
Kilua supports serializing state from the server to the client, but I will need to change your app a bit to use some kind of viewmodel with generated state I can serialize.
A simpler, alternative solution is to exclude the main view from server side rendering. This way only the main layout (kind of frame) is send from the server, and the generated content fills the frame on the client side. I've implemented it and it kinda works, but I will probably try with the serialized state approach, because it should work better and also better shows Kilua's features.
The second problem with your app is the responsive layout implementation. As far as I understand it's a kind of approach used in Android or other mobile apps. The size of the screen is checked during the rendering phase and the generated HTML code is different for different screen sizes. Unfortunately this doesn't work well with SSR, because the server doesn't know the size of the browser, so the code rendered on the server is different than the code rendered in the browser. And it flickers again.
In the web world responsive layout is usually based on CSS. The HTML code is always the same, but it is rendered differently. This is something I'm not sure how to handle, yet.
Modifying the application for different architecture would be probably a bit hard. I'm thinking about other possibilities.
s
Oh okay. Understood