Skip to content

Commit 6ed114f

Browse files
authored
Merge branch 'canary' into fix/500_response_status
2 parents b81d7e2 + b660eef commit 6ed114f

File tree

40 files changed

+220
-126
lines changed

40 files changed

+220
-126
lines changed

.github/workflows/test_e2e_deploy.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
TURBO_REMOTE_ONLY: 'true'
2424
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
2525
NEXT_TELEMETRY_DISABLED: 1
26-
# we build a dev binary for use in CI so skip downloading
27-
# canary next-swc binaries in the monorepo
28-
NEXT_SKIP_NATIVE_POSTINSTALL: 1
2926

3027
strategy:
3128
fail-fast: false
@@ -50,11 +47,6 @@ jobs:
5047

5148
- run: npm i -g vercel@latest
5249

53-
- uses: actions/download-artifact@v3
54-
with:
55-
name: next-swc-binaries
56-
path: packages/next-swc/native
57-
5850
- run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs
5951
name: Reset test project
6052

docs/03-pages/01-building-your-application/05-optimizing/10-testing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add Cypress to the `package.json` scripts field:
5151
Run Cypress for the first time to generate examples that use their recommended folder structure:
5252

5353
```bash filename="Terminal"
54-
npm run cypress
54+
npm run cypress:open
5555
```
5656

