Skip to content

Commit

Permalink
fix(server-runtime): mark critical CSS arg private (#7814)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Oct 30, 2023
1 parent 28ac1db commit a71411b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/remix-dev/vite/node/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export let createRequestHandler = (
let handler = createBaseRequestHandler(build, mode);
return async (req: IncomingMessage, res: ServerResponse) => {
let request = createRequest(req);
let response = await handler(request, {}, { criticalCss });
let response = await handler(request, {}, { __criticalCss: criticalCss });
handleNodeResponse(response, res);
};
};
9 changes: 7 additions & 2 deletions packages/remix-server-runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ import { createServerHandoffString } from "./serverHandoff";
export type RequestHandler = (
request: Request,
loadContext?: AppLoadContext,
args?: { criticalCss?: string }
args?: {
/**
* @private This is an internal API intended for use by the Remix Vite plugin in dev mode
*/
__criticalCss?: string;
}
) => Promise<Response>;

export type CreateRequestHandlerFunction = (
Expand Down Expand Up @@ -78,7 +83,7 @@ export const createRequestHandler: CreateRequestHandlerFunction = (
return async function requestHandler(
request,
loadContext = {},
{ criticalCss } = {}
{ __criticalCss: criticalCss } = {}
) {
_build = typeof build === "function" ? await build() : build;
if (typeof build === "function") {
Expand Down

0 comments on commit a71411b

Please sign in to comment.