Skip to content

Commit

Permalink
Merge branch 'canary' into fix/tree-shaking-import-wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 22, 2024
2 parents 5fdcc14 + 7552a7a commit 6bc015b
Show file tree
Hide file tree
Showing 40 changed files with 497 additions and 316 deletions.
167 changes: 95 additions & 72 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ next-core = { path = "packages/next-swc/crates/next-core" }
next-custom-transforms = { path = "packages/next-swc/crates/next-custom-transforms" }

# SWC crates
swc_core = { version = "0.90.30", features = [
swc_core = { version = "0.90.33", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
Expand Down
1 change: 0 additions & 1 deletion examples/with-redux/app/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";
Expand Down
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": "14.3.0-canary.12"
"version": "14.3.0-canary.15"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@svgr/webpack": "5.5.0",
"@swc/cli": "0.1.55",
"@swc/core": "1.4.4",
"@swc/helpers": "0.5.5",
"@swc/helpers": "0.5.10",
"@testing-library/jest-dom": "6.1.2",
"@testing-library/react": "13.0.0",
"@types/busboy": "1.5.3",
Expand Down Expand Up @@ -233,7 +233,7 @@
"taskr": "1.1.0",
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "1.13.2",
"turbo": "1.13.3-canary.3",
"typescript": "5.3.3",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
Expand Down
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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"@next/eslint-plugin-next": "14.3.0-canary.15",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
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": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
141 changes: 141 additions & 0 deletions packages/next-swc/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"extends": ["//"],
"pipeline": {
"build-native": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../Cargo.toml",
"../../Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"build-native-release": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"build-native-no-plugin": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"build-native-no-plugin-woa": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"build-native-no-plugin-woa-release": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"build-wasm": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["crates/wasm/pkg/*"]
},
"build-native-wasi": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*"]
},
"cache-build-native": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"outputs": ["native/*.node"]
},
"rust-check": {
"dependsOn": [
"rust-check-fmt",
"rust-check-clippy",
"rust-check-napi-rustls"
]
},
"rust-check-fmt": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
],
"cache": false
},
"rust-check-clippy": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
]
},
"rust-check-napi-rustls": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
]
},
"test-cargo-unit": {
"inputs": [
"../../.cargo/**",
"crates/**",
"../../**/Cargo.toml",
"../../**/Cargo.lock",
"../../.github/workflows/build_and_deploy.yml",
"../../rust-toolchain"
]
}
}
}
16 changes: 8 additions & 8 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -82,7 +82,7 @@
"prepublishOnly": "cd ../../ && turbo run build",
"types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist",
"typescript": "tsec --noEmit",
"ncc-compiled": "ncc cache clean && taskr ncc"
"ncc-compiled": "taskr ncc"
},
"taskr": {
"requires": [
Expand All @@ -93,8 +93,8 @@
]
},
"dependencies": {
"@next/env": "14.3.0-canary.12",
"@swc/helpers": "0.5.5",
"@next/env": "14.3.0-canary.15",
"@swc/helpers": "0.5.10",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579",
"graceful-fs": "^4.2.11",
Expand Down Expand Up @@ -150,10 +150,10 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/polyfill-module": "14.3.0-canary.12",
"@next/polyfill-nomodule": "14.3.0-canary.12",
"@next/react-refresh-utils": "14.3.0-canary.12",
"@next/swc": "14.3.0-canary.12",
"@next/polyfill-module": "14.3.0-canary.15",
"@next/polyfill-nomodule": "14.3.0-canary.15",
"@next/react-refresh-utils": "14.3.0-canary.15",
"@next/swc": "14.3.0-canary.15",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@taskr/clear": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ import type { Rewrite } from './load-custom-routes'
// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)
function toPathToRegexpPath(path: string): string {
return path.replace(/\[\[?([^\]]+)\]\]?/g, (_, capture) => {
// path-to-regexp only supports word characters, so we replace any non-word characters with underscores
const paramName = capture.replace(/\W+/g, '_')

// handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])
if (capture.startsWith('...')) {
return `:${capture.slice(3)}*`
if (paramName.startsWith('...')) {
return `:${paramName.slice(3)}*`
}
return ':' + capture
return ':' + paramName
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/lib/incremental-cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export class IncrementalCache implements IncrementalCacheType {
const headers =
typeof (init.headers || {}).keys === 'function'
? Object.fromEntries(init.headers as Headers)
: Object.assign(init.headers || {}, {})
: Object.assign({}, init.headers)

if ('traceparent' in headers) delete headers['traceparent']

Expand Down
1 change: 1 addition & 0 deletions packages/next/taskfile-ncc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = function (task) {
filename: file.base,
minify: options.minify === false ? false : true,
assetBuilds: true,
cache: false,
...options,
}).then(({ code, assets }) => {
Object.keys(assets).forEach((key) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/third-parties/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/third-parties",
"version": "14.3.0-canary.12",
"version": "14.3.0-canary.15",
"repository": {
"url": "vercel/next.js",
"directory": "packages/third-parties"
Expand All @@ -26,7 +26,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "14.3.0-canary.12",
"next": "14.3.0-canary.15",
"outdent": "0.8.0",
"prettier": "2.5.1"
},
Expand Down

0 comments on commit 6bc015b

Please sign in to comment.