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

perf(nuxt): export DefineNuxtConfig interface from next/config #22391

Merged
merged 2 commits into from Jul 29, 2023

Conversation

beerose
Copy link
Contributor

@beerose beerose commented Jul 29, 2023

Improve TypeScript performance around defineNuxtConfig.

πŸ”— Linked issue

N/A

❓ Type of change

  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)

πŸ“š Description

I was checking out a newly generated Nuxt app for possible TS performance improvements. Found one place β€” defineNuxtConfig function. Defining and using an interface DefineNuxtConfig instead of typeof import('nuxt/config')['defineNuxtConfig'] slightly improves perf. This is not a mindblowing improvement, but it's something.

Before:
CleanShot 2023-07-29 at 19 40 19@2x

After:
CleanShot 2023-07-29 at 19 27 33@2x

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Jul 29, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ❀️

@danielroe danielroe merged commit c044d0e into nuxt:main Jul 29, 2023
29 checks passed
@github-actions github-actions bot mentioned this pull request Jul 29, 2023
@beerose beerose deleted the define-config-perf branch July 29, 2023 18:35
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.

None yet

2 participants