iNdra
Solidstart with CSR, SSR and SSG?
I found the details. Thank you for support. Default ssr is ture in app.config.ts https://docs.solidjs.com/solid-start/reference/config/define-config when I change it, it is CSR. When set
defineConfig({ server: { presets: 'static' }})
it will be SSG. crawlLinks: true
will generate routes. https://docs.solidjs.com/solid-start/building-your-application/route-prerendering, https://nitro.unjs.io/config#prerender9 replies
How SolidStart SSR (& hydration) work?
Oh I thought solidstart codes are combination of code. Client side and Server side. Thank you very much for information.
I wounder how to reference DOM with JS. Now it is clear. I also thought, if that can link HTML DOM with JS, someone can create packages for python, PHP, rust to send HTML with comments from server like JS do. So then can make full stack frameworks. Just an idea.
27 replies
How to work with SSR pages?
But the reality is that 80% of the internet seems to PHP-based anyway and eBay seems to do OK with Marko's Node.js based rendering—it's React SSR that is slow.Yeah most of website PHP based because of wordpress. Rust is new and has more learning curve so most developers not use. But when use rust, long term website have more profit like PHP use. But not like NodeJS. NodeJS always uses more hardware resource to run and always use.
20 replies
How to work with SSR pages?
The tradeoff is that you are exposing the visitor to Cumulative Layout Shift (CLS) . This is the main reason CSR SPAs send an empty document body—there is nothing to display until the client side code completes the first blocking render.Can explain more about this how CLS effect with that? (and bottom parts (post render, comments) can use SolidJS) You mean when part of webpage already loaded using SSR and other part load after full load so CLS score will high? then not good.
20 replies
How to work with SSR pages?
thank you for information. I think old days method can use with SolidJS. Old day use PHP for SSR and JQuary or pure JS use to handle events by identify elemets using ID. So when use SSR using Rust, I can handle events using JS.
<HTML Page>
<SSR HTML DOM />
<CSR DOM (solid JS) />
</HTML PAGE>
SSR HTML DOM event can handle using JS inside solid code but not hydrate any DOM. Example: Facebook profile page - profile header parts (cover letter, Add friend etc.) can use SSR and bottom parts (post render, comments) can use SolidJS. So only Add friend button click event need to handle inside SolidJS code. I think this method is posible way to do.
20 replies
How to work with SSR pages?
thank you for information. As a summery, add data to
<script id="appProps" type="application/json"> </script>
and add those data to JSX App as a input prop. This is for second question. For first question, I use Rust for SSR and it add some DOM to page but control is doing in client side. How to do it? old days doing it by using JQuary or JS using getelementbyid
method.20 replies