-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 quick setup section for Vite in documentation #7416
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size changes📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
@@ -31,6 +30,16 @@ If your app has unusual constraints not served well by these frameworks, or you | |||
|
|||
</DeepDive> | |||
|
|||
## Quick Setup {/*quick-setup*/} |
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.
Instead of emphasizing that this option is "quick", maybe it would be better to emphasize what the drawbacks are (drawbacks are already described in the section "Can I use React without a framework?" above) and what developers miss out on with a simple Vite setup:
- Maybe a better heading here would be "Frontend-only React" or something (since Vite is not integrated with React Server Components yet - aside from some Vite RSC experiments)
- Since the Vite option has drawbacks, I guess the section makes more sense further down, after the "Production-grade React frameworks"
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.
Hmm, thinking more on it, it seems as if the "Can I use React without a framework?" section above already covers a lot of the drawbacks to using setups like Vite, and also links to it
Maybe it doesn't need to be more visible than that?
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.
The issue is that it isn't visible at all.
Check the issue connected to this PR.
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.
Please stop forcing users to choose NextJS. This makes no sense. SPA is still the best choice for most projects that don't need SEO optimization.
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.
Next.js and other production-ready frameworks also have SPA support:
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.
Hosting platforms generally let you configure a reverse proxy to maintain SPA and MPA like routing, so that shouldn't cause issues with static exports specifically.
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.
Next js Static export still isn’t an spa though.
Remix has an spa mode but even that doesn’t behave like a real spa
remix-run/remix#9008
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 do find it strange how React is supposedly just a library, and yet it almost dictates that you should use a full-stack framework. Almost as if there is some financial incentive involved between React and Vercel, but I'm a cynic so ...
In either case, the current wording makes it seem as if the only correct way to use React is with a full-stack framework, and that everything else is bad - this wording drives people away from using React as just a front-end SPA, which is still very much possible to do. If this is the intent then perhaps the documentation should say that you do not recommend using React as a SPA at all, and then people can simply start using Vue or something else instead. Right now the wording is sort of open to interpretation in a way, although heavily leaning towards telling you to use Next.js.
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.
React is not forcing you to do anything. Next doesn't require Vercel, and React doesn't require Next, it just recommends a meta framework for a better experience.
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.
"Better" experience for who, for Vercel?
Since from CRA deprecation, the React docs have changed from a impartial to a Next/Vercel oriented instructions.
Next is a vendor lock-in, Next is not SPA, Next only make sense for Server Side Rendering (SEO), deploying Next outside Vercel is a pain close to the death.
"Better" experience is far away from Next.
Introduce a new section in the React project setup guide to provide a quick start for using Vite as a build tool. This addition aims to enhance the onboarding experience for developers looking to create projects with Vite.
Description is an abridged version of the overview section from the vite site.
closes #5797