799a05ce8f
### What? Implements resolving of `runtime` and `preferredRegion` in layouts. It will resolve from the root layout down, each layout can override `runtime` or `preferredRegion`. ``` app ├── layout.js -> export const runtime = 'edge' ├── page.js -> Edge runtime └── dashboard ├── page.js -> Edge runtime └── settings ├── layout.js -> export const runtime = 'nodejs' └── page.js -> Node.js runtime ``` Adds support for `preferredRegion`. This is similar to `export const config = { region: ['sfo1'] }` in `pages`. However, there is a difference. It supports `export const preferredRegion = 'home'` and `export const preferredRegion = 'edge'`. `home` refers to the configured default region on your deployment platform and `edge` refers to "all regions". ### How? I've implemented a temporary resolving in `entries.ts`. `preferredRegion` is tracked through the entry module in webpack which is why it's added to all the loaders that create an entry module, this prevents having to resolve/parse again later on. Fixes NEXT-880 Fixes NEXT-1064 Fixes #48905 Closes #48933 |
||
---|---|---|
.. | ||
.stats-app | ||
__mocks__ | ||
development | ||
e2e | ||
examples | ||
integration | ||
lib | ||
production | ||
unit | ||
.gitignore | ||
jest-setup-after-env.ts | ||
jest.d.ts | ||
readme.md | ||
test-file.txt |