5757
You can look through the generated examples and the [Writing Your First Test](https://docs.cypress.io/guides/getting-started/writing-your-first-test) section of the Cypress Documentation to help you get familiar with Cypress.

docs/04-architecture/supported-browsers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We inject [widely used polyfills](https://github.com/vercel/next.js/blob/canary/
3535
- [**URL**](https://developer.mozilla.org/docs/Web/API/URL) — Replacing: the [`url` package (Node.js API)](https://nodejs.org/api/url.html).
3636
- [**Object.assign()**](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) — Replacing: `object-assign`, `object.assign`, and `core-js/object/assign`.
3737

38-
If any of your dependencies includes these polyfills, they’ll be eliminated automatically from the production build to avoid duplication.
38+
If any of your dependencies include these polyfills, they’ll be eliminated automatically from the production build to avoid duplication.
3939

4040
In addition, to reduce bundle size, Next.js will only load these polyfills for browsers that require them. The majority of the web traffic globally will not download these polyfills.
4141

errors/404-get-initial-props.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Adding `getInitialProps` or `getServerSideProps` to your `404.js` page will caus
1313

1414
To fix this error, you should remove `getInitialProps` from your `404.js` page. Additionally, ensure that no Higher-Order Components (HOCs) used in the `404.js` page are attaching `getInitialProps`.
1515

16-
If your `404.js` page requires data fetching, we recommend incrementall adopting the App Router and the [`not-found`](/docs/app/api-reference/file-conventions/not-found) file, which does support fetching data before displaying the 404 page.
16+
If your `404.js` page requires data fetching, we recommend incrementally adopting the App Router and the [`not-found`](/docs/app/api-reference/file-conventions/not-found) file, which does support fetching data before displaying the 404 page.
1717

1818
## Useful Links
1919

errors/api-routes-static-export.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To resolve this issue, you have two main options:
1515

1616
1. Use the `next build` command instead of `next export` if you're deploying your application on platforms that don't require `next export`. For example, [Vercel](https://vercel.com) is a popular hosting platform for Next.js applications that supports this feature.
1717
2. If you still need to use `next export`, make sure to remove any paths that use API routes from your `exportPathMap` in your `next.config.js` file.
18-
3. Consider [incrementally adopting the App Router](/docs/app/building-your-application/upgrading/app-router-migration), which supportes [Route Handlers](/docs/app/building-your-application/routing/route-handlers). These "API Routes" can be used to create endpoints that can be statically exported in your application.
18+
3. Consider [incrementally adopting the App Router](/docs/app/building-your-application/upgrading/app-router-migration), which supports [Route Handlers](/docs/app/building-your-application/routing/route-handlers). These "API Routes" can be used to create endpoints that can be statically exported in your application.
1919

2020
## Useful Links
2121

examples/with-mqtt-js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cp .env.local.example .env.local
3333
Then set each variable on `.env.local`:
3434

3535
- `NEXT_MQTT_URI`: The URI of the broker. For example `wss://test.mosquitto.org:8081/mqtt`
36-
- `NEXT_MQTT_CLIENTID`: An arbritrary string of max. 23 characters.
36+
- `NEXT_MQTT_CLIENTID`: An arbitrary string of max. 23 characters.
3737
- `NEXT_MQTT_USERNAME`: The username for the connection to the broker.
3838
- `NEXT_MQTT_PASSWORD`: The password for the connection to the broker.
3939

examples/with-quill-js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Quill](https://quilljs.com/) is powerful rich text editor. This example uses [react-quill](https://github.com/zenoamaro/react-quill) to integrate Quill with Next.js.
44

5-
Quill does not suppport SSR, so it's only loaded and rendered in the browser.
5+
Quill does not support SSR, so it's only loaded and rendered in the browser.
66

77
## Deploy your own
88

examples/with-supabase/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- [Supabase Auth](https://supabase.com/auth) using cookies, making the user's session available throughout the entire Next.js app, for both client and server.
3030
- Styling with [Tailwind CSS](https://tailwindcss.com)
3131
- Optional deployment with [Supabase Vercel Integration and Vercel deploy](#deploy-your-own)
32-
- Enviroment variables automatically assigned to Vercel project
32+
- Environment variables automatically assigned to Vercel project
3333

3434
## Demo
3535

examples/with-temporal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Charging user 123 for 2 of item B102
2828
Here is the Temporal code:
2929

3030
- The Workflow: `temporal/src/workflows/order.ts`
31-
- The Activites: `temporal/src/activities/{payment|inventory}.ts`
31+
- The Activities: `temporal/src/activities/{payment|inventory}.ts`
3232

3333
There are three parts of this starter project that are left unimplemented:
3434

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "13.5.5-canary.13"
19+
"version": "13.5.5-canary.16"
2020
}

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "13.5.5-canary.13",
13+
"@next/eslint-plugin-next": "13.5.5-canary.16",
1414
"@rushstack/eslint-patch": "^1.3.3",
1515
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
1616
"eslint-import-resolver-node": "^0.3.6",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"license": "MIT",

packages/font/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/font",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/font"

packages/next-bundle-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"license": "MIT",

packages/next-codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/next-env/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-storybook",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-storybook"

packages/next-polyfill-module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-module",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
55
"main": "dist/polyfill-module.js",
66
"license": "MIT",

packages/next-polyfill-nomodule/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-nomodule",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

packages/next-swc/crates/next-api/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl AppEndpoint {
766766
.await?
767767
.preferred_region
768768
.clone()
769-
.map(Regions::Single),
769+
.map(Regions::Multiple),
770770
matchers: vec![matchers],
771771
..Default::default()
772772
};

packages/next-swc/crates/next-core/src/app_segment_config.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct NextSegmentConfig {
6969
pub revalidate: Option<NextRevalidate>,
7070
pub fetch_cache: Option<NextSegmentFetchCache>,
7171
pub runtime: Option<NextRuntime>,
72-
pub preferred_region: Option<String>,
72+
pub preferred_region: Option<Vec<String>>,
7373
}
7474

7575
#[turbo_tasks::value_impl]
@@ -358,12 +358,37 @@ fn parse_config_value(
358358
}
359359
"preferredRegion" => {
360360
let value = eval_context.eval(init);
361-
let Some(val) = value.as_str() else {
362-
invalid_config("`preferredRegion` needs to be a static string", &value);
363-
return;
361+
362+
let preferred_region = match value {
363+
// Single value is turned into a single-element Vec.
364+
JsValue::Constant(ConstantValue::Str(str)) => vec![str.to_string()],
365+
// Array of strings is turned into a Vec. If one of the values in not a String it
366+
// will error.
367+
JsValue::Array { items, .. } => {
368+
let mut regions = Vec::new();
369+
for item in items {
370+
if let JsValue::Constant(ConstantValue::Str(str)) = item {
371+
regions.push(str.to_string());
372+
} else {
373+
invalid_config(
374+
"Values of the `preferredRegion` array need to static strings",
375+
&item,
376+
);
377+
return;
378+
}
379+
}
380+
regions
381+
}
382+
_ => {
383+
invalid_config(
384+
"`preferredRegion` needs to be a static string or array of static strings",
385+
&value,
386+
);
387+
return;
388+
}
364389
};
365390

366-
config.preferred_region = Some(val.to_string());
391+
config.preferred_region = Some(preferred_region);
367392
}
368393
_ => {}
369394
}

packages/next-swc/crates/next-core/src/next_import_map.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ pub async fn get_next_client_import_map(
5454
)
5555
.await?;
5656

57+
insert_optimized_module_aliases(&mut import_map, project_path).await?;
58+
5759
insert_alias_option(
5860
&mut import_map,
5961
project_path,
@@ -420,6 +422,8 @@ pub async fn get_next_edge_import_map(
420422
)
421423
.await?;
422424

425+
insert_optimized_module_aliases(&mut import_map, project_path).await?;
426+
423427
insert_alias_option(
424428
&mut import_map,
425429
project_path,
@@ -936,8 +940,32 @@ pub fn mdx_import_source_file() -> String {
936940
format!("{VIRTUAL_PACKAGE_NAME}/mdx-import-source")
937941
}
938942

943+
// Insert aliases for Next.js stubs of fetch, object-assign, and url
944+
// Keep in sync with getOptimizedModuleAliases in webpack-config.ts
945+
async fn insert_optimized_module_aliases(
946+
import_map: &mut ImportMap,
947+
project_path: Vc<FileSystemPath>,
948+
) -> Result<()> {
949+
insert_exact_alias_map(
950+
import_map,
951+
project_path,
952+
indexmap! {
953+
"unfetch" => "next/dist/build/polyfills/fetch/index.js".to_string(),
954+
"isomorphic-unfetch" => "next/dist/build/polyfills/fetch/index.js".to_string(),
955+
"whatwg-fetch" => "next/dist/build/polyfills/fetch/whatwg-fetch.js".to_string(),
956+
"object-assign" => "next/dist/build/polyfills/object-assign.js".to_string(),
957+
"object.assign/auto" => "next/dist/build/polyfills/object.assign/auto.js".to_string(),
958+
"object.assign/implementation" => "next/dist/build/polyfills/object.assign/implementation.js".to_string(),
959+
"object.assign/polyfill" => "next/dist/build/polyfills/object.assign/polyfill.js".to_string(),
960+
"object.assign/shim" => "next/dist/build/polyfills/object.assign/shim.js".to_string(),
961+
"url" => "next/dist/compiled/native-url".to_string(),
962+
},
963+
);
964+
Ok(())
965+
}
966+
939967
// Make sure to not add any external requests here.
940-
pub async fn insert_next_shared_aliases(
968+
async fn insert_next_shared_aliases(
941969
import_map: &mut ImportMap,
942970
project_path: Vc<FileSystemPath>,
943971
execution_context: Vc<ExecutionContext>,

packages/next-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/swc",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "13.5.5-canary.13",
3+
"version": "13.5.5-canary.16",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -90,7 +90,7 @@
9090
]
9191
},
9292
"dependencies": {
93-
"@next/env": "13.5.5-canary.13",
93+
"@next/env": "13.5.5-canary.16",
9494
"@swc/helpers": "0.5.2",
9595
"busboy": "1.6.0",
9696
"caniuse-lite": "^1.0.30001406",
@@ -144,11 +144,11 @@
144144
"@mswjs/interceptors": "0.23.0",
145145
"@napi-rs/cli": "2.16.2",
146146
"@napi-rs/triples": "1.1.0",
147-
"@next/polyfill-module": "13.5.5-canary.13",
148-
"@next/polyfill-nomodule": "13.5.5-canary.13",
149-
"@next/react-dev-overlay": "13.5.5-canary.13",
150-
"@next/react-refresh-utils": "13.5.5-canary.13",
151-
"@next/swc": "13.5.5-canary.13",
147+
"@next/polyfill-module": "13.5.5-canary.16",
148+
"@next/polyfill-nomodule": "13.5.5-canary.16",
149+
"@next/react-dev-overlay": "13.5.5-canary.16",
150+
"@next/react-refresh-utils": "13.5.5-canary.16",
151+
"@next/swc": "13.5.5-canary.16",
152152
"@opentelemetry/api": "1.4.1",
153153
"@playwright/test": "^1.35.1",
154154
"@taskr/clear": "1.1.0",
@@ -302,7 +302,7 @@
302302
"timers-browserify": "2.0.12",
303303
"tty-browserify": "0.0.1",
304304
"ua-parser-js": "1.0.35",
305-
"undici": "5.23.0",
305+
"undici": "5.26.3",
306306
"unistore": "3.4.1",
307307
"util": "0.12.4",
308308
"uuid": "8.3.2",

0 commit comments

Comments
 (0)