Skip to content

Commit

Permalink
Merge branch 'canary' into chore/update-create-next-app-when-using-ta…
Browse files Browse the repository at this point in the history
…ilwind
  • Loading branch information
samcx authored Jan 29, 2024
2 parents d54ce7b + 4701836 commit e62cfba
Show file tree
Hide file tree
Showing 70 changed files with 929 additions and 777 deletions.
346 changes: 175 additions & 171 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ 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.87.28", features = [
swc_core = { version = "0.89.1", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
testing = { version = "0.35.14" }
testing = { version = "0.35.16" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240126.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240127.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240126.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240127.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240126.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240127.2" }

# General Deps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export default function ClientComponent({ updateItem }) {
- The arguments and return value of Server Actions must be serializable by React. See the React docs for a list of [serializable arguments and values](https://react.dev/reference/react/use-server#serializable-parameters-and-return-values).
- Server Actions are functions. This means they can be reused anywhere in your application.
- Server Actions inherit the [runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes) from the page or layout they are used on.
- Server Actions inherit the [Route Segment Config](docs/app/api-reference/file-conventions/route-segment-config) from the page or layout they are used on, including fields like `maxDuration`.

## Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Statics Assets in `public`
title: Static Assets in `public`
nav_title: Static Assets
description: Next.js allows you to serve static files, like images, in the public directory. You can learn how it works here.
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ For example, we can add a test to check if the `<Page />` component successfully
```jsx filename="app/page.js
import Link from 'next/link'

export default async function Home() {
export default function Home() {
return (
<div>
<h1>Home</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,9 @@ Here are authentication solutions compatible with Next.js, please refer to the q
{/* TODO: Change link to authjs.dev when new documentation is ready */}
- [Auth0](https://auth0.com/docs/quickstart/webapp/nextjs/01-login)
- [Auth.js](https://authjs.dev/guides/upgrade-to-v5)
- [Clerk](https://clerk.com/docs/quickstarts/nextjs)
- [NextAuth.js](https://authjs.dev/guides/upgrade-to-v5)
- [Lucia](https://lucia-auth.com/getting-started/nextjs-app)
- [Supabase](https://supabase.com/docs/guides/getting-started/quickstarts/nextjs)
- [Stytch](https://stytch.com/docs/guides/quickstarts/nextjs)
- [Iron Session](https://github.com/vvo/iron-session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ export const maxDuration = 5
export const maxDuration = 5
```

> **Good to know**:
>
> - If using [Server Actions](/docs/app/building-your-application/data-fetching/server-actions-and-mutations), set the `maxDuration` at the page level to change the default timeout of all Server Actions used on the page.
### `generateStaticParams`

The `generateStaticParams` function can be used in combination with [dynamic route segments](/docs/app/building-your-application/routing/dynamic-routes) to define the list of route segment parameters that will be statically generated at build time instead of on-demand at request time.
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.1.1-canary.15"
"version": "14.1.1-canary.18"
}
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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"@next/eslint-plugin-next": "14.1.1-canary.18",
"@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": "14.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"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.1.1-canary.15",
"version": "14.1.1-canary.18",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-custom-transforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ turbopack-binding = { workspace = true, features = [
] }
# To allow quote! macro works
swc_core = { workspace = true, features = ["ecma_quote"]}
react_remove_properties = "0.22.0"
remove_console = "0.23.0"
react_remove_properties = "0.24.0"
remove_console = "0.25.0"
preset_env_base = "0.4.10"

[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ where
let ss = match ss {
Ok(v) => v,
Err(err) => {
bail!("failed to parse css: {}", err)
bail!("failed to parse css using lightningcss: {}", err)
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ impl NextDynamicPatcher {
src: Box::new(specifier.into()),
type_only: false,
with: None,
phase: Default::default(),
})));
}
TurbopackImport::DevelopmentId {
Expand All @@ -543,6 +544,7 @@ impl NextDynamicPatcher {
src: Box::new(specifier.into()),
type_only: false,
with: None,
phase: Default::default(),
})));
}
TurbopackImport::BuildTransition {
Expand Down Expand Up @@ -572,6 +574,7 @@ impl NextDynamicPatcher {
src: Box::new(specifier.into()),
type_only: false,
with: None,
phase: Default::default(),
})));
}
TurbopackImport::BuildId {
Expand All @@ -598,6 +601,7 @@ impl NextDynamicPatcher {
src: Box::new(specifier.into()),
type_only: false,
with: None,
phase: Default::default(),
})));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl<'a> FontImportsGenerator<'a> {
type_only: false,
with: None,
span: DUMMY_SP,
phase: Default::default(),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,10 @@ pub fn server_components<C: Comments>(
as_folder(ReactServerComponents {
is_react_server_layer,
comments,
filepath: filename.to_string(),
filepath: match filename {
FileName::Custom(path) => format!("<{}>", path),
_ => filename.to_string(),
},
app_dir,
export_names: vec![],
invalid_server_imports: vec![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}),
type_only: false,
with: None,
phase: Default::default(),
})));
}

