Skip to content

Commit

Permalink
Merge branch 'canary' into fix/use-server-test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 28, 2023
2 parents ddb903e + 49f646d commit 3efa207
Show file tree
Hide file tree
Showing 37 changed files with 2,416 additions and 2,198 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.5.4-canary.4"
"version": "13.5.4-canary.5"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "13.5.4-canary.4",
"@next/eslint-plugin-next": "13.5.4-canary.5",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
40 changes: 40 additions & 0 deletions packages/next-swc/crates/next-core/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,46 @@ pub async fn env_for_js(
},
);

map.insert(
"__NEXT_MANUAL_TRAILING_SLASH".to_string(),
if next_config.skip_trailing_slash_redirect.unwrap_or(false) {
"true".to_string()
} else {
"false".to_string()
},
);

map.insert(
"__NEXT_NO_MIDDLEWARE_URL_NORMALIZE".to_string(),
if next_config.skip_middleware_url_normalize.unwrap_or(false) {
"true".to_string()
} else {
"false".to_string()
},
);

map.insert(
"__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE".to_string(),
if next_config
.experimental
.external_middleware_rewrites_resolve
.unwrap_or(false)
{
"true".to_string()
} else {
"false".to_string()
},
);

map.insert(
"__NEXT_SCROLL_RESTORATION".to_string(),
if next_config.experimental.scroll_restoration.unwrap_or(false) {
"true".to_string()
} else {
"false".to_string()
},
);

if !test_mode.is_empty() {
map.insert("__NEXT_TEST_MODE".to_string(), "true".to_string());
}
Expand Down
8 changes: 4 additions & 4 deletions packages/next-swc/crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ pub struct NextConfig {
pub trailing_slash: Option<bool>,
pub asset_prefix: Option<String>,
pub base_path: Option<String>,
pub skip_middleware_url_normalize: Option<bool>,
pub skip_trailing_slash_redirect: Option<bool>,

///
#[serde(rename = "_originalRedirects")]
Expand Down Expand Up @@ -127,8 +129,6 @@ pub struct NextConfig {
typescript: TypeScriptConfig,
use_file_system_public_routes: bool,
webpack: Option<serde_json::Value>,
skip_middleware_url_normalize: Option<bool>,
skip_trailing_slash_redirect: Option<bool>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, TraceRawVcs)]
Expand Down Expand Up @@ -429,6 +429,8 @@ pub struct ExperimentalConfig {
pub swc_plugins: Option<Vec<(String, serde_json::Value)>>,
pub turbo: Option<ExperimentalTurboConfig>,
pub turbotrace: Option<serde_json::Value>,
pub external_middleware_rewrites_resolve: Option<bool>,
pub scroll_restoration: Option<bool>,

// ---
// UNSUPPORTED
Expand All @@ -446,7 +448,6 @@ pub struct ExperimentalConfig {
esm_externals: Option<serde_json::Value>,
extension_alias: Option<serde_json::Value>,
external_dir: Option<bool>,
external_middleware_rewrites_resolve: Option<bool>,
/// If set to `false`, webpack won't fall back to polyfill Node.js modules
/// in the browser Full list of old polyfills is accessible here:
/// [webpack/webpack#Module_notound_error.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/Module_not_found_error.js#L13-L42)
Expand Down Expand Up @@ -480,7 +481,6 @@ pub struct ExperimentalConfig {
/// directory.
ppr: Option<bool>,
proxy_timeout: Option<f64>,
scroll_restoration: Option<bool>,
/// Enables server actions. Using this feature will enable the
/// `react@experimental` for the `app` directory. @see https://nextjs.org/docs/app/api-reference/functions/server-actions
server_actions: Option<bool>,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "13.5.4-canary.4",
"version": "13.5.4-canary.5",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -90,7 +90,7 @@
]
},
"dependencies": {
"@next/env": "13.5.4-canary.4",
"@next/env": "13.5.4-canary.5",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
Expand Down Expand Up @@ -144,11 +144,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.5.4-canary.4",
"@next/polyfill-nomodule": "13.5.4-canary.4",
"@next/react-dev-overlay": "13.5.4-canary.4",
"@next/react-refresh-utils": "13.5.4-canary.4",
"@next/swc": "13.5.4-canary.4",
"@next/polyfill-module": "13.5.4-canary.5",
"@next/polyfill-nomodule": "13.5.4-canary.5",
"@next/react-dev-overlay": "13.5.4-canary.5",
"@next/react-refresh-utils": "13.5.4-canary.5",
"@next/swc": "13.5.4-canary.5",
"@opentelemetry/api": "1.4.1",
"@playwright/test": "^1.35.1",
"@segment/ajv-human-errors": "2.1.2",
Expand Down
Loading

0 comments on commit 3efa207

Please sign in to comment.