chs: re-add drifted files

This commit is contained in:
Prad Nukala committed 2026-08-15 19:00:25 -04:00
1 parent 3ba7b5fb55
commit 31ff6c0fa6
30 files changed
+742 -27

No files matched your search

@@ -84,7 +84,7 @@ let entryPreloads = await assetServer.getPreloads('app/actions/public/entry.ts')
Use this when rendering documents or layouts that boot browser behavior with a known client entry.
When resolving hydrated client entries during server rendering, pass the source entry ID from `clientEntry(import.meta.url, ...)` to `getHref()` inside `resolveClientEntry`. Keep export-name resolution in that render helper, and avoid hard-coding public asset URLs in source-owned component modules.
When resolving hydrated client entries during server rendering, pass the source entry ID from `clientEntry(import.meta.url, ...)` to `getHref()` and `getPreloads()` inside `resolveClientEntry`. Return those preload hrefs through the entry's `preloads` property so the browser can fetch the module graph without walking it serially. Keep this resolution in the shared render helper rather than hard-coding public asset URLs in source-owned component modules.
## Development vs Deployment
@@ -76,9 +76,15 @@ let stream = renderToStream(<App />, {
throw new Error(`Unable to resolve client entry export for ${entryId}`)
}
let [href, preloads] = await Promise.all([
assetServer.getHref(entryId),
assetServer.getPreloads(entryId),
])
return {
href: await assetServer.getHref(entryId),
href,
exportName,
preloads,
}
},
})
@@ -90,6 +96,8 @@ On the server, `clientEntry` components render like any other component. The ser
Client entry props must be serializable: strings, numbers, booleans, `null`, `undefined`, plain objects/arrays of the above, JSX elements, and `<Frame>` elements. Functions and class instances cannot be passed.
The resolved `preloads` array contains browser module hrefs. During server rendering these are emitted as `<link rel="modulepreload">` tags, including preloads discovered in blocking frames. When a later frame response introduces a client entry, its preloads start before the entry module is loaded.
## Booting the Client
Use `run` to start the client runtime. It scans the document for client entry markers, loads modules, and hydrates each one: