Skip to content

Commit

Permalink
Fix EntryContext typings
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Mar 12, 2024
1 parent 8e53388 commit f672242
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/remix-react/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export interface RemixContextObject {
abortDelay?: number;
serializeError?(error: Error): SerializedError;
renderMeta?: {
didRenderScripts: boolean;
streamCache: Record<
didRenderScripts?: boolean;
streamCache?: Record<
number,
Promise<void> & {
result?: {
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-react/single-fetch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function StreamTransfer({
}: StreamTransferProps) {
// If the user didn't render the <Scripts> component then we don't have to
// bother streaming anything in
if (!context.renderMeta?.didRenderScripts) {
if (!context.renderMeta || !context.renderMeta.didRenderScripts) {
return null;
}

Expand Down
14 changes: 13 additions & 1 deletion packages/remix-server-runtime/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ export interface EntryContext {
criticalCss?: string;
serverHandoffString?: string;
serverHandoffStream?: ReadableStream<Uint8Array>;
renderMeta?: { didRenderScripts: boolean };
renderMeta?: {
didRenderScripts?: boolean;
streamCache?: Record<
number,
Promise<void> & {
result?: {
done: boolean;
value: string;
};
error?: unknown;
}
>;
};
staticHandlerContext: StaticHandlerContext;
future: FutureConfig;
isSpaMode: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-server-runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ async function handleDocumentRequest(
build.entry.module.streamTimeout,
serverMode
),
renderMeta: { didRenderScripts: false },
renderMeta: {},
}
: null),
future: build.future,
Expand Down Expand Up @@ -663,7 +663,7 @@ async function handleDocumentRequest(
build.entry.module.streamTimeout,
serverMode
),
renderMeta: { didRenderScripts: false },
renderMeta: {},
}
: null),
};
Expand Down

0 comments on commit f672242

Please sign in to comment.