Skip to content
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

fix(nuxt): Re-export 'default' exports with rollup plugin #13984

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Oct 15, 2024

While the preset for Netlify exports the serverless handler function as export { D as default }, the Vercel preset exports this handler as export { D as handler };.

This PR makes some adaptions to the code generation in the plugin to make it possible to re-export default functions. The previous snippet did not work as default is obviously not allowed as a function name.

@s1gr1d s1gr1d requested review from Lms24 and lforst October 15, 2024 11:52
Copy link
Contributor

github-actions bot commented Oct 15, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.73 KB added added
@sentry/browser - with treeshaking flags 21.53 KB added added
@sentry/browser (incl. Tracing) 35.01 KB added added
@sentry/browser (incl. Tracing, Replay) 71.68 KB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.07 KB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 76.01 KB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 88.78 KB added added
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.63 KB added added
@sentry/browser (incl. metrics) 27 KB added added
@sentry/browser (incl. Feedback) 39.87 KB added added
@sentry/browser (incl. sendFeedback) 27.38 KB added added
@sentry/browser (incl. FeedbackAsync) 32.17 KB added added
@sentry/react 25.49 KB added added
@sentry/react (incl. Tracing) 37.97 KB added added
@sentry/vue 26.91 KB added added
@sentry/vue (incl. Tracing) 36.9 KB added added
@sentry/svelte 22.87 KB added added
CDN Bundle 24.11 KB added added
CDN Bundle (incl. Tracing) 36.84 KB added added
CDN Bundle (incl. Tracing, Replay) 71.47 KB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 76.78 KB added added
CDN Bundle - uncompressed 70.7 KB added added
CDN Bundle (incl. Tracing) - uncompressed 109.36 KB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 221.72 KB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 234.94 KB added added
@sentry/nextjs (client) 37.94 KB added added
@sentry/sveltekit (client) 35.6 KB added added
@sentry/node 124.9 KB added added
@sentry/node - without tracing 94.13 KB added added
@sentry/aws-serverless 103.7 KB added added

@s1gr1d s1gr1d merged commit 7a54dcd into sig/server-wrapping-default Oct 15, 2024
1 check passed
@s1gr1d s1gr1d deleted the sig/fix-default-export branch October 15, 2024 12:02
Copy link

codecov bot commented Oct 15, 2024

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
237 5 232 8
View the top 3 failed tests by shortest run time
tracing.server.test.ts sends a server action transaction on pageload
Stack Traces | 30s run time
tracing.server.test.ts:5:1 sends a server action transaction on pageload
tracing.test.ts distributed tracing › capture a distributed pageload trace
Stack Traces | 30s run time
tracing.test.ts:7:3 capture a distributed pageload trace
tracing.server.test.ts does not send transactions for build asset folder "_nuxt"
Stack Traces | 30s run time
tracing.server.test.ts:24:1 does not send transactions for build asset folder "_nuxt"

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

s1gr1d added a commit that referenced this pull request Oct 16, 2024
While the preset for Netlify exports the serverless handler function as
`export { D as default }`, the Vercel preset exports this handler as
`export { D as handler };`.

This PR makes some adaptions to the code generation in the plugin to
make it possible to re-export `default` functions. The previous snippet
did not work as `default` is obviously not allowed as a function name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants