Skip to content

Commit

Permalink
refactor(server-runtimes,adapters): remove unused platform arg from…
Browse files Browse the repository at this point in the history
… `createRequestHandler`
  • Loading branch information
pcattori committed Mar 21, 2022
1 parent 3f976a2 commit bd2fadf
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 86 deletions.
4 changes: 1 addition & 3 deletions packages/remix-architect/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {
import type {
AppLoadContext,
ServerBuild,
ServerPlatform,
Response as NodeResponse,
} from "@remix-run/node";

Expand Down Expand Up @@ -46,8 +45,7 @@ export function createRequestHandler({
getLoadContext?: GetLoadContextFunction;
mode?: string;
}): APIGatewayProxyHandlerV2 {
let platform: ServerPlatform = {};
let handleRequest = createRemixRequestHandler(build, platform, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return async (event, _context) => {
let abortController = new AbortController();
Expand Down
3 changes: 1 addition & 2 deletions packages/remix-cloudflare-pages/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export function createRequestHandler<Env = any>({
getLoadContext,
mode,
}: createPagesFunctionHandlerParams<Env>): PagesFunction<Env> {
let platform = {};
let handleRequest = createRemixRequestHandler(build, platform, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return (context) => {
let loadContext =
Expand Down
4 changes: 1 addition & 3 deletions packages/remix-cloudflare-workers/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
import type {
AppLoadContext,
ServerBuild,
ServerPlatform,
} from "@remix-run/cloudflare";
import { createRequestHandler as createRemixRequestHandler } from "@remix-run/cloudflare";

Expand Down Expand Up @@ -37,8 +36,7 @@ export function createRequestHandler({
getLoadContext?: GetLoadContextFunction;
mode?: string;
}) {
let platform: ServerPlatform = {};
let handleRequest = createRemixRequestHandler(build, platform, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return (event: FetchEvent) => {
let loadContext =
Expand Down
1 change: 0 additions & 1 deletion packages/remix-cloudflare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export type {
RouteHandle,
ServerBuild,
ServerEntryModule,
ServerPlatform,
Session,
SessionData,
SessionIdStorageStrategy,
Expand Down
4 changes: 1 addition & 3 deletions packages/remix-express/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type * as express from "express";
import type {
AppLoadContext,
ServerBuild,
ServerPlatform,
RequestInit as NodeRequestInit,
Response as NodeResponse,
} from "@remix-run/node";
Expand Down Expand Up @@ -41,8 +40,7 @@ export function createRequestHandler({
getLoadContext?: GetLoadContextFunction;
mode?: string;
}) {
let platform: ServerPlatform = {};
let handleRequest = createRemixRequestHandler(build, platform, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return async (
req: express.Request,
Expand Down
4 changes: 1 addition & 3 deletions packages/remix-netlify/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {
import type {
AppLoadContext,
ServerBuild,
ServerPlatform,
Response as NodeResponse,
RequestInit as NodeRequestInit,
} from "@remix-run/node";
Expand Down Expand Up @@ -43,8 +42,7 @@ export function createRequestHandler({
getLoadContext?: AppLoadContext;
mode?: string;
}): Handler {
let platform: ServerPlatform = {};
let handleRequest = createRemixRequestHandler(build, platform, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return async (event, context) => {
let abortController = new AbortController();
Expand Down
1 change: 0 additions & 1 deletion packages/remix-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export type {
RouteHandle,
ServerBuild,
ServerEntryModule,
ServerPlatform,
Session,
SessionData,
SessionIdStorageStrategy,
Expand Down
Loading

0 comments on commit bd2fadf

Please sign in to comment.