-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use vite-plugin-ssr #56
Comments
I tried adapting the starter to use it, but didn't had knowledge enough so the build was breaking, some tasks weren't working |
Oh and I got a bit confused about the filesystem autorouting, how to automatically add /resource/:id pages for example |
The build currently doesn't work because of vitejs/vite#2390. I'm going to wait to see what Evan replies. If the bug is not fixed soon I'll simply use
Defining the parameter of a route in its filename is breaking the convention of not using special characters in filenames which may result in problems for certain deployment environments. It's too little of a benefit and doesn't justify breaking conventions. About whether to use vite-plugin-ssr or not. Using vite-plugin-ssr provides you with an SSR architecture without limiting you in any way. The problem with SSR frameworks such as Next.js is that they take away too much control from you. The most problematic part being rendering. It is notoriously difficult to integrate tools with Next.js precisely because you don't control how your pages are rendered. With vite-plugin-ssr integrating tools is simply a matter of following the official documentation of the tool you want to integrate. While vite-plugin-ssr comes with a default routing (SSR and routing are inherently intertwined), you can actually use vite-plugin-ssr with with React Router. But the default routing should work for the vast majority of cases (and is actually simpler than React Router; thanks to SSR we can radically simplify routing). Also,
There are still some rough edges here and there but I'm working on smoothing them out. |
But if you use React Router with vite-plugin-ssr you miss the autorouting, right? |
You can use React Router and Or, you can have a single page But, in general, using React Router for an SSR app doesn't bring much value. SSR with simple route strings (e.g. Note that Next.js doesn't support React Router which shows that route strings are mostly enough. |
well, let's wait the Vite fix, maybe I can try again |
The latest vite-plugin-ssr version includes a fix. Build should now work. |
We briefly talked about it at the vite-plugin-mdx repo; AFAICT vite-plugin-ssr would actually fit your project well.
Thoughts?
The text was updated successfully, but these errors were encountered: