Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/example-app-router-migration/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
/// <reference path="./.next/types/routes.d.ts" />
import './.next/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
8 changes: 4 additions & 4 deletions examples/example-app-router-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"start": "next start"
},
"dependencies": {
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@types/lodash": "^4.17.5",
"@types/node": "^20.14.5",
"@types/react": "^19.2.0",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"@eslint/eslintrc": "^3.1.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router-mixed-routing/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import './.next/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
10 changes: 5 additions & 5 deletions examples/example-app-router-mixed-routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"name": "example-app-router-mixed-routing",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "eslint src && prettier src --check",
"test": "playwright test",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"tailwindcss": "^3.4.4"
},
"devDependencies": {
Expand All @@ -22,7 +22,7 @@
"@types/react": "^19.2.0",
"autoprefixer": "^10.4.19",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"postcss": "^8.5.3",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router-next-auth/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import './.next/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
8 changes: 4 additions & 4 deletions examples/example-app-router-next-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start": "next start"
},
"dependencies": {
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-auth": "^4.24.11",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
Expand All @@ -22,7 +22,7 @@
"@types/node": "^20.14.5",
"@types/react": "^19.2.0",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router-playground/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
12 changes: 6 additions & 6 deletions examples/example-app-router-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
"@radix-ui/react-dropdown-menu": "^2.1.6",
"lodash": "^4.17.21",
"ms": "2.1.3",
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@jest/globals": "^29.7.0",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@next/bundle-analyzer": "^15.5.0",
"@next/mdx": "^15.5.0",
"@next/bundle-analyzer": "16.0.0-beta.0",
"@next/mdx": "16.0.0-beta.0",
"@playwright/test": "^1.51.1",
"@storybook/nextjs": "^8.6.4",
"@storybook/react": "^8.6.4",
Expand All @@ -40,7 +40,7 @@
"chokidar-cli": "3.0.0",
"css-loader": "^6.8.1",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.3.3",
Expand Down
25 changes: 17 additions & 8 deletions examples/example-app-router-playground/tests/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ import {assertLocaleCookieValue, getAlternateLinks} from './utils';

const describe = it.describe;

function getPageLoadTracker(context: BrowserContext) {
function getPageLoadTracker(
context: BrowserContext,
pathnameWithSearch: string
) {
const state = {numPageLoads: 0};

context.on('request', (request) => {
// Is the same in dev and prod
if (request.url().includes('/chunks/main-app')) {
context.on('response', (response) => {
const url = new URL(response.url());
const curPathnameWithSearch = url.pathname + url.search;
const contentType = response.headers()['content-type'] || '';

if (
curPathnameWithSearch === pathnameWithSearch &&
contentType.includes('text/html')
) {
state.numPageLoads++;
}
});
Expand Down Expand Up @@ -271,7 +280,7 @@ it('can use `Link` to link to the root of another language', async ({page}) => {
});

it('uses client-side transitions when using link', async ({context, page}) => {
const tracker = getPageLoadTracker(context);
const tracker = getPageLoadTracker(context, '/');

await page.goto('/');
expect(tracker.numPageLoads).toBe(1);
Expand All @@ -288,16 +297,16 @@ it('uses client-side transitions when using link', async ({context, page}) => {
await expect(page).toHaveURL('/nested');
expect(tracker.numPageLoads).toBe(1);

await page.goForward();
await expect(page).toHaveURL('/client');
await page.goBack();
await expect(page).toHaveURL('/');
expect(tracker.numPageLoads).toBe(1);
});

it('keeps the locale cookie updated when changing the locale and uses soft navigation (no reloads)', async ({
context,
page
}) => {
const tracker = getPageLoadTracker(context);
const tracker = getPageLoadTracker(context, '/');

await page.goto('/');
await assertLocaleCookieValue(page, undefined);
Expand Down
25 changes: 19 additions & 6 deletions examples/example-app-router-playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"allowArbitraryExtensions": true,
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"strict": true,
"allowJs": true,
"skipLibCheck": true,
Expand All @@ -12,20 +16,29 @@
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": [
"./src/*"
]
},

// See https://github.com/amannn/next-intl/pull/1509
"declaration": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
10 changes: 5 additions & 5 deletions examples/example-app-router-single-locale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"name": "example-app-router-single-locale",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "eslint src && prettier src --check",
"test": "playwright test",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@playwright/test": "^1.51.1",
Expand All @@ -21,7 +21,7 @@
"@types/react": "^19.2.0",
"@eslint/eslintrc": "^3.1.0",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
},
Expand Down
10 changes: 5 additions & 5 deletions examples/example-app-router-without-i18n-routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example-app-router-without-i18n-routing",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "eslint src && prettier src --check",
"test": "playwright test",
"build": "next build",
Expand All @@ -13,10 +13,10 @@
"@radix-ui/react-select": "^2.1.6",
"clsx": "^2.1.1",
"lodash": "^4.17.21",
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"zod": "^3.24.2"
},
"devDependencies": {
Expand All @@ -28,7 +28,7 @@
"@types/react-dom": "^19.2.0",
"autoprefixer": "^10.4.19",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"postcss": "^8.5.3",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
10 changes: 5 additions & 5 deletions examples/example-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example-app-router",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "eslint src && prettier src --check",
"test": "pnpm run test:playwright && pnpm run test:jest",
"test:playwright": "playwright test",
Expand All @@ -12,10 +12,10 @@
},
"dependencies": {
"clsx": "^2.1.1",
"next": "^15.5.0",
"next": "16.0.0-beta.0",
"next-intl": "^4.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"tailwindcss": "^3.4.4"
},
"devDependencies": {
Expand All @@ -29,7 +29,7 @@
"@types/react": "^19.2.0",
"autoprefixer": "^10.4.19",
"eslint": "9.11.1",
"eslint-config-next": "^15.5.0",
"eslint-config-next": "16.0.0-beta.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"postcss": "^8.5.3",
Expand Down
24 changes: 19 additions & 5 deletions examples/example-app-router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"allowArbitraryExtensions": true,
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"strict": true,
"allowJs": true,
"skipLibCheck": true,
Expand All @@ -12,17 +16,27 @@
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": [
"./src/*"
]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading