New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@remix-run/cloudflare-pages

Package Overview
Dependencies
Maintainers
0
Versions
1037
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-4111fd1-20240210 to 0.0.0-nightly-417ecc42b-20241109

193

CHANGELOG.md

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

# `@remix-run/cloudflare-pages`
# @remix-run/cloudflare-pages
## 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

@@ -4,0 +195,0 @@

2

dist/esm/index.js
/**
* @remix-run/cloudflare-pages v0.0.0-nightly-4111fd1-20240210
* @remix-run/cloudflare-pages v0.0.0-nightly-417ecc42b-20241109
*

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

/**
* @remix-run/cloudflare-pages v0.0.0-nightly-4111fd1-20240210
* @remix-run/cloudflare-pages v0.0.0-nightly-417ecc42b-20241109
*

@@ -24,10 +24,31 @@ * Copyright (c) Remix Software Inc.

mode,
getLoadContext = context => ({
env: context.env
getLoadContext = ({
context
}) => ({
...context,
cloudflare: {
...context.cloudflare,
cf: context.cloudflare.request.cf
}
})
}) {
let handleRequest = createRequestHandler$1(build, mode);
return async context => {
let loadContext = await 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);
};

@@ -34,0 +55,0 @@ }

/**
* @remix-run/cloudflare-pages v0.0.0-nightly-4111fd1-20240210
* @remix-run/cloudflare-pages v0.0.0-nightly-417ecc42b-20241109
*

@@ -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,3 +10,29 @@ * A function that returns the value to use as `context` in route `loader` and

*/
export type GetLoadContextFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>> = (context: EventContext<Env, Params, Data>) => Promise<AppLoadContext> | 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>;

@@ -13,0 +39,0 @@ export interface createPagesFunctionHandlerParams<Env = any> {

/**
* @remix-run/cloudflare-pages v0.0.0-nightly-4111fd1-20240210
* @remix-run/cloudflare-pages v0.0.0-nightly-417ecc42b-20241109
*

@@ -28,10 +28,31 @@ * Copyright (c) Remix Software Inc.

mode,
getLoadContext = context => ({
env: context.env
getLoadContext = ({
context
}) => ({
...context,
cloudflare: {
...context.cloudflare,
cf: context.cloudflare.request.cf
}
})
}) {
let handleRequest = cloudflare.createRequestHandler(build, mode);
return async context => {
let loadContext = await 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);
};

@@ -38,0 +59,0 @@ }

{
"name": "@remix-run/cloudflare-pages",
"version": "0.0.0-nightly-4111fd1-20240210",
"version": "0.0.0-nightly-417ecc42b-20241109",
"description": "Cloudflare Pages request handler for Remix",

@@ -18,3 +18,3 @@ "bugs": {

"dependencies": {
"@remix-run/cloudflare": "0.0.0-nightly-4111fd1-20240210"
"@remix-run/cloudflare": "0.0.0-nightly-417ecc42b-20241109"
},

@@ -24,2 +24,3 @@ "devDependencies": {

"@types/mime": "^2.0.3",
"@types/node": "^18.17.1",
"typescript": "^5.1.0"

@@ -44,3 +45,6 @@ },

"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