opennextjs / opennextjs-aws

Open-source Next.js adapter for AWS
https://opennext.js.org
MIT License
4.38k stars 130 forks source link

feat: add a cloudflare-streaming wrapper #642

Closed vicb closed 1 day ago

vicb commented 1 day ago

@conico974 Do you think "cloudflare-streaming" is a reasonable name or "cloudflare-server" would be better (or any other idea)?

The changes are somehow tested - might require minor tweaks later.

I have spread the changes across different commits per unit of work to ease the review.

Thanks!

changeset-bot[bot] commented 1 day ago

🦋 Changeset detected

Latest commit: 1e9aa8680f14763c7170fced7dbb75dc2814a72d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ---------------- | ----- | | @opennextjs/aws | Minor | | app-pages-router | Patch | | app-router | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 1 day ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.02% 1659 / 7531
🔵 Statements 22.02% 1659 / 7531
🔵 Functions 56.25% 99 / 176
🔵 Branches 70.28% 414 / 589
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/open-next/src/build/createServerBundle.ts 0% 0% 0% 0% 1-315
packages/open-next/src/build/validateConfig.ts 0% 0% 0% 0% 1-115
packages/open-next/src/overrides/converters/aws-apigw-v2.ts 91.37% 83.33% 100% 91.37% 45-46, 50-54, 113-115
packages/open-next/src/overrides/converters/edge.ts 0% 0% 0% 0% 1-114
packages/open-next/src/overrides/wrappers/cloudflare-streaming.ts 0% 0% 0% 0% 1-77
packages/open-next/src/overrides/wrappers/cloudflare.ts 0% 100% 100% 0% 6-68
packages/open-next/src/types/open-next.ts 0% 0% 0% 0%
Generated in workflow #775 for commit 1e9aa86 by the Vitest Coverage Report Action
pkg-pr-new[bot] commented 1 day ago

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@642

commit: 1e9aa86

vicb commented 1 day ago

Even better we could rename the other one cloudflare-edge and this one cloudflare-node which would allow people to understand more easily which one to use depending on the runtime they use

Great idea. I'll do that (and alias the former "cloudflare" to "cloudflare-edge" for BC!

vicb commented 1 day ago

@conico974 do you think we could merge this PR as is and I would address the comments in a follow up early next week. The rationale is that I have a pending https://github.com/opennextjs/opennextjs-cloudflare/pull/140 using this and I think if I push here it might update the pre-release and break that PR (not sure if the version changes or not).