Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite: Cloudflare Proxy plugin #8749

Merged
merged 24 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
caches and dispose
  • Loading branch information
pcattori committed Feb 14, 2024
commit 6e9ccec70fa886619a8f9721d75dff046786116b
5 changes: 3 additions & 2 deletions integration/vite-cloudflare-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ const files: Files = async ({ port }) => ({
import { type AppLoadContext } from "@remix-run/cloudflare";
import { type PlatformProxy } from "wrangler";

type Cloudflare = PlatformProxy<{
type Env = {
MY_KV: KVNamespace;
}>;
}
type Cloudflare = Omit<PlatformProxy<Env>, 'dispose'>;

declare module "@remix-run/cloudflare" {
export interface AppLoadContext {
Expand Down
3 changes: 3 additions & 0 deletions packages/remix-cloudflare-pages/worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { AppLoadContext, ServerBuild } from "@remix-run/cloudflare";
import { createRequestHandler as createRemixRequestHandler } from "@remix-run/cloudflare";
import { type CacheStorage } from "@cloudflare/workers-types";

/**
* A function that returns the value to use as `context` in route `loader` and
Expand All @@ -25,6 +26,7 @@ export type GetLoadContextFunction<
Data
>["passThroughOnException"];
};
caches: CacheStorage;
};
};
}) => AppLoadContext | Promise<AppLoadContext>;
Expand Down Expand Up @@ -61,6 +63,7 @@ export function createRequestHandler<Env = any>({
waitUntil: cloudflare.waitUntil,
passThroughOnException: cloudflare.passThroughOnException,
},
caches,
},
},
});
Expand Down
Loading