-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor runtime packages to conform to the Remix server runtime inte…
…rface (#2359) * feat(@remix-run/server-runtime): define interface for remix server runtimes * refactor(@remix-run/server-runtime): organize exports group types that should be re-exported by each remix server runtime * refactor(@remix-run/server-runtime): factories for crypto-dependent interface functions * docs(@remix-run/server-runtime): rewrite readme to explain the "remix server runtime interface" * refactor(@remix-run/node): conform to the remix server runtime interface instead of relying on magic exports * refactor(@remix-run/node): implement crypto-dependent interface functions * feat(@remix-run/cloudflare): create new server runtime package for cloudflare * refactor(@remix-run/cloudflare): implement crypto-dependent interface functions * refactor(remix-deno): conform to the remix server runtime interface * refactor(remix-deno): implement crypto-dependent interface functions * refactor(@remix-run/architect): use `@remix-run/node` instead of `@remix-run/server-runtime` * refactor(@remix-run/express): use `@remix-run/node` instead of `@remix-run/server-runtime` * refactor(@remix-run/netlify): use `@remix-run/node` instead of `@remix-run/server-runtime` * refactor(@remix-run/vercel): use `@remix-run/node` instead of `@remix-run/server-runtime` * refactor(@remix-run/cloudflare-workers): use `@remix-run/cloudflare` instead of `@remix-run/server-runtime` * refactor(@remix-run/cloudflare-pages): use `@remix-run/cloudflare` instead of `@remix-run/server-runtime` * refactor(server-runtimes,adapters): remove unused `platform` arg from `createRequestHandler`
- Loading branch information
Showing
66 changed files
with
657 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
import { installGlobals } from "./globals"; | ||
|
||
export { createCloudflareKVSessionStorage } from "./sessions/cloudflareKVSessionStorage"; | ||
|
||
export type { createPagesFunctionHandlerParams } from "./worker"; | ||
export { createPagesFunctionHandler, createRequestHandler } from "./worker"; | ||
|
||
installGlobals(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Re-export everything from this package that is available in `remix`. | ||
|
||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare-pages"; | ||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
77 changes: 0 additions & 77 deletions
77
packages/remix-cloudflare-pages/sessions/cloudflareKVSessionStorage.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
import { installGlobals } from "./globals"; | ||
|
||
export { createCloudflareKVSessionStorage } from "./sessions/cloudflareKVSessionStorage"; | ||
|
||
export type { GetLoadContextFunction, RequestHandler } from "./worker"; | ||
export { | ||
createEventHandler, | ||
createRequestHandler, | ||
handleAsset, | ||
} from "./worker"; | ||
|
||
installGlobals(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Re-export everything from this package that is available in `remix`. | ||
|
||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare-workers"; | ||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://stackoverflow.com/a/59499895 | ||
export {}; | ||
|
||
declare global { | ||
interface ProcessEnv { | ||
NODE_ENV: "development" | "production" | "test"; | ||
} | ||
|
||
interface WorkerGlobalScope { | ||
process: { env: ProcessEnv }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { | ||
createCookieFactory, | ||
createCookieSessionStorageFactory, | ||
createMemorySessionStorageFactory, | ||
createSessionStorageFactory, | ||
} from "@remix-run/server-runtime"; | ||
|
||
import { sign, unsign } from "./crypto"; | ||
|
||
export const createCookie = createCookieFactory({ sign, unsign }); | ||
export const createCookieSessionStorage = createCookieSessionStorageFactory(createCookie); | ||
export const createSessionStorage = createSessionStorageFactory(createCookie); | ||
export const createMemorySessionStorage = createMemorySessionStorageFactory(createSessionStorage); |
Oops, something went wrong.