Skip to content

Commit c754dd5

Browse files
committed
feat: Add nextjs 16 compatibility.
1 parent 8d715dc commit c754dd5

File tree

136 files changed

+2021
-455
lines changed

Some content is hidden

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

136 files changed

+2021
-455
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"gray-matter": "^4.0.3",
3636
"lodash": "^4.17.21",
3737
"mdx-prism": "^0.3.3",
38-
"next": "^14.2.31",
38+
"next": "^16.0.0",
3939
"next-plugin-preval": "^1.2.1",
4040
"prism-react-renderer": "1.2.1",
4141
"raw-loader": "^4.0.2",

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.1",
1313
"@aws-amplify/ui-react-storage": "3.13.1",
1414
"react": "^18.3.0",
15-
"next": "^14.2.31",
15+
"next": "^16.0.0",
1616
"react-dom": "^18",
1717
"react-icons": "^4.3.1"
1818
},

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.

examples/next/next.config.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
const { patchWebpackConfig } = require('next-global-css');
1+
const { withGlobalCss } = require('next-global-css');
22

3-
module.exports = {
3+
const withConfig = withGlobalCss();
4+
/** @type {import('next').NextConfig} */
5+
const nextConfig = {
46
reactStrictMode: true,
57
/**
68
* Setting trailingSlash to true to resolve known bug with federated sign in redirect + next.js
79
* https://github.com/aws-amplify/amplify-cli/issues/7359#issuecomment-812821315
810
*/
911
trailingSlash: true,
12+
transpilePackages: [
13+
'@mediapipe/face_detection',
14+
'@tensorflow-models/face-detection',
15+
'@aws-amplify/ui-react-liveness',
16+
],
1017
pageExtensions: ['page.tsx'],
11-
webpack: (config, options) => {
12-
// allows importing of css files inside modules
13-
patchWebpackConfig(config, options);
14-
15-
return config;
16-
},
1718
};
19+
20+
module.exports = nextConfig;

examples/next/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"@aws-amplify/ui-react-notifications": "^2.2.13",
1818
"@aws-amplify/ui-react-storage": "^3.13.1",
1919
"@aws-sdk/credential-providers": "^3.370.0",
20-
"next": "^14.2.31",
21-
"next-global-css": "^1.1.1",
20+
"next": "~16.0.0",
21+
"next-global-css": "^1.3.1",
2222
"react": "^18.3.0",
2323
"react-copy-to-clipboard": "^5.1.0",
2424
"react-dom": "^18.3.0",
@@ -29,7 +29,7 @@
2929
"devDependencies": {
3030
"@types/node": "^15.12.4",
3131
"eslint": "^8.44.0",
32-
"eslint-config-next": "^13.5.5",
32+
"eslint-config-next": "^16.0.0",
3333
"rimraf": "^5.0.0"
3434
}
3535
}

examples/next/pages/_app.page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { Hub } from 'aws-amplify/utils';
88
import { ThemeProvider } from '@aws-amplify/ui-react';
99
import { useEffect } from 'react';
1010
import { MapProvider, useMap } from 'react-map-gl';
11+
import '@aws-amplify/ui-react/styles.css';
12+
import '@aws-amplify/ui-react-storage/styles.css';
13+
import '@aws-amplify/ui-react-geo/styles.css';
14+
import '@aws-amplify/ui-react-liveness/styles.css';
1115

1216
if (typeof window !== 'undefined') {
1317
window['Amplify'] = Amplify;

examples/next/pages/examples/listings/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
import * as React from 'react';
22
import {
3+
ColorMode,
4+
ThemeProvider,
35
ToggleButton,
46
ToggleButtonGroup,
5-
ThemeProvider,
6-
ColorMode,
77
} from '@aws-amplify/ui-react';
8-
import { MdWbSunny, MdBedtime, MdTonality } from 'react-icons/md';
8+
import { MdBedtime, MdTonality, MdWbSunny } from 'react-icons/md';
99

1010
import { theme } from '../../../theme';
1111
import { Logo } from './Logo';
12-
import '@aws-amplify/ui-react/styles.css';
13-
import './styles.scss';
12+
import './styles.module.scss';
1413

1514
export const App = ({ children }) => {
1615
const [colorMode, setColorMode] = React.useState<ColorMode>('system');
1716
return (
1817
<ThemeProvider theme={theme} colorMode={colorMode}>
1918
<header className="listing-app-header">
2019
<Logo />
21-
<input type="search" placeholder="search" />
20+
<input type="search" placeholder="search" className="search-input" />
2221
<ToggleButtonGroup
2322
value={colorMode}
2423
isExclusive

examples/next/pages/examples/listings/styles.scss renamed to examples/next/pages/examples/listings/styles.module.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ h6.amplify-heading {
7070
.experience-card {
7171
position: relative;
7272
transition: all var(--amplify-time-medium);
73-
73+
7474
& img {
7575
display: block;
7676
}
77-
77+
7878
&:hover {
7979
transform: scale(1.05);
80-
80+
8181
& > .experience-card-text {
8282
transform: scale(1.1);
8383
}
@@ -108,15 +108,15 @@ h6.amplify-heading {
108108
padding-right: var(--amplify-space-xxs);
109109
}
110110

111-
input[type='search'] {
111+
.search-input {
112112
border-radius: 5rem;
113113
border-color: var(--amplify-colors-border-tertiary);
114114
border-width: 1px;
115115
border-style: solid;
116116
padding: var(--amplify-space-small) var(--amplify-space-large);
117117
width: 30rem;
118118
background-color: var(--amplify-colors-background-primary);
119-
119+
120120
&:focus {
121121
outline: none;
122122
border-color: var(--amplify-colors-primary-60);

examples/next/pages/ui/components/accordion.page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import * as React from 'react';
22
import {
3-
Button,
43
Accordion,
4+
Button,
5+
Divider,
56
Flex,
67
Heading,
7-
Divider,
88
Text,
9+
TextField,
910
} from '@aws-amplify/ui-react';
10-
import '@aws-amplify/ui-react/styles.css';
11-
import { TextField } from '@aws-amplify/ui-react';
1211

1312
const accordions = [
1413
{

examples/next/pages/ui/components/account-settings/change-password-with-overrides/index.page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import React from 'react';
33
import { Amplify } from 'aws-amplify';
44

55
import {
6+
AccountSettings,
67
Button,
78
Card,
89
Flex,
910
Heading,
10-
AccountSettings,
1111
withAuthenticator,
1212
} from '@aws-amplify/ui-react';
13-
import '@aws-amplify/ui-react/styles.css';
1413

1514
import awsExports from './aws-exports';
15+
1616
Amplify.configure(awsExports);
1717

1818
const components = {

0 commit comments

Comments
 (0)