-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into fix-dedupe-next-image-requests
- Loading branch information
Showing
36 changed files
with
864 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ | |
"registry": "https://registry.npmjs.org/" | ||
} | ||
}, | ||
"version": "10.1.4-canary.4" | ||
"version": "10.1.4-canary.6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/integration/required-server-files-ssr-404/lib/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
let curConfig | ||
|
||
const idk = Math.random() | ||
|
||
export default () => { | ||
console.log('returning config', idk, curConfig) | ||
return curConfig | ||
} | ||
|
||
export function setConfig(configValue) { | ||
curConfig = configValue | ||
console.log('set config', idk, configValue) | ||
} |
12 changes: 12 additions & 0 deletions
12
test/integration/required-server-files-ssr-404/next.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
// ensure incorrect target is overridden by env | ||
target: 'serverless', | ||
rewrites() { | ||
return [ | ||
{ | ||
source: '/some-catch-all/:path*', | ||
destination: '/', | ||
}, | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function NotFound() { | ||
return 'custom 404' | ||
} |
18 changes: 18 additions & 0 deletions
18
test/integration/required-server-files-ssr-404/pages/[slug].js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const getStaticProps = () => { | ||
return { | ||
props: { | ||
hello: 'world', | ||
}, | ||
} | ||
} | ||
|
||
export const getStaticPaths = () => { | ||
return { | ||
paths: [], | ||
fallback: true, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
return <p id="slug-page">[slug] page</p> | ||
} |
17 changes: 17 additions & 0 deletions
17
test/integration/required-server-files-ssr-404/pages/_app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import App from 'next/app' | ||
import { setConfig } from '../lib/config' | ||
|
||
setConfig({ hello: 'world' }) | ||
|
||
function MyApp({ Component, pageProps }) { | ||
return <Component {...pageProps} /> | ||
} | ||
|
||
MyApp.getInitialProps = async (appContext) => { | ||
// calls page's `getInitialProps` and fills `appProps.pageProps` | ||
const appProps = await App.getInitialProps(appContext) | ||
|
||
return { ...appProps } | ||
} | ||
|
||
export default MyApp |
7 changes: 7 additions & 0 deletions
7
test/integration/required-server-files-ssr-404/pages/api/optional/[[...rest]].js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default (req, res) => { | ||
console.log(req.url, 'query', req.query) | ||
res.json({ | ||
url: req.url, | ||
query: req.query, | ||
}) | ||
} |
29 changes: 29 additions & 0 deletions
29
test/integration/required-server-files-ssr-404/pages/catch-all/[[...rest]].js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export const getStaticProps = ({ params }) => { | ||
return { | ||
props: { | ||
hello: 'world', | ||
params: params || null, | ||
random: Math.random(), | ||
}, | ||
} | ||
} | ||
|
||
export const getStaticPaths = () => { | ||
return { | ||
paths: ['/catch-all/hello'], | ||
fallback: true, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<p id="catch-all">optional catch-all page</p> | ||
<p id="router">{JSON.stringify(router)}</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
test/integration/required-server-files-ssr-404/pages/dynamic/[slug].js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export const getServerSideProps = ({ params }) => { | ||
return { | ||
props: { | ||
hello: 'world', | ||
slug: params.slug, | ||
random: Math.random(), | ||
}, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<p id="dynamic">dynamic page</p> | ||
<p id="slug">{props.slug}</p> | ||
<p id="router">{JSON.stringify(router)}</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
test/integration/required-server-files-ssr-404/pages/errors/gip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function Page(props) { | ||
return <p>here comes an error</p> | ||
} | ||
|
||
Page.getInitialProps = ({ query }) => { | ||
if (query.crash) { | ||
throw new Error('gip hit an oops') | ||
} | ||
return { | ||
hello: 'world', | ||
} | ||
} | ||
|
||
export default Page |
Oops, something went wrong.