Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nextjs): Consider
pageExtensions
option in auto instrumentation (…
- Loading branch information
Showing
9 changed files
with
65 additions
and
4 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
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
12 changes: 12 additions & 0 deletions
12
packages/nextjs/test/integration/pages/customPageExtension.page.tsx
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 @@ | ||
const BasicPage = (): JSX.Element => ( | ||
<h1> | ||
This page simply exists to test the compatibility of Next.js' `pageExtensions` option with our auto wrapping | ||
process. This file should be turned into a page by Next.js and our webpack loader should process it. | ||
</h1> | ||
); | ||
|
||
export async function getServerSideProps() { | ||
return { props: { data: '[some getServerSideProps data]' } }; | ||
} | ||
|
||
export default BasicPage; |
3 changes: 3 additions & 0 deletions
3
packages/nextjs/test/integration/pages/unmatchedCustomPageExtension.someExtension
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 @@ | ||
This page simply exists to test the compatibility of Next.js' `pageExtensions` option with our auto wrapping | ||
process. This file should not be turned into a page by Next.js and our webpack loader also shouldn't process it. | ||
This page should not contain valid JavaScript. |
36 changes: 36 additions & 0 deletions
36
...nextjs/test/integration/test/server/tracingServerGetServerSidePropsCustomPageExtension.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,36 @@ | ||
const assert = require('assert'); | ||
|
||
const { sleep } = require('../utils/common'); | ||
const { getAsync, interceptTracingRequest } = require('../utils/server'); | ||
|
||
module.exports = async ({ url: urlBase, argv }) => { | ||
const url = `${urlBase}/customPageExtension`; | ||
|
||
const capturedRequest = interceptTracingRequest( | ||
{ | ||
contexts: { | ||
trace: { | ||
op: 'http.server', | ||
status: 'ok', | ||
}, | ||
}, | ||
transaction: '/customPageExtension', | ||
transaction_info: { | ||
source: 'route', | ||
changes: [], | ||
propagations: 0, | ||
}, | ||
type: 'transaction', | ||
request: { | ||
url, | ||
}, | ||
}, | ||
argv, | ||
'tracingServerGetServerSidePropsCustomPageExtension', | ||
); | ||
|
||
await getAsync(url); | ||
await sleep(250); | ||
|
||
assert.ok(capturedRequest.isDone(), 'Did not intercept expected request'); | ||
}; |