-
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
Open
hichemfantar
wants to merge
1
commit into
reactjs:main
Choose a base branch
from
hichemfantar:add-vite-guide
base: main
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.
+10
−1
Open
Changes from all commits
Commits
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 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.
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.
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:
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.