Skip to content

feat: support Next 13 #1714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [12, '*']
node-version: [14, '*']
exclude:
- os: macOS-latest
node-version: 12
node-version: 14
- os: windows-latest
node-version: 12
node-version: 14
fail-fast: false

steps:
Expand Down Expand Up @@ -50,12 +50,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [12, '*']
node-version: [14, '*']
exclude:
- os: macOS-latest
node-version: 12
node-version: 14
- os: windows-latest
node-version: 12
node-version: 14
fail-fast: false

if: github.ref_name == 'main'
Expand Down
2 changes: 1 addition & 1 deletion .vscode/feat-test.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"\treturn (",
"\t\t<div>",
"\t\t<h1>$1</h1>",
"\t\t<Link href=\"\"><a>Read Docs</a></Link>",
"\t\t<Link href=\"\">Read Docs</Link>",
"\t\t<p>Description of feature</p>",
"\t\t<p>Example/test of feature</p>",
"\t\t</div>",
Expand Down
2 changes: 1 addition & 1 deletion demos/base-path/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"next": "^12.3.0"
"next": "^12.3.2-canary.43"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion demos/custom-routes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
"next": "^12.3.0"
"next": "^12.3.2-canary.43"
},
"scripts": {
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion demos/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@reach/dialog": "^0.16.2",
"@reach/visually-hidden": "^0.16.0",
"@vercel/og": "^0.0.15",
"next": "^12.3.0",
"next": "^12.3.2-canary.43",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
17 changes: 10 additions & 7 deletions demos/default/pages/css/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@ function BuiltInCSSSupport() {
return (
<div>
<h1>Built In CSS Support</h1>
<Link href="https://nextjs.org/docs/basic-features/built-in-css-support"><a>Read Docs</a></Link>
<Link href="https://nextjs.org/docs/basic-features/built-in-css-support">Read Docs</Link>


<h2>CSS Modules</h2>
<p>CSS Modules are an optional feature and are only enabled for files with the .module.css extension. </p>
<p className={styles.error}>This is made with an imported css module</p>

<h2>Import styles from <code>node_modules</code></h2>
<h2>
Import styles from <code>node_modules</code>
</h2>
<p>This page imports a node module&apos;s css file for the dialog below:</p>
<ExampleDialog/>
<ExampleDialog />

<h2>Sass Support</h2>
<p>✅ Sass variable imported, color: {variables.primaryColor || <code>Error. Something went wrong</code>}</p>

<div data-testid="css-in-js">
<h2>CSS-in-JS</h2>
<p>NextJS bundles styled-jsx to provide support for isolated scoped CSS. The aim is to support &quot;shadow CSS&quot; similar to Web Components, which unfortunately do not support server-rendering and are JS-only.</p>
<p>
NextJS bundles styled-jsx to provide support for isolated scoped CSS. The aim is to support &quot;shadow
CSS&quot; similar to Web Components, which unfortunately do not support server-rendering and are JS-only.
</p>
<style jsx>{`
p {
color: white;
Expand All @@ -46,7 +50,6 @@ function BuiltInCSSSupport() {
}
`}</style>
</div>

</div>
)
}
Expand All @@ -70,4 +73,4 @@ function ExampleDialog() {
</Dialog>
</div>
)
}
}
4 changes: 1 addition & 3 deletions demos/default/pages/deep/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const Show = ({ show }) => (

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
17 changes: 9 additions & 8 deletions demos/default/pages/font.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ function Font() {
return (
<div>
{/* <Head> */}
<link
href="https://fonts.googleapis.com/css2?family=Inter&display=optional"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=Inter&display=optional" rel="stylesheet" />
{/* </Head> */}
<h1>Font Optimization</h1>
<Link href="https://nextjs.org/docs/basic-features/font-optimization"><a>Read Docs</a></Link>
<Link href="https://nextjs.org/docs/basic-features/font-optimization">Read Docs</Link>
<p>
By default, Next.js will automatically inline font CSS at build time, eliminating an extra round trip to fetch font declarations.
By default, Next.js will automatically inline font CSS at build time, eliminating an extra round trip to fetch
font declarations.
</p>
<p>
If optimized font is enabled (default), it should show <code>style</code>, otherwise it should show{' '}
<code>link</code> in the head
</p>
<p>If optimized font is enabled (default), it should show <code>style</code>, otherwise it should show <code>link</code> in the head</p>
</div>
)
}

export default Font
export default Font
4 changes: 1 addition & 3 deletions demos/default/pages/getServerSideProps/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const Show = ({ errorCode, show, env }) => {

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)
}
Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getServerSideProps/all/[[...slug]].js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const Show = ({ errorCode, show }) => {

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)
}
Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getServerSideProps/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ const Show = ({ show }) => (

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const Show = ({ show, time }) => (
<p>Rendered at {time} (slowly)</p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const Env = ({ env }) => (
<hr />
<p>env: {env}</p>

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const Show = ({ show }) => (

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/with-revalidate-404.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const Show = () => (
<div>
<p>This page is ISR, but will return a 404 if the current time ends in 0-4.</p>

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/with-revalidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const Show = ({ show }) => (

<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/withFallback/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const Show = ({ show, time }) => {
<p>Rendered at {time} </p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)
}
Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/withFallback/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const Show = ({ show, time }) => {
<p>Rendered at {time} </p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const Show = ({ show, time }) => (
<p>Rendered at {time} </p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
4 changes: 1 addition & 3 deletions demos/default/pages/getStaticProps/withRevalidate/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const Show = ({ show, time }) => (
<p>Rendered at {time} (slowly)</p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const Show = ({ show, time }) => {
<p>Rendered at {time} </p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const Show = ({ show, time }) => (
<p>Rendered at {time} </p>
<hr />

<Link href="/">
<a>Go back home</a>
</Link>
<Link href="/">Go back home</Link>
</div>
)

Expand Down
Loading