Remix - purely server side (html over wire) #7422
Replies: 4 comments 11 replies
-
Just omit the All links and forms will continue to function as they are native HTML elements. |
Beta Was this translation helpful? Give feedback.
-
wow - that simple! Thanks @kiliman |
Beta Was this translation helpful? Give feedback.
-
One more question - how would I go about rendering a partial (without the layout)? |
Beta Was this translation helpful? Give feedback.
-
I was able to get this working by using the manifest from For local dev am able to see changes reflected as soon as a file is changed. Also once built the html correctly references the javascript and css assets. entry.client.tsx Just has the client side code I need (hotwire turbo) import * as Turbo_ from "@hotwired/turbo"
export const Turbo = Turbo_ root.tsx Do not render Get the manifest from import { useRemixContext } from "@remix-run/react/dist/components";
export function Layout({ children }: { children: React.ReactNode }) {
const { manifest } = useRemixContext();
return (
<html lang="en">
<body>
{children}
<ScrollRestoration />
{import.meta.env.DEV && <script type="module" src="/@vite/client"></script>}
<script type="module" src={manifest.entry.module}></script>
</body>
</html>
);
} Once built the html correctly references the build entry client and also other assets like tailwind
I think this is a working solution, do suggest if I'm missing anything obvious... |
Beta Was this translation helpful? Give feedback.
-
Hi All
Huge remix fan here!
By having a clear separation of where data access happens (loaders and actions) it has made my life infinitely simpler, thanks!
Just wanted to check if anyone has experimented with using Remix purely on server side to emit HTML.
That is, avoid client side Remix - no React, hydration or anything...
I know it sounds like fighting the framework, but just asking... 😄
Thanks
Ajai
Beta Was this translation helpful? Give feedback.
All reactions