rsnext/test
Tim Neutkens 799a05ce8f
Support preferredRegion and Support runtime/preferredRegion on layouts (#48959)
### 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
2023-04-28 17:40:34 -05:00
..
.stats-app Add export runtime test for pages and fully remove experimental.runtime (#48630) 2023-04-20 22:37:38 +00:00
__mocks__ Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
development Refactor require hooks (#48506) 2023-04-22 00:19:51 +02:00
e2e Support preferredRegion and Support runtime/preferredRegion on layouts (#48959) 2023-04-28 17:40:34 -05:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration Upgrade Edge Runtime (#46818) 2023-04-27 17:04:14 +00:00
lib Preload css (#48840) 2023-04-27 12:51:52 +02:00
production Add updated app dir cache handling (#48516) 2023-04-19 18:12:21 -04:00
unit Support generate dynamic sitemaps for dynamic routes (#48867) 2023-04-26 20:41:37 +00:00
.gitignore Fix static opt of routes generation for static metadata files (#48528) 2023-04-18 12:13:55 +00:00
jest-setup-after-env.ts Increase CI test timeout (#47973) 2023-04-05 10:16:48 -07:00
jest.d.ts Adds tests to ensure eslint-plugin-next's available rules are properly exported and recommended rules are correctly defined. (#38183) 2022-06-30 11:31:33 -05:00
readme.md refactor: split up CONTRIBUTING.md (#40515) 2022-09-16 14:54:58 -07:00
test-file.txt

See Testing for more information on how you can run/write/debug tests for Next.js.