Expand Down Expand Up @@ -986,6 +987,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}),
type_only: false,
with: None,
phase: Default::default(),
})));
new.push(ModuleItem::Stmt(Stmt::Expr(ExprStmt {
span: DUMMY_SP,
Expand Down Expand Up @@ -1021,11 +1023,11 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}

if self.has_action {
let actions = if self.in_action_file {
self.exported_idents.iter().map(|e| e.1.clone()).collect()
} else {
self.export_actions.clone()
let mut actions = self.export_actions.clone();
if self.in_action_file {
actions.extend(self.exported_idents.iter().map(|e| e.1.clone()));
};

let actions = actions
.into_iter()
.map(|name| (generate_action_id(&self.file_name, &name), name))
Expand Down Expand Up @@ -1059,6 +1061,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}),
type_only: false,
with: None,
phase: Default::default(),
})));

// Encryption and decryption only happens on the server layer.
Expand Down Expand Up @@ -1087,6 +1090,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}),
type_only: false,
with: None,
phase: Default::default(),
})));

// Make it the first item
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* __next_internal_action_entry_do_not_use__ {} */ import { createActionProxy } from "private-next-rsc-action-proxy";
/* __next_internal_action_entry_do_not_use__ {"6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default createActionProxy("6d53ce510b2e36499b8f56038817b9bad86cabb4", $$ACTION_0);
export async function $$ACTION_0() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* __next_internal_action_entry_do_not_use__ {"c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
/* __next_internal_action_entry_do_not_use__ {"188d5d945750dc32e2c842b93c75a65763d4a922":"$$ACTION_1","c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default $$ACTION_0 = createActionProxy("188d5d945750dc32e2c842b93c75a65763d4a922", $$ACTION_1);
var $$ACTION_0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* __next_internal_action_entry_do_not_use__ {"ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
/* __next_internal_action_entry_do_not_use__ {"6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0","ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const foo = createActionProxy("6d53ce510b2e36499b8f56038817b9bad86cabb4", $$ACTION_0);
export async function $$ACTION_0() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* __next_internal_action_entry_do_not_use__ {"c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
/* __next_internal_action_entry_do_not_use__ {"6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0","9878bfa39811ca7650992850a8751f9591b6a557":"$$ACTION_2","c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { validator } from 'auth';
export const action = validator(createActionProxy("6d53ce510b2e36499b8f56038817b9bad86cabb4", $$ACTION_0));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use server'

export const dec = async (value) => {
return value - 1
}

// Test case for https://github.com/vercel/next.js/issues/54655
export default dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* __next_internal_action_entry_do_not_use__ {"28baf972d345b86b747ad0df73d75a0088a42214":"dec","6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0","c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { createActionProxy } from "private-next-rsc-action-proxy";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const dec = createActionProxy("6d53ce510b2e36499b8f56038817b9bad86cabb4", $$ACTION_0);
export async function $$ACTION_0(value) {
return value - 1;
}
// Test case for https://github.com/vercel/next.js/issues/54655
export default dec;
import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([
dec,
dec
]);
createActionProxy("28baf972d345b86b747ad0df73d75a0088a42214", dec);
createActionProxy("c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", dec);
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.1.1-canary.15",
"version": "14.1.1-canary.18",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
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.1.1-canary.15",
"version": "14.1.1-canary.18",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -92,7 +92,7 @@
]
},
"dependencies": {
"@next/env": "14.1.1-canary.15",
"@next/env": "14.1.1-canary.18",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579",
Expand Down Expand Up @@ -146,11 +146,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "14.1.1-canary.15",
"@next/polyfill-nomodule": "14.1.1-canary.15",
"@next/react-dev-overlay": "14.1.1-canary.15",
"@next/react-refresh-utils": "14.1.1-canary.15",
"@next/swc": "14.1.1-canary.15",
"@next/polyfill-module": "14.1.1-canary.18",
"@next/polyfill-nomodule": "14.1.1-canary.18",
"@next/react-dev-overlay": "14.1.1-canary.18",
"@next/react-refresh-utils": "14.1.1-canary.18",
"@next/swc": "14.1.1-canary.18",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "^1.35.1",
"@taskr/clear": "1.1.0",
Expand Down Expand Up @@ -194,7 +194,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.26.2",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240126.2",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240127.2",
"acorn": "8.5.0",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
Expand Down
Loading

0 comments on commit e62cfba

Please sign in to comment.