Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a6ff1e2
Checkpoint
matthewp May 26, 2026
e2f7d7a
Merge main into cloudflare-migration
matthewp May 28, 2026
fdec2d3
Remove Netlify config, use R2 for large assets via site-assets.astro.…
matthewp May 28, 2026
6dcfcab
Add advanced routing to proxy /fonts/* to fonts-cdn.astro.build
matthewp May 28, 2026
dd77cab
Trigger Workers Build
matthewp May 28, 2026
850ca09
Trigger Workers Build (2)
matthewp May 28, 2026
080e4e6
Move IntegrationCategories out of content.config to avoid bundling gl…
matthewp May 28, 2026
df8cac3
Add request logging to app.ts
matthewp May 28, 2026
43c3721
Add verbose request and fetch logging
matthewp May 28, 2026
d91ca95
Log response body on non-ok fetch responses
matthewp May 28, 2026
8d71e9e
Trigger rebuild
matthewp May 28, 2026
4d2e761
Fix: change not_found_handling to none so SSR routes reach the worker
matthewp May 28, 2026
1865960
Strip wrangler.jsonc down to custom config only, let adapter handle t…
matthewp May 28, 2026
02eccd8
Add extensive logging to app.ts
matthewp May 28, 2026
604a55e
Fix: remove env param from fetch signature
matthewp May 28, 2026
514ade4
Enable node compat flag
matthewp May 29, 2026
31dae02
Pre-bundle @iconify/utils for workerd compatibility
matthewp May 29, 2026
d969527
Use prerenderEnvironment: 'node' to avoid CJS/workerd incompatibiliti…
matthewp May 29, 2026
2e54f5f
Remove app.ts and advancedRouting, no longer needed
matthewp May 29, 2026
178477d
Pre-bundle CJS deps for workerd compatibility (expressive-code, iconify)
matthewp May 29, 2026
947d158
Trigger rebuild
matthewp May 29, 2026
937517d
Revert to prerenderEnvironment: node
matthewp May 29, 2026
f3402eb
Merge main into cloudflare-migration
matthewp Jun 5, 2026
251286d
Address review: prerender themes/integrations/agencies, add fonts pro…
matthewp Jun 8, 2026
e26bd79
Revert dynamic routes back to SSR, keep only themes/agencies index pr…
matthewp Jun 8, 2026
f8a8558
Merge main into cloudflare-migration
matthewp Jun 8, 2026
23d26b1
Use fonts-cdn.astro.build directly with preconnect, remove app.ts proxy
matthewp Jun 9, 2026
7f11920
Merge main into cloudflare-migration
matthewp Jun 9, 2026
35c8d3d
Update src/pages/agencies/index.astro
matthewp Jun 10, 2026
f0edf23
Fix preview site URL to use WORKERS_CI_BRANCH env var
matthewp Jun 10, 2026
4aafcb8
Revert themes index to SSR for redirect support
matthewp Jun 10, 2026
0529168
Optimize astro-expressive-code
matthewp Jun 11, 2026
1089ce1
Add non-trailing-slash variants for all redirects
matthewp Jun 11, 2026
8ee6041
Merge remote-tracking branch 'origin/main' into cloudflare-migration
matthewp Jun 11, 2026
cbcea5f
Remove sharp image service patch
matthewp Jun 11, 2026
53fd01d
Remove astro patch from lockfile
matthewp Jun 11, 2026
59536a1
Remove astro patch from pnpm
matthewp Jun 11, 2026
be90647
Remove astro patch from pnpm-workspace.yaml
matthewp Jun 11, 2026
d13a2bd
Fix expressive code: use JS regex engine and add postcss-nested to op…
matthewp Jun 12, 2026
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
18 changes: 18 additions & 0 deletions .github/workflows/worker-build-logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Worker Build Logs

on:
push:
branches: ["**"]

jobs:
build-logs:
if: github.repository == 'withastro/astro.build'
name: Cloudflare Worker Build
runs-on: ubuntu-latest
steps:
- name: Stream Workers Builds Logs
uses: withastro/workers-builds-log-action@v1
with:
api-token: ${{ secrets.CF_BUILDS_API_TOKEN }}
account-id: ${{ secrets.CF_ACCOUNT_ID }}
worker-tag: ${{ secrets.CF_WORKER_TAG }}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store

# Local Netlify folder
.netlify
# Local Wrangler folder
.wrangler

# Local Vercel folder
.vercel

# JetBrains files
.idea
.idea

# Generated Cloudflare types
worker-configuration.d.ts
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,28 @@ Integration data is updated weekly by a [GitHub Action](/.github/workflows/weekl
The [blog collection](/src/content/blog/) is setup to support MDX blog posts with all images being pulled from the collection's [\_images directory](/src/content/blog/_images/). Images should be a `webp` format of a reasonable width, something in the 800-1600px range is ideal.

Blog post cover and social images are set as frontmatter properties and should point reference the `_images` directory, ex: `coverImage: "/src/content/blog/_images/post-1/cover.webp"`.

## Contributing

### Large Static Assets

Cloudflare Workers has a 25 MB per-file size limit for static assets. Files that exceed this limit are hosted on an R2 bucket and served via `site-assets.astro.build`.

To upload a new large asset (requires access to the Cloudflare account):

1. Install [Wrangler](https://developers.cloudflare.com/workers/wrangler/) and log in if you haven't already:
```sh
pnpm add -g wrangler
wrangler login
```

2. Upload the file to the `site-assets` R2 bucket:
```sh
wrangler r2 object put site-assets/<path> --file <local-file> --content-type <mime-type>
```
For example:
```sh
wrangler r2 object put site-assets/blog/launch-video.mp4 --file ./launch-video.mp4 --content-type video/mp4
```

3. Reference the file using `https://site-assets.astro.build/<path>` in your source code.
36 changes: 30 additions & 6 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
// @ts-check

import mdx from '@astrojs/mdx';
import netlify from '@astrojs/netlify';
import cloudflare from '@astrojs/cloudflare';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import { defineConfig } from 'astro/config';
import { defineConfig, sessionDrivers } from 'astro/config';
import astroExpressiveCode from 'astro-expressive-code';
import icon from 'astro-icon';
import houston from './houston.theme.json';

/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
/* On Cloudflare Workers Builds, WORKERS_CI_BRANCH is set to the branch name for non-production deploys */
const PREVIEW_SITE = process.env.WORKERS_CI_BRANCH
? `https://${process.env.WORKERS_CI_BRANCH}.previews.astro.build`
: undefined;
Comment on lines +12 to +15

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder for us to double check this once the PR merges.


