feat(astro): update Cloudflare support for Astro 6#1358
feat(astro): update Cloudflare support for Astro 6#1358AmanVarshney01 wants to merge 3 commits intomainfrom
Conversation
commit: |
Mkassabov
left a comment
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Does it still work for older astro?
There was a problem hiding this comment.
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",
},
});
There was a problem hiding this comment.
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
Updates Alchemy's Astro Cloudflare support to match Astro 6 output and adapter conventions.
Changes
dist/server/entry.mjsdist/client@astrojs/cloudflare13