Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
remix-run-bot committed Jan 8, 2024
1 parent 095bfa0 commit 40b20c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .changeset/spa-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import { unstable_vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [
remix({ unstable_ssr: false }),
],
plugins: [remix({ unstable_ssr: false })],
});
```

Expand All @@ -39,4 +37,4 @@ To run your SPA, you serve your client assets directory via an HTTP server:
npx http-server build/client
```

For more information, please refer to the [SPA Mode docs][https://reactrouter.com/en/main/guides/spa-mode].
For more information, please refer to the [SPA Mode docs][https://reactrouter.com/en/main/guides/spa-mode].
3 changes: 2 additions & 1 deletion docs/guides/spa-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SPA Mode is basically what you'd get if you had your own [React Router + Vite][r
- `<head>` management via Remix [`<Meta>`][meta]/[`<Links>`][links] APIs
- you don't _have_ to do this if your app doesn't warrant it - you can still just render and hydrate a `<div id="app">` with some minor changes to `root.tsx` and `entry.client.tsx`

SPA Mode tells Remix that you do not plan on running a Remix server at runtime and that you wish to generate a static `index.html` file at build time and you will only use [Client Data](https://remix.run/docs/en/main/guides/client-data) APIs for data loading and mutations.
SPA Mode tells Remix that you do not plan on running a Remix server at runtime and that you wish to generate a static `index.html` file at build time and you will only use [Client Data][client-data-2] APIs for data loading and mutations.

The `index.html` is generated from your `root.tsx` route. You **should** include a `HydrateFallback` component in `root.tsx` containing the app shell/initial loading state. The initial "render" to generate the `index.html` will not include any routes deeper than root. This ensures that the `index.html` file can be served/hydrated for paths beyond `/` (i.e., `/about`) if you configure your CDN/server to do so.

Expand Down Expand Up @@ -122,3 +122,4 @@ Once you've got all your routes living in their own files, you can:
[meta]: ../components/meta
[links]: ../components/links
[migrating-rr]: https://remix.run/docs/en/main/guides/migrating-react-router-app
[client-data-2]: https://remix.run/docs/en/main/guides/client-data

0 comments on commit 40b20c1

Please sign in to comment.