Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remix-run/cloudflare-pages

Package Overview
Dependencies
Maintainers
2
Versions
1020
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/cloudflare-pages - npm Package Compare versions

Comparing version 0.0.0-nightly-9af8868-20230412 to 0.0.0-nightly-9bc6d9517-20241206

362

CHANGELOG.md
# `@remix-run/cloudflare-pages`
## 2.15.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.15.0`
## 2.14.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.14.0`
## 2.13.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.13.1`
## 2.13.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.13.0`
## 2.12.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.12.1`
## 2.12.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.12.0`
## 2.11.2
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.11.2`
## 2.11.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.11.1`
## 2.11.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.11.0`
## 2.10.3
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.10.3`
## 2.10.2
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.10.2`
## 2.10.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.10.1`
## 2.10.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.10.0`
## 2.9.2
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.9.2`
## 2.9.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.9.1`
## 2.9.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.9.0`
## 2.8.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.8.1`
## 2.8.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.8.0`
## 2.7.2
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.7.2`
## 2.7.1
### Patch Changes
- Fix breaking change for `@remix-run/cloudflare-pages` ([#8819](https://github.com/remix-run/remix/pull/8819))
Restore Cloudflare event context fields in `getLoadContext` argument for backwards compatibility.
- Updated dependencies:
- `@remix-run/cloudflare@2.7.1`
## 2.7.0
### Minor Changes
- Make `getLoadContext` optional for Cloudflare Pages ([#8701](https://github.com/remix-run/remix/pull/8701))
Defaults to `(context) => ({ env: context })`, which is what we used to have in all the templates.
This gives parity with the Cloudflare preset for the Remix Vite plugin and keeps our templates leaner.
- Vite: Cloudflare Proxy as a Vite plugin ([#8749](https://github.com/remix-run/remix/pull/8749))
**This is a breaking change for projects relying on Cloudflare support from the unstable Vite plugin**
The Cloudflare preset (`unstable_cloudflarePreset`) as been removed and replaced with a new Vite plugin:
```diff
import {
unstable_vitePlugin as remix,
- unstable_cloudflarePreset as cloudflare,
+ cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
} from "@remix-run/dev";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
+ remixCloudflareDevProxy(),
+ remix(),
- remix({
- presets: [cloudflare()],
- }),
],
- ssr: {
- resolve: {
- externalConditions: ["workerd", "worker"],
- },
- },
});
```
`remixCloudflareDevProxy` must come _before_ the `remix` plugin so that it can override Vite's dev server middleware to be compatible with Cloudflare's proxied environment.
Because it is a Vite plugin, `remixCloudflareDevProxy` can set `ssr.resolve.externalConditions` to be `workerd`-compatible for you.
`remixCloudflareDevProxy` accepts a `getLoadContext` function that replaces the old `getRemixDevLoadContext`.
If you were using a `nightly` version that required `getBindingsProxy` or `getPlatformProxy`, that is no longer required.
Any options you were passing to `getBindingsProxy` or `getPlatformProxy` should now be passed to `remixCloudflareDevProxy` instead.
This API also better aligns with future plans to support Cloudflare with a framework-agnostic Vite plugin that makes use of Vite's (experimental) Runtime API.
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.7.0`
## 2.6.0
### Patch Changes
- Vite: Cloudflare Pages support ([#8531](https://github.com/remix-run/remix/pull/8531))
To get started with Cloudflare, you can use the \[`unstable-vite-cloudflare`]\[template-vite-cloudflare] template:
```shellscript nonumber
npx create-remix@latest --template remix-run/remix/templates/unstable-vite-cloudflare
```
Or read the new docs at [Future > Vite > Cloudflare](https://remix.run/docs/en/main/future/vite#cloudflare) and
[Future > Vite > Migrating > Migrating Cloudflare Functions](https://remix.run/docs/en/main/future/vite#migrating-cloudflare-functions).
- Updated dependencies:
- `@remix-run/cloudflare@2.6.0`
## 2.5.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.5.1`
## 2.5.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.5.0`
## 2.4.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.4.1`
## 2.4.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.4.0`
## 2.3.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.3.1`
## 2.3.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.3.0`
## 2.2.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.2.0`
## 2.1.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.1.0`
## 2.0.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.0.1`
## 2.0.0
### Major Changes
- Require Node >=18.0.0 ([#6939](https://github.com/remix-run/remix/pull/6939))
- Drop `@cloudflare/workers-types` v2 & v3 support ([#6925](https://github.com/remix-run/remix/pull/6925))
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@2.0.0`
## 1.19.3
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.19.3`
## 1.19.2
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.19.2`
## 1.19.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.19.1`
## 1.19.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.19.0`
## 1.18.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.18.1`
## 1.18.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.18.0`
## 1.17.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.17.1`
## 1.17.0
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.17.0`
## 1.16.1
### Patch Changes
- Updated dependencies:
- `@remix-run/cloudflare@1.16.1`
## 1.16.0
### Patch Changes
- feat: support async `getLoadContext` in all adapters ([#6170](https://github.com/remix-run/remix/pull/6170))
- Updated dependencies:
- `@remix-run/cloudflare@1.16.0`
## 1.15.0

@@ -4,0 +366,0 @@

2

dist/esm/index.js
/**
* @remix-run/cloudflare-pages v0.0.0-nightly-9af8868-20230412
* @remix-run/cloudflare-pages v0.0.0-nightly-9bc6d9517-20241206
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-nightly-9af8868-20230412
* @remix-run/cloudflare-pages v0.0.0-nightly-9bc6d9517-20241206
*

@@ -23,9 +23,32 @@ * Copyright (c) Remix Software Inc.

build,
getLoadContext,
mode
mode,
getLoadContext = ({
context
}) => ({
...context,
cloudflare: {
...context.cloudflare,
cf: context.cloudflare.request.cf
}
})
}) {
let handleRequest = createRequestHandler$1(build, mode);
return context => {
let loadContext = getLoadContext === null || getLoadContext === void 0 ? void 0 : getLoadContext(context);
return handleRequest(context.request, loadContext);
return async cloudflare => {
let loadContext = await getLoadContext({
...cloudflare,
// Backcompat, remove in v3
request: cloudflare.request,
context: {
cloudflare: {
...cloudflare,
cf: cloudflare.request.cf,
ctx: {
waitUntil: cloudflare.waitUntil,
passThroughOnException: cloudflare.passThroughOnException
},
caches
}
}
});
return handleRequest(cloudflare.request, loadContext);
};

@@ -32,0 +55,0 @@ }

/**
* @remix-run/cloudflare-pages v0.0.0-nightly-9af8868-20230412
* @remix-run/cloudflare-pages v0.0.0-nightly-9bc6d9517-20241206
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

@@ -1,3 +0,3 @@

/// <reference types="@cloudflare/workers-types" />
import type { AppLoadContext, ServerBuild } from "@remix-run/cloudflare";
import { type CacheStorage } from "@cloudflare/workers-types";
/**

@@ -10,10 +10,36 @@ * A function that returns the value to use as `context` in route `loader` and

*/
export type GetLoadContextFunction<Env = unknown> = (context: Parameters<PagesFunction<Env>>[0]) => AppLoadContext;
export type GetLoadContextFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>> = (args: {
/** @deprecated use `context.cloudflare.env` instead */
env: EventContext<Env, Params, Data>["env"];
/** @deprecated use `context.cloudflare.functionPath` instead */
functionPath: EventContext<Env, Params, Data>["functionPath"];
/** @deprecated use `context.cloudflare.waitUntil` instead */
waitUntil: EventContext<Env, Params, Data>["waitUntil"];
/** @deprecated use `context.cloudflare.passThroughOnException` instead */
passThroughOnException: EventContext<Env, Params, Data>["passThroughOnException"];
/** @deprecated use `context.cloudflare.next` instead */
next: EventContext<Env, Params, Data>["next"];
/** @deprecated use `context.cloudflare.params` instead */
params: EventContext<Env, Params, Data>["params"];
/** @deprecated use `context.cloudflare.data` instead */
data: EventContext<Env, Params, Data>["data"];
request: Request;
context: {
cloudflare: EventContext<Env, Params, Data> & {
cf: EventContext<Env, Params, Data>["request"]["cf"];
ctx: {
waitUntil: EventContext<Env, Params, Data>["waitUntil"];
passThroughOnException: EventContext<Env, Params, Data>["passThroughOnException"];
};
caches: CacheStorage;
};
};
}) => AppLoadContext | Promise<AppLoadContext>;
export type RequestHandler<Env = any> = PagesFunction<Env>;
export interface createPagesFunctionHandlerParams<Env = any> {
build: ServerBuild;
build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>);
getLoadContext?: GetLoadContextFunction<Env>;
mode?: string;
}
export declare function createRequestHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): RequestHandler<Env>;
export declare function createRequestHandler<Env = any>({ build, mode, getLoadContext, }: 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-nightly-9af8868-20230412
* @remix-run/cloudflare-pages v0.0.0-nightly-9bc6d9517-20241206
*

@@ -27,9 +27,32 @@ * Copyright (c) Remix Software Inc.

build,
getLoadContext,
mode
mode,
getLoadContext = ({
context
}) => ({
...context,
cloudflare: {
...context.cloudflare,
cf: context.cloudflare.request.cf
}
})
}) {
let handleRequest = cloudflare.createRequestHandler(build, mode);
return context => {
let loadContext = getLoadContext === null || getLoadContext === void 0 ? void 0 : getLoadContext(context);
return handleRequest(context.request, loadContext);
return async cloudflare => {
let loadContext = await getLoadContext({
...cloudflare,
// Backcompat, remove in v3
request: cloudflare.request,
context: {
cloudflare: {
...cloudflare,
cf: cloudflare.request.cf,
ctx: {
waitUntil: cloudflare.waitUntil,
passThroughOnException: cloudflare.passThroughOnException
},
caches
}
}
});
return handleRequest(cloudflare.request, loadContext);
};

@@ -36,0 +59,0 @@ }

@@ -1,7 +0,22 @@

Copyright 2021 Remix Software Inc.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) Remix Software Inc. 2020-2021
Copyright (c) Shopify Inc. 2022-2024
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "@remix-run/cloudflare-pages",
"version": "0.0.0-nightly-9af8868-20230412",
"version": "0.0.0-nightly-9bc6d9517-20241206",
"description": "Cloudflare Pages request handler for Remix",

@@ -18,13 +18,21 @@ "bugs": {

"dependencies": {
"@remix-run/cloudflare": "0.0.0-nightly-9af8868-20230412"
"@remix-run/cloudflare": "0.0.0-nightly-9bc6d9517-20241206"
},
"devDependencies": {
"@cloudflare/workers-types": "^3.4.0",
"@types/mime": "^2.0.3"
"@cloudflare/workers-types": "^4.20230518.0",
"@types/mime": "^2.0.3",
"@types/node": "^18.17.1",
"typescript": "^5.1.0"
},
"peerDependencies": {
"@cloudflare/workers-types": "^3.0.0"
"@cloudflare/workers-types": "^4.0.0",
"typescript": "^5.1.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"engines": {
"node": ">=14"
"node": ">=18.0.0"
},

@@ -36,3 +44,6 @@ "files": [

"README.md"
]
}
],
"scripts": {
"tsc": "tsc"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc