-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Add defineConfig
function to next/config
#67963
base: canary
Are you sure you want to change the base?
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
defineConfig
function to next/config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a review everything looks ok, let me know if you see anything you don't like, I'll correct it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some reservations for adding a new API to the overall surface area now that next.config.ts
exists. I could probably be convinced, but at least for this PR, we definitely shouldn't update every place in the docs to use the new API until it's a bit more tested (regardless).
Hi @leerob, thanks for the feedback, so maybe the ideal would be to keep the current documentation and add a part in the documentation that explains how to use it and specifies that it's experimental? |
And also, do we keep it in the templates or add it when it's really been tested and approved? |
585a05a
to
696ab0b
Compare
I've removed all the changes I've made to the documentation, because with hindsight, it will be preferable to integrate it gradually, depending on whether or not the community adopts this feature. |
Even tho it's used in all the popular frameworks but what's the usecase of it when u can import the type and use it? Using a fn adds some runtime processing too and using ts type, you are still getting all the autocompletes |
Hey @imranbarbhuiya, I would say:
Important Keep in mind that this isn't the game changer, it should be seen as a help for newcomers and/or a way of aligning with competing frameworks and their users migrating to/learning Next.js. |
What did I change?
I added a
defineConfig
function inruntime-config.external.ts
.But to be honest I think it would make more sense if it was in
config-shared.ts
the problem is that you would useinstead of
like vuejs, vitejs, solidjs, cypress or others do.
Why did I change it?
Fixes: https://x.com/nurodev/status/1813945402049388893
Preview and Usage
define-config.mp4