Async SSR Magic?

Trying to get Async SSR working in my project, I'm using esbuild. Working on troubleshooting and I found this lovely text box on the SSR docs page: "Keep in mind that you will need a bundler like Vite, Webpack, or Rollup to bundle your application. Here's a fully functional example using rollup and express. solid-ssr-workbench. This repo contains examples of all 3 forms of SSR." I dove into the example repo provided, the only difference I could find between a typical solid config and this one was this line: presets: [["solid", { generate: "ssr", hydratable: true, async: true }]] So there's an async option for the solid babel preset! I dropped this into my esbuild object with plugins: [solidPlugin({ solid: { generate: "ssr", hydratable: true, async: true } })] but things still aren't working. I also tried creating a bespoke version of esbuild-plugin-solid with the newest babel-preset-solid from NPM included. Still, no dice. Is it truly the case that I MUST switch to a fat bundler to get async SSR working? There's gotta be a way to get the rendering working outside of Vite, Rollup or Webpack.
6 Replies
Only Cliches
Only Cliches6mo ago
expirimenting with rollup, seems like the async flag in the solid preset does nothing. The compilation result doesn't change regardless of that flag. Which makes sense, I couldn't find anything in the jsx transform plugin that honored that.
Only Cliches
Only Cliches6mo ago
there is no magic, the docs are wrong. Working esbuild with async ssr: https://github.com/only-cliches/solid-ssr-workbench/tree/esbuild
GitHub
GitHub - only-cliches/solid-ssr-workbench at esbuild
Contribute to only-cliches/solid-ssr-workbench development by creating an account on GitHub.
lxsmnsyc
lxsmnsyc5mo ago
you can actually do this with just esbuild. My first SSR experiment used only esbuild, however the dev environment is just so bad I abandoned it. The idea here is to build a server and a client bundle
ryansolid
ryansolid5mo ago
Async having different compilation is ancient. I haven't updated something in a while.
Only Cliches
Only Cliches5mo ago
I dropped in a PR to update the SSR example, it was over 2 years old! https://github.com/ryansolid/solid-ssr-workbench/pull/4
GitHub
Updated Dependencies & Necessary Code Changes by only-cliches · Pul...
This repo is referenced in the modern SolidJS docs: https://docs.solidjs.com/references/concepts/ssr/async-ssr The example hasn't been updated in a few years, it was using the depreciated solid...
ryansolid
ryansolid5mo ago
Thanks
Want results from more Discord servers?
Add your server
More Posts