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

[next] Add support for home and global as edge function regions #9869

Merged
merged 10 commits into from Apr 29, 2023

Conversation

timneutkens
Copy link
Member

@timneutkens timneutkens commented Apr 28, 2023

Adds home and global as supported values for regions when coming from Next.js. We'll port these to the build output API at a later time.

Related Next.js changes: vercel/next.js#48959

* Normalizes the regions config that comes from the Next.js edge functions manifest.
* Ensures that config like `home` and `global` are converted to the corresponding Vercel region config.
* In the future we'll want to make `home` and `global` part of the Build Output API.
* - `home` refers to the regions set in vercel.json or on the Vercel dashboard project config.

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

omfg

packages/next/src/utils.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@EndangeredMassa EndangeredMassa left a comment

Choose a reason for hiding this comment

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

I don't have context in the home/global requirements, but from the code and comments, this makes sense to me.

* - `home` refers to the regions set in vercel.json or on the Vercel dashboard project config.
* - `global` refers to all regions.
*/
function normalizeRegions(regions: Regions): string[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (soft-blocking): ‏add tests

In this or a follow-up PR: Can we add tests?

Copy link
Member

Choose a reason for hiding this comment

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

We can look at tests in a follow-up yeah

packages/next/src/utils.ts Show resolved Hide resolved
ijjk
ijjk previously approved these changes Apr 28, 2023
ijjk
ijjk previously approved these changes Apr 28, 2023
TooTallNate
TooTallNate previously approved these changes Apr 28, 2023
@timneutkens timneutkens merged commit 473f62d into main Apr 29, 2023
103 checks passed
@timneutkens timneutkens deleted the add/global-and-home-region-config branch April 29, 2023 17:25
@styfle styfle changed the title Add support for home and global as edge function regions [next] Add support for home and global as edge function regions Apr 29, 2023
styfle added a commit that referenced this pull request Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: next semver: patch PR contains bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants