@remix-run/cloudflare-pages
Advanced tools
Comparing version 0.0.0-experimental-9e5da5b0 to 0.0.0-experimental-a04f3d18
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -11,6 +11,2 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
import { installGlobals } from './globals.js'; | ||
export { createCloudflareKVSessionStorage } from './sessions/cloudflareKVSessionStorage.js'; | ||
export { createPagesFunctionHandler, createRequestHandler } from './worker.js'; | ||
installGlobals(); |
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -11,4 +11,12 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
import { createRequestHandler as createRequestHandler$1 } from '@remix-run/server-runtime'; | ||
import { createRequestHandler as createRequestHandler$1 } from '@remix-run/cloudflare'; | ||
/** | ||
* A function that returns the value to use as `context` in route `loader` and | ||
* `action` functions. | ||
* | ||
* You can think of this as an escape hatch that allows you to pass | ||
* environment/platform-specific values through to your loader/action. | ||
*/ | ||
function createRequestHandler({ | ||
@@ -19,4 +27,3 @@ build, | ||
}) { | ||
let platform = {}; | ||
let handleRequest = createRequestHandler$1(build, platform, mode); | ||
let handleRequest = createRequestHandler$1(build, mode); | ||
return context => { | ||
@@ -32,3 +39,3 @@ let loadContext = typeof getLoadContext === "function" ? getLoadContext(context) : undefined; | ||
}) { | ||
const handleRequest = createRequestHandler({ | ||
let handleRequest = createRequestHandler({ | ||
build, | ||
@@ -39,3 +46,3 @@ getLoadContext, | ||
const handleFetch = async context => { | ||
let handleFetch = async context => { | ||
let response; // https://github.com/cloudflare/wrangler2/issues/117 | ||
@@ -42,0 +49,0 @@ |
@@ -1,3 +0,2 @@ | ||
export { createCloudflareKVSessionStorage } from "./sessions/cloudflareKVSessionStorage"; | ||
export type { createPagesFunctionHandlerParams } from "./worker"; | ||
export type { createPagesFunctionHandlerParams, GetLoadContextFunction, RequestHandler, } from "./worker"; | ||
export { createPagesFunctionHandler, createRequestHandler } from "./worker"; |
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -15,10 +15,7 @@ * Copyright (c) Remix Software Inc. | ||
var globals = require('./globals.js'); | ||
var cloudflareKVSessionStorage = require('./sessions/cloudflareKVSessionStorage.js'); | ||
var worker = require('./worker.js'); | ||
globals.installGlobals(); | ||
exports.createCloudflareKVSessionStorage = cloudflareKVSessionStorage.createCloudflareKVSessionStorage; | ||
exports.createPagesFunctionHandler = worker.createPagesFunctionHandler; | ||
exports.createRequestHandler = worker.createRequestHandler; |
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -11,2 +11,2 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
export { createCloudflareKVSessionStorage } from '@remix-run/cloudflare-pages'; | ||
export { createCloudflareKVSessionStorage } from '@remix-run/cloudflare'; |
@@ -1,1 +0,1 @@ | ||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare-pages"; | ||
export { createCloudflareKVSessionStorage } from "@remix-run/cloudflare"; |
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -15,3 +15,3 @@ * Copyright (c) Remix Software Inc. | ||
var cloudflarePages = require('@remix-run/cloudflare-pages'); | ||
var cloudflare = require('@remix-run/cloudflare'); | ||
@@ -22,3 +22,3 @@ | ||
enumerable: true, | ||
get: function () { return cloudflarePages.createCloudflareKVSessionStorage; } | ||
get: function () { return cloudflare.createCloudflareKVSessionStorage; } | ||
}); |
{ | ||
"name": "@remix-run/cloudflare-pages", | ||
"description": "Cloudflare Pages request handler for Remix", | ||
"version": "0.0.0-experimental-9e5da5b0", | ||
"version": "0.0.0-experimental-a04f3d18", | ||
"license": "MIT", | ||
@@ -17,11 +17,11 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@remix-run/server-runtime": "0.0.0-experimental-9e5da5b0" | ||
"@remix-run/cloudflare": "0.0.0-experimental-a04f3d18" | ||
}, | ||
"peerDependencies": { | ||
"@cloudflare/workers-types": "^3.2.0" | ||
"@cloudflare/workers-types": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^3.2.0", | ||
"@cloudflare/workers-types": "^3.4.0", | ||
"@types/mime": "^2.0.3" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # Welcome to Remix! | ||
```sh | ||
$ npx create-remix@latest | ||
npx create-remix@latest | ||
``` | ||
@@ -11,0 +11,0 @@ |
/// <reference types="@cloudflare/workers-types" /> | ||
import type { ServerBuild, AppLoadContext } from "@remix-run/server-runtime"; | ||
import type { AppLoadContext, ServerBuild } from "@remix-run/cloudflare"; | ||
/** | ||
* A function that returns the value to use as `context` in route `loader` and | ||
* `action` functions. | ||
* | ||
* You can think of this as an escape hatch that allows you to pass | ||
* environment/platform-specific values through to your loader/action. | ||
*/ | ||
export declare type GetLoadContextFunction<Env = any> = (context: EventContext<Env, any, any>) => AppLoadContext; | ||
export declare type RequestHandler<Env = any> = PagesFunction<Env>; | ||
export interface createPagesFunctionHandlerParams<Env = any> { | ||
build: ServerBuild; | ||
getLoadContext?: (context: EventContext<Env, any, any>) => AppLoadContext; | ||
getLoadContext?: GetLoadContextFunction<Env>; | ||
mode?: string; | ||
} | ||
export declare function createRequestHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): PagesFunction<Env>; | ||
export declare function createRequestHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): RequestHandler<Env>; | ||
export declare function createPagesFunctionHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): (context: EventContext<Env, any, any>) => Promise<Response>; |
/** | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-9e5da5b0 | ||
* @remix-run/cloudflare-pages v0.0.0-experimental-a04f3d18 | ||
* | ||
@@ -15,4 +15,12 @@ * Copyright (c) Remix Software Inc. | ||
var serverRuntime = require('@remix-run/server-runtime'); | ||
var cloudflare = require('@remix-run/cloudflare'); | ||
/** | ||
* A function that returns the value to use as `context` in route `loader` and | ||
* `action` functions. | ||
* | ||
* You can think of this as an escape hatch that allows you to pass | ||
* environment/platform-specific values through to your loader/action. | ||
*/ | ||
function createRequestHandler({ | ||
@@ -23,4 +31,3 @@ build, | ||
}) { | ||
let platform = {}; | ||
let handleRequest = serverRuntime.createRequestHandler(build, platform, mode); | ||
let handleRequest = cloudflare.createRequestHandler(build, mode); | ||
return context => { | ||
@@ -36,3 +43,3 @@ let loadContext = typeof getLoadContext === "function" ? getLoadContext(context) : undefined; | ||
}) { | ||
const handleRequest = createRequestHandler({ | ||
let handleRequest = createRequestHandler({ | ||
build, | ||
@@ -43,3 +50,3 @@ getLoadContext, | ||
const handleFetch = async context => { | ||
let handleFetch = async context => { | ||
let response; // https://github.com/cloudflare/wrangler2/issues/117 | ||
@@ -46,0 +53,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9342
12
214
1
+ Added@cloudflare/kv-asset-handler@0.1.3(transitive)
+ Added@remix-run/cloudflare@0.0.0-experimental-a04f3d18(transitive)
+ Added@remix-run/server-runtime@0.0.0-experimental-a04f3d18(transitive)
+ Addedmime@2.6.0(transitive)
- Removed@remix-run/server-runtime@0.0.0-experimental-9e5da5b0
- Removed@remix-run/server-runtime@0.0.0-experimental-9e5da5b0(transitive)