Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(edge): add a way for convertTo to return a Request #612

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Oct 30, 2024

This is a temporary "hack" for the cloudflare adapter.

Why we need this:

  • It is not possible to fetch a worker in the same zone
  • Our first implementation will bundle the middleware and the server in a single worker

We will work on a better architecture later but this will unblock cloudflare for now and does not add overhead/code to the current edge converter. The alternative would be to fork the edge converter but it would be harder to keep the implemenations in sync.

Copy link

changeset-bot bot commented Oct 30, 2024

⚠️ No Changeset found

Latest commit: ddebff9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

pkg-pr-new bot commented Oct 30, 2024

Open in Stackblitz

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

commit: 00b47c9

Copy link
Contributor

github-actions bot commented Oct 30, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 19.31% 1409 / 7293
🔵 Statements 19.31% 1409 / 7293
🔵 Functions 53.14% 93 / 175
🔵 Branches 67.13% 331 / 493
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/open-next/src/overrides/converters/edge.ts 0% 0% 0% 0% 1, 3, 13, 16-30, 32-39, 41-69, 71-78, 80-82, 84-89, 91, 95-109, 111
Generated in workflow #675 for commit 00b47c9 by the Vitest Coverage Report Action

@vicb vicb requested a review from conico974 October 30, 2024 16:51
Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

Everything "edge" related will likely need a rework at some point, i don't like the idea of the converter actually doing a fetch.
It should probably be done on the wrapper side so that the edge converter is not dependent on cloudflare or any other potential platform.

@vicb
Copy link
Contributor Author

vicb commented Oct 30, 2024

Everything "edge" related will likely need a rework at some point, i don't like the idea of the converter actually doing a fetch.
It should probably be done on the wrapper side so that the edge converter is not dependent on cloudflare or any other potential platform.

+1 to that.

I think having multiple possible infra "implementation" in the same code will help us come with a better archi.

@vicb vicb merged commit a43b82b into main Oct 30, 2024
3 checks passed
@vicb vicb deleted the vb-branch-5 branch October 30, 2024 17:21
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
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.

2 participants