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

@astrojs/cloudflare

Package Overview
Dependencies
Maintainers
4
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/cloudflare - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

6

CHANGELOG.md
# @astrojs/cloudflare
## 0.2.1
### Patch Changes
- [#3695](https://github.com/withastro/astro/pull/3695) [`0d667d0e`](https://github.com/withastro/astro/commit/0d667d0e572d76d4c819816ddf51ed14b43e2551) Thanks [@nrgnrg](https://github.com/nrgnrg)! - fix custom 404 pages not rendering
## 0.2.0

@@ -4,0 +10,0 @@

4

dist/server.js

@@ -14,2 +14,6 @@ import "./shim.js";

}
const _404Request = new Request(`${origin}/404`, request);
if (app.match(_404Request)) {
return app.render(_404Request);
}
return new Response(null, {

@@ -16,0 +20,0 @@ status: 404,

4

package.json
{
"name": "@astrojs/cloudflare",
"description": "Deploy your site to cloudflare pages functions",
"version": "0.2.0",
"version": "0.2.1",
"type": "module",

@@ -25,3 +25,3 @@ "types": "./dist/index.d.ts",

"devDependencies": {
"astro": "1.0.0-beta.47",
"astro": "1.0.0-beta.55",
"astro-scripts": "0.0.4"

@@ -28,0 +28,0 @@ },

@@ -25,1 +25,9 @@ # @astrojs/cloudflare

It's then possible to update the preview script in your `package.json` to `"preview": "wrangler pages dev ./dist"`
## Streams
Some integrations such as (react)[https://github.com/withastro/astro/tree/main/packages/integrations/react] rely on web streams. Currently Cloudflare Pages functions are in beta and don't support the `streams_enable_constructors` feature flag.
In order to work around this:
- install the `"web-streams-polyfill"` package
- add `import "web-streams-polyfill/es2018";` to the top of the front matter of every page which requires streams, such as server rendering a React component.

@@ -27,2 +27,7 @@ import './shim.js';

// 404
const _404Request = new Request(`${origin}/404`, request);
if (app.match(_404Request)) {
return app.render(_404Request);
}
return new Response(null, {

@@ -29,0 +34,0 @@ status: 404,

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