You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/pages/api/FunstackStatic.mdx
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,25 @@ Sentry.init({
226
226
227
227
**Note:** Errors in the client init module will propagate normally and prevent the app from rendering.
228
228
229
+
### rscPayloadDir (optional)
230
+
231
+
**Type:**`string`
232
+
**Default:**`"fun:rsc-payload"`
233
+
234
+
Directory name used for RSC payload files in the build output. The final file paths follow the pattern `/funstack__/{rscPayloadDir}/{hash}.txt`.
235
+
236
+
Change this if your hosting platform has issues with the default directory name. For example, Cloudflare Workers redirects URLs containing colons to percent-encoded equivalents, adding an extra round trip.
237
+
238
+
**Important:** The value is used as a marker for string replacement during the build process. Choose a value that is unique enough that it does not appear in your application's source code. The default value `"fun:rsc-payload"` is designed to be unlikely to collide with user code.
239
+
240
+
```typescript
241
+
funstackStatic({
242
+
root: "./src/root.tsx",
243
+
app: "./src/App.tsx",
244
+
rscPayloadDir: "fun-rsc-payload", // Avoid colons for Cloudflare Workers
Copy file name to clipboardExpand all lines: packages/docs/src/pages/learn/HowItWorks.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ dist/public
50
50
└── index.html
51
51
```
52
52
53
-
The RSC payload files under `funstack__` are loaded by the client-side code to bootstrap the application with server-rendered content.
53
+
The RSC payload files under `funstack__` are loaded by the client-side code to bootstrap the application with server-rendered content. The `fun:rsc-payload` directory name is [configurable](/api/funstack-static#rscpayloaddir-optional) via the `rscPayloadDir` option.
54
54
55
55
This can been seen as an **optimized version of traditional client-only SPAs**, where the entire application is bundled into JavaScript files. By using RSC, some of the rendering work is offloaded to the build time, resulting in smaller JavaScript bundles combined with RSC payloads that require less client-side processing (parsing is easier, no JavaScript execution needed).
0 commit comments