-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(nuxt)!: Bundle server config into Nitro build #24094
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
Open
s1gr1d
wants to merge
15
commits into
develop
Choose a base branch
from
sig/nuxt-server-config-auto-add
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+808
−353
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8ca6962
cloudflare util
s1gr1d bece846
fix package detection
s1gr1d a84ae4f
add deprecations
s1gr1d 03efd42
crash tests
s1gr1d 24c0354
double init guard
s1gr1d 89729c3
check for prerender runtime
s1gr1d c133bb8
feat(nuxt)!: Bundle server config into Nitro build
s1gr1d 5d60a39
Merge branch 'develop' into sig/nuxt-server-config-auto-add
s1gr1d 830a18a
add migration guide
s1gr1d 1b7dc6d
fix nuxt-4-static test
s1gr1d 62e6b3a
add prerender event sink test
s1gr1d 7e6d1ad
fix cloudflare handling
s1gr1d 8a8d572
fix db dev tests
s1gr1d ad2a201
add missing commits
s1gr1d 078be4f
update comments
s1gr1d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
55 changes: 0 additions & 55 deletions
55
dev-packages/e2e-tests/test-applications/nuxt-4-static/nuxt-start-dev-server.bash
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
9 changes: 9 additions & 0 deletions
9
dev-packages/e2e-tests/test-applications/nuxt-4/instrument-preload.mjs
This file contains hidden or 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,9 @@ | ||
| // Simulates a v10-style `node --import` preload that fully initializes the SDK | ||
| // before the config bundled into the server build runs its own `Sentry.init`. | ||
| import * as Sentry from '@sentry/nuxt'; | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| tracesSampleRate: 1.0, | ||
| tunnel: 'http://localhost:3031/', | ||
| }); |
55 changes: 0 additions & 55 deletions
55
dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
dev-packages/e2e-tests/test-applications/nuxt-4/scripts/build-with-prerender-event-sink.mjs
This file contains hidden or 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,30 @@ | ||
| // Runs `nuxt build` with a sink on the Sentry tunnel port and records how many envelopes arrive, | ||
| // so tests can assert that prerendering sends no telemetry during the build. | ||
| import { spawn } from 'node:child_process'; | ||
| import { mkdirSync, writeFileSync } from 'node:fs'; | ||
| import { createServer } from 'node:http'; | ||
|
|
||
| let envelopeCount = 0; | ||
| const sink = createServer((req, res) => { | ||
| req.resume(); | ||
| req.on('end', () => { | ||
| envelopeCount += 1; | ||
| res.writeHead(200).end('{}'); | ||
| }); | ||
| }); | ||
|
|
||
| const sinkAvailable = await new Promise(resolve => { | ||
| sink.once('error', () => resolve(false)); | ||
| sink.listen(3031, () => resolve(true)); | ||
| }); | ||
|
|
||
| const build = spawn('nuxt', ['build'], { stdio: 'inherit', shell: true }); | ||
| const exitCode = await new Promise(resolve => build.on('exit', resolve)); | ||
|
|
||
| sink.close(); | ||
| mkdirSync('.output', { recursive: true }); | ||
| writeFileSync( | ||
| '.output/build-envelope-count.json', | ||
| JSON.stringify({ envelopeCount: sinkAvailable ? envelopeCount : null }), | ||
| ); | ||
| process.exit(exitCode ?? 1); |
9 changes: 9 additions & 0 deletions
9
dev-packages/e2e-tests/test-applications/nuxt-4/server/plugins/aa-eval-crash.ts
This file contains hidden or 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,9 @@ | ||
| import { defineNitroPlugin } from 'nitropack/runtime'; | ||
|
|
||
| // Throws during module evaluation, before any plugin function runs. | ||
| // The `aa-` prefix makes this the first scanned plugin. | ||
| if (process.env.SENTRY_TEST_EVAL_CRASH) { | ||
| throw new Error('eval-crash-test'); | ||
| } | ||
|
|
||
| export default defineNitroPlugin(() => {}); |
9 changes: 9 additions & 0 deletions
9
dev-packages/e2e-tests/test-applications/nuxt-4/server/plugins/zz-startup-crash.ts
This file contains hidden or 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,9 @@ | ||
| import { defineNitroPlugin } from 'nitropack/runtime'; | ||
|
|
||
| // Throws while nitro runs its plugins, before `listen`. | ||
| // The `zz-` prefix makes this the last scanned plugin (`aa-eval-crash.ts` covers the earliest point). | ||
| export default defineNitroPlugin(() => { | ||
| if (process.env.SENTRY_TEST_STARTUP_CRASH) { | ||
| throw new Error('startup-crash-test'); | ||
| } | ||
| }); |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.