Skip to content

feat(astro): update Cloudflare support for Astro 6#1358

Open
AmanVarshney01 wants to merge 3 commits intomainfrom
aman/astro6-cloudflare
Open

feat(astro): update Cloudflare support for Astro 6#1358
AmanVarshney01 wants to merge 3 commits intomainfrom
aman/astro6-cloudflare

Conversation

@AmanVarshney01
Copy link
Collaborator

Updates Alchemy's Astro Cloudflare support to match Astro 6 output and adapter conventions.

Changes

  • switch Astro Cloudflare server defaults to dist/server/entry.mjs
  • switch Astro Cloudflare assets defaults to dist/client
  • update Astro package support to Astro 6 and @astrojs/cloudflare 13
  • update the Astro template package versions and Wrangler template paths
  • normalize the Astro plugin's local Cloudflare proxy config for the v13 adapter API

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 10, 2026

Open in StackBlitz

npm i https://pkg.pr.new/alchemy@1358

commit: 7c0c425

Copy link
Collaborator

@Mkassabov Mkassabov left a comment

Choose a reason for hiding this comment

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

could this also update the cloudflare-astro example?

props.entrypoint ??
(output === "server" ? "dist/_worker.js/index.js" : undefined),
assets: props.assets ?? "dist",
(output === "server" ? "dist/server/entry.mjs" : undefined),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it still work for older astro?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this would break Astro 5.

Astro 5 still outputs:

dist/_worker.js/index.js

I’m not sure we can reliably infer v5 vs v6 inside the resource

I thinkmaybe we just update the docs?

keep these defaults aligned to Astro 6
document the Astro 5 override explicitly

Something like:

await Astro("website", {
  entrypoint: "dist/_worker.js/index.js",
  assets: "dist",
  wrangler: {
    main: "@astrojs/cloudflare/entrypoints/server.js",
  },
});

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a version prop? we default to astroVersion: 5 so we don't break it for existing users and anyone who wants to use astro 6 would explicitly say astroVersion: 6.

or we just version the entire resource but that feels like overkill. We should really avoid breaking userspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants