Skip to content

Commit d4160ac

Browse files
authored
feat: Add nextjs 16 compatibility. (#6744)
* feat: next16 compatibility for examples * fix: install liveness as bundled dependency * feat: next16 compatibility for docs * fix: license adjustment for dependencies * tests: adjust tests * Create sixty-bats-thank.md
1 parent 25cf198 commit d4160ac

File tree

151 files changed

+2131
-1769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+2131
-1769
lines changed

.changeset/sixty-bats-thank.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@aws-amplify/ui-docs": patch
3+
"@aws-amplify/ui-next-app-router-example": patch
4+
"@aws-amplify/ui-next-pages-router-example": patch
5+
---
6+
7+
feat: Add nextjs 16 compatibility.

.github/dependency-review/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,24 @@ allow-licenses:
3535
- 'zlib-acknowledgement'
3636
- 'Zlib'
3737
- 'LicenseRef-scancode-unicode'
38+
allow-dependencies-licenses:
39+
# These packages are needed for nextjs (more detailed sharp)
40+
# they are dynamic libraries and thus do not ship the underlying library
41+
# which means they are not under LGPL strictly speaking.
42+
# so an exception is valid here
43+
# ALSO: none of these are shipped to the customer. they're only used for examples.
44+
- 'pkg:npm/%2540img/sharp-libvips-darwin-arm64@1.2.4'
45+
- 'pkg:npm/%2540img/sharp-libvips-darwin-x64@1.2.4'
46+
- 'pkg:npm/%2540img/sharp-libvips-linux-arm@1.2.4'
47+
- 'pkg:npm/%2540img/sharp-libvips-linux-arm64@1.2.4'
48+
- 'pkg:npm/%2540img/sharp-libvips-linux-ppc64@1.2.4'
49+
- 'pkg:npm/%2540img/sharp-libvips-linux-riscv64@1.2.4'
50+
- 'pkg:npm/%2540img/sharp-libvips-linux-s390x@1.2.4'
51+
- 'pkg:npm/%2540img/sharp-libvips-linux-x64@1.2.4'
52+
- 'pkg:npm/%2540img/sharp-libvips-linuxmusl-arm64@1.2.4'
53+
- 'pkg:npm/%2540img/sharp-libvips-linuxmusl-x64@1.2.4'
54+
- 'pkg:npm/%2540img/sharp-wasm32'
55+
- 'pkg:npm/%2540img/sharp-win32-arm64'
56+
- 'pkg:npm/%2540img/sharp-win32-ia32'
57+
- 'pkg:npm/%2540img/sharp-win32-x64'
58+
- 'pkg:npm/unicode-match-property-value-ecmascript@2.2.1'

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Amplify UI is an open-source UI library with cloud-connected components that are
8989
| VisuallyHidden ||
9090

9191
## Version Support
92+
9293
AWS Amplify UI library (React, React Native, Angular, and Vue) that depends on AWS Amplify JavaScript library v4 and below will end support on **April 13, 2026**, as documented in our [AWS Amplify UI libraries version support calendar](https://github.com/aws-amplify/amplify-ui/issues/6712).
9394

9495
Effective immediately, the AWS Amplify UI library that depends on AWS Amplify JavaScript library v4 and below will enter **Maintenance Mode** until April 13, 2026 after which it will receive no more updates. While in Maintenance Mode, the libraries will only receive updates for **critical bug fixes and security vulnerabilities**. Refer to [Amplify Documentation](https://docs.amplify.aws/reference/maintenance-policy) for more information on the maintenance policy.
@@ -119,3 +120,11 @@ As we continue to work on the new Amplify UI we will move UI-related issues in t
119120
## We love contributors!!
120121

121122
See our contributing guide [CONTRIBUTING.md](/CONTRIBUTING.md) to help us scale Amplify UI!
123+
124+
---
125+
126+
## License Note
127+
128+
Although this repository is released and licensed under the Apache License (see [LICENSE](./LICENSE)), devDependencies of some packages (namely: [docs](./docs), the [next-example](./examples/next) as well as the [next-app-router example](./examples/next-app-router)) transitively use the third party [sharp](https://sharp.pixelplumbing.com/) project through NEXT.js
129+
130+
The sharp projects prebuilt binaries' licensing includes [LGPL-2.1](https://opensource.org/license/LGPL-2.1) and [LGPL-3.0-or-later](https://opensource.org/license/LGPL-3.0) licenses

build-system-tests/e2e/cypress/integration/common/shared.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,21 @@ Given(
2929
When('I click the {string} tab', (label: string) => {
3030
cy.findByRole('tab', {
3131
name: new RegExp(`^${escapeRegExp(label)}$`, 'i'),
32+
timeout: 5000,
3233
}).click();
3334
});
3435

3536
When('I click the {string} button', (name: string) => {
3637
cy.findByRole('button', {
3738
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'),
39+
timeout: 5000,
3840
}).click();
3941
});
4042

4143
Then('I see the {string} button', (name: string) => {
4244
cy.findByRole('button', {
4345
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'),
46+
timeout: 5000,
4447
}).should('be.visible');
4548
});
4649

docs/next-env.d.ts

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"flutter:clean": "rm -rf public/flutter/authenticator",
1111
"flutter:copy": "cp -r ./flutter/authenticator/build/web public/flutter/authenticator",
1212
"prebuild": "yarn build:cssvars-table && yarn build:props-tables",
13-
"build": "NODE_OPTIONS=\"--max-old-space-size=4096\" next build",
13+
"build": "NODE_OPTIONS=\"--max-old-space-size=4096\" next build --webpack",
1414
"build:cssvars-table": "node --require esbuild-register ./scripts/generate-cssvars-table-data.ts",
1515
"build:props-tables": "node --require esbuild-register ./scripts/generate-props-tables-data.ts",
1616
"clean": "rimraf node_modules .next && yarn flutter:clean",
@@ -35,8 +35,8 @@
3535
"gray-matter": "^4.0.3",
3636
"lodash": "^4.17.21",
3737
"mdx-prism": "^0.3.3",
38-
"next": "^14.2.35",
39-
"next-plugin-preval": "^1.2.1",
38+
"next": "^16.0.0",
39+
"next-plugin-preval": "^1.2.8",
4040
"prism-react-renderer": "1.2.1",
4141
"raw-loader": "^4.0.2",
4242
"react": "^18.3.0",

docs/tsconfig.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"target": "es5",
5-
"lib": ["dom", "dom.iterable", "esnext"],
5+
"lib": [
6+
"dom",
7+
"dom.iterable",
8+
"esnext"
9+
],
610
"paths": {
7-
"@/components/*": ["src/components/*"],
8-
"@/data/*": ["src/data/*"],
9-
"@/utils/*": ["src/utils/*"],
10-
"aws-amplify/storage": ["storageMock.ts"]
11+
"@/components/*": [
12+
"src/components/*"
13+
],
14+
"@/data/*": [
15+
"src/data/*"
16+
],
17+
"@/utils/*": [
18+
"src/utils/*"
19+
],
20+
"aws-amplify/storage": [
21+
"storageMock.ts"
22+
]
1123
},
1224
"allowJs": true,
1325
"skipLibCheck": true,
@@ -20,11 +32,17 @@
2032
"resolveJsonModule": true,
2133
"isolatedModules": true,
2234
"downlevelIteration": true,
23-
"jsx": "preserve",
35+
"jsx": "react-jsx",
2436
"incremental": true
2537
},
26-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
27-
"exclude": ["node_modules"],
38+
"include": [
39+
"next-env.d.ts",
40+
"**/*.ts",
41+
"**/*.tsx"
42+
],
43+
"exclude": [
44+
"node_modules"
45+
],
2846
"ts-node": {
2947
"compilerOptions": {
3048
"module": "CommonJS"

examples/next-app-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@aws-amplify/ui-react": "6.13.2",
1313
"@aws-amplify/ui-react-storage": "3.14.0",
1414
"react": "^18.3.0",
15-
"next": "^14.2.35",
15+
"next": "^16.0.0",
1616
"react-dom": "^18",
1717
"react-icons": "^4.3.1"
1818
},

examples/next-app-router/src/app/theme-switcher/layout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ import { Header } from '@/components/Header';
66
import ThemeToggle from '@/components/ThemeToggle';
77
import { cookies } from 'next/headers';
88

9-
export default function Layout({ children }: { children: React.ReactNode }) {
10-
const cookieStore = cookies();
9+
export default async function Layout({
10+
children,
11+
}: {
12+
children: React.ReactNode;
13+
}) {
14+
const cookieStore = await cookies();
1115
const colorMode = (cookieStore.get('colorMode')?.value ??
1216
'dark') as ColorMode;
1317

examples/next/next-env.d.ts

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)