Skip to content

Commit

Permalink
Merge branch 'canary' into upgrade-example
Browse files Browse the repository at this point in the history
  • Loading branch information
samcx authored Mar 18, 2024
2 parents 6911249 + 4064c64 commit 6885416
Show file tree
Hide file tree
Showing 108 changed files with 3,779 additions and 786 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A workflow to run next.js integration test with turbopack for each day.
# This runs against main branch with latest Next.js release.
name: Daily Next.js integration test with turbopack
name: Daily Next.js integration test with Turbopack

on:
schedule:
Expand All @@ -26,10 +26,8 @@ jobs:
version: ${{ inputs.version || 'canary' }}

# Upload test results to KV, but only for scheduled runs.
upload_test_results:
name: Upload test results
needs: [next_js_integration]
# if: github.repository_owner == 'vercel' && ${{ github.event_name == 'schedule' }} && always()
if: always()
uses: ./.github/workflows/upload-nextjs-integration-test-results.yml
upload_turbopack_tests_manifest:
name: Upload Turbopack tests manifest to areweturboyet.com
if: ${{ !cancelled() }}
uses: ./.github/workflows/turbopack-upload-tests-manifest.yml
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
#
# Refer test.yml for how this workflow is being initialized
# - Workflow can specify `inputs.version` to specify which version of next.js to use, otherwise will use latest release version.
name: Turbopack Next.js integration test

on:
workflow_call:
inputs:
# Allow to specify Next.js version to run integration test against.
# If not specified, will use latest release version including canary.
version:
type: string
# The base of the test results to compare against. If not specified, will try to compare with latest main branch's test results.
diff_base:
type: string
default: 'main'
name: Turbopack Next.js integration tests

# Workflow-common env variables
env:
Expand Down Expand Up @@ -180,7 +168,7 @@ jobs:
- 'x64'
- 'metal'

if: always()
if: ${{ !cancelled() }}
steps:
- name: Download test report artifacts
id: download-test-reports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Update Turbopack test manifest
on:
schedule:
# Every day at 9AM https://crontab.guru/#0_9_*_*_*
- cron: '0 9 * * *'
- cron: '0 7 * * *'
workflow_dispatch:

jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reusable workflow to upload next.js integration test results to KV for https://areweturboyet.com/
# This workflow assumes the `next-integration-test` workflow has been executed
# and test reports have been uploaded to the `test-results` artifact.
name: Update next.js integration test results
name: Upload Turbopack tests manifest to areweturboyet.com

on:
workflow_call:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions docs/02-app/02-api-reference/01-components/script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body>{children}</body>
<Script
src="https://example.com/script.js"
strategy="beforeInteractive"
/>
<body>
{children}
<Script
src="https://example.com/script.js"
strategy="beforeInteractive"
/>
</body>
</html>
)
}
Expand All @@ -112,11 +114,13 @@ import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
<Script
src="https://example.com/script.js"
strategy="beforeInteractive"
/>
<body>
{children}
<Script
src="https://example.com/script.js"
strategy="beforeInteractive"
/>
</body>
</html>
)
}
Expand Down
4 changes: 2 additions & 2 deletions docs/02-app/02-api-reference/04-functions/cookies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ A method that takes a cookie name and returns a `boolean` based on if the cookie
import { cookies } from 'next/headers'

export default function Page() {
const cookiesList = cookies()
const hasCookie = cookiesList.has('theme')
const cookieStore = cookies()
const hasCookie = cookieStore.has('theme')
return '...'
}
```
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.2.0-canary.26"
"version": "14.2.0-canary.29"
}
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.2.0-canary.26",
"version": "14.2.0-canary.29",
"keywords": [
"react",
"next",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;
2 changes: 1 addition & 1 deletion packages/create-next-app/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const installTemplate = async ({
if (!tailwind)
copySource.push(
mode == "ts" ? "tailwind.config.ts" : "!tailwind.config.js",
"!postcss.config.cjs",
"!postcss.config.mjs",
);

await copy(copySource, root, {
Expand Down
6 changes: 3 additions & 3 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.2.0-canary.26",
"version": "14.2.0-canary.29",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,9 +10,9 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "14.2.0-canary.26",
"@next/eslint-plugin-next": "14.2.0-canary.29",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.1",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.28.1",
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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"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.2.0-canary.26",
"version": "14.2.0-canary.29",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ impl AppEndpoint {
Vc::upcast(FileSource::new(path)),
self.page.clone(),
self.app_project.project().project_path(),
None,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ pub async fn get_app_route_favicon_entry(
// TODO(alexkirsz) Get this from the metadata?
AppPage(vec![PageSegment::Static("/favicon.ico".to_string())]),
project_root,
None,
))
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,31 @@ use turbopack_binding::{
};

use crate::{
app_segment_config::NextSegmentConfig,
next_app::{AppEntry, AppPage, AppPath},
next_edge::entry::wrap_edge_entry,
parse_segment_config_from_source,
util::{load_next_js_template, NextRuntime},
};

/// Computes the entry for a Next.js app route.
/// # Arguments
///
/// * `original_segment_config` - A next segment config to be specified
/// explicitly for the given source.
/// For some cases `source` may not be the original but the handler (dynamic
/// metadata) which will lose segment config.
#[turbo_tasks::function]
pub async fn get_app_route_entry(
nodejs_context: Vc<ModuleAssetContext>,
edge_context: Vc<ModuleAssetContext>,
source: Vc<Box<dyn Source>>,
page: AppPage,
project_root: Vc<FileSystemPath>,
original_segment_config: Option<Vc<NextSegmentConfig>>,
) -> Result<Vc<AppEntry>> {
let config = parse_segment_config_from_source(source);
let config =
original_segment_config.unwrap_or_else(|| parse_segment_config_from_source(source));
let is_edge = matches!(config.await?.runtime, Some(NextRuntime::Edge));
let context = if is_edge {
edge_context
Expand Down
Loading

0 comments on commit 6885416

Please sign in to comment.