Your name's not...
Async route guards in Solid Router, and serverside props (not using SolidStart)
To enable clientside route changes to fetch new page props asynchronously, it needs to know what URL it's routing to (including query parameters), and then perform an async fetch of the props for that page so it can populate context before mounting the new page component. Is this possible with Solid Router? I haven't found anything that can make this work so far.
8 replies
Async route guards in Solid Router, and serverside props (not using SolidStart)
This works fine when there is no clientside routing, but it quickly falls apart once pages are switched without a serverside render. What Inertia.js does is exposes serverside props without renders when you add a specific prefix to a route, and I've chosen a similar approach. I've designed my backend such that requesting
/home
will render a page, but requesting /home?__data=1
will skip rendering and only return serialized props. The goal is to fetch route props before switching the page during a clientside render, thereby avoiding a costly server render and keeping the application feeling nice and snappy.8 replies
renderToString in Elysia BFF Layer
I unfortunately don't know how Bun handles these things, but I wish you luck. That comment in the Bun Discord is just weird and sarcastic, I don't understand the motive behind it. I'm not using Bun, but I am doing a BFF with a Go backend, so I feel some of your pain and wish you luck in finding your solution.
47 replies