Skip to content

Commit

Permalink
refactor(remix-cloudflare-workers): bring RequestHandler in line wi…
Browse files Browse the repository at this point in the history
…th other adapters (#4884)

* refactor(remix-cloudflare-workers): bring `RequestHandler` in line with other adapters

* Create afraid-hounds-join.md

Co-authored-by: Logan McAnsh <[email protected]>
  • Loading branch information
MichaelDeBoey and mcansh authored Jan 21, 2023
1 parent 52d60ec commit 3fd5c99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/afraid-hounds-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"remix": patch
"@remix-run/cloudflare": patch
"@remix-run/cloudflare-workers": patch
---

Update Cloudflare Workers adapter's `RequestHandler` type to be in line with other adapters
4 changes: 2 additions & 2 deletions packages/remix-cloudflare-workers/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { createRequestHandler as createRemixRequestHandler } from "@remix-run/cl
*/
export type GetLoadContextFunction = (event: FetchEvent) => AppLoadContext;

export type RequestHandler = ReturnType<typeof createRequestHandler>;
export type RequestHandler = (event: FetchEvent) => Promise<Response>;

/**
* Returns a request handler for the Cloudflare runtime that serves the
Expand All @@ -33,7 +33,7 @@ export function createRequestHandler({
build: ServerBuild;
getLoadContext?: GetLoadContextFunction;
mode?: string;
}) {
}): RequestHandler {
let handleRequest = createRemixRequestHandler(build, mode);

return (event: FetchEvent) => {
Expand Down

0 comments on commit 3fd5c99

Please sign in to comment.