// https://astro.build/config
export default defineConfig({
site: NETLIFY_PREVIEW_SITE || 'https://astro.build',
site: PREVIEW_SITE || 'https://astro.build',
prefetch: true,
integrations: [
tailwind({
applyBaseStyles: false,
}),
astroExpressiveCode({
themes: [houston],
shiki: { engine: 'javascript' },
styleOverrides: {
borderRadius: '0.375rem',
borderColor: 'rgb(84 88 100)',
Expand Down Expand Up @@ -56,8 +59,29 @@ export default defineConfig({
ssr: {
noExternal: ['smartypants'],
},
optimizeDeps: {
include: [
'astro-icon > @iconify/utils > debug',
// TODO: once Expressive Code is refactored/fixed, remove this workaround for
// Expressive Code relying on CJS dependencies like postcss not compatible
// with non-Node.js compatible environments like Cloudflare.
'astro-expressive-code/components',
'astro-expressive-code>hast-util-select',
'astro-expressive-code>rehype',
'astro-expressive-code>unist-util-visit',
'astro-expressive-code>rehype-format',
'astro-expressive-code>hastscript',
'astro-expressive-code>hast-util-from-html',
'astro-expressive-code>hast-util-to-string',
'astro-expressive-code>@expressive-code/core>postcss',
Comment thread
delucis marked this conversation as resolved.
'astro-expressive-code>@expressive-code/core>postcss-nested',
],
},
},
adapter: netlify({ imageCDN: false }),
adapter: cloudflare({
imageService: 'cloudflare-binding',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that images feel noticeably slower in the preview deploy. I think this is because Netlify had a kind of hybrid set-up:

  • images on static pages are optimized at build time and served from the CDN
  • images on dynamic pages are optimized on demand

But with cloudflare-binding all images are served on-demand.

Not a blocker necessarily, but worth looking into improving. I know @OliverSpeir had one suggestion in withastro/astro#15662 and there’s also withastro/astro#16194 which is related.

}),
session: { driver: sessionDrivers.lruCache() },
experimental: {
contentIntellisense: true,
rustCompiler: true,
Expand Down
23 changes: 0 additions & 23 deletions netlify.toml

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"deploy": "wrangler deploy",
"lint": "biome lint",
"format": "pnpm run format:code && pnpm run format:imports",
"format:code": "biome format --write && prettier -w \"**/*\" \"!**/*.{md,mdx}\" --ignore-unknown --cache",
Expand All @@ -21,14 +22,13 @@
"dependencies": {
"@astro-community/astro-embed-youtube": "^0.5.10",
"@astrojs/check": "0.9.9",
"@astrojs/cloudflare": "^13.5.4",
"@astrojs/mdx": "6.0.2",
"@astrojs/netlify": "7.0.12",
"@astrojs/rss": "4.0.18",
"@astrojs/sitemap": "3.7.3",
"@astrojs/compiler-rs": "^0.2.1",
"@astrojs/tailwind": "^6.0.2",
"@biomejs/biome": "2.4.16",
"@netlify/plugin-lighthouse": "^6.0.4",
"@preact/signals-core": "^1.14.2",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "^24.13.1",
Expand Down Expand Up @@ -56,6 +56,7 @@
"mdast-util-to-string": "^4.0.0",
"p-limit": "^7.3.0",
"p-retry": "^8.0.0",
"wrangler": "^4.0.0",
"yaml": "^2.9.0"
},
"packageManager": "pnpm@11.5.2"
Expand Down
13 changes: 0 additions & 13 deletions patches/astro.patch

This file was deleted.

Loading