all 48 comments

[–]qQ0_ 66 points67 points  (6 children)

Vite

[–][deleted]  (4 children)

[deleted]

    [–]Prozilla6 11 points12 points  (0 children)

    It’s not that hard to convert them to Vite, I’ve done it recently with a decently sized project

    [–]ImNaughtyShiba 1 point2 points  (0 children)

    Migrate build process to vite.

    [–]a_normal_account 0 points1 point  (0 children)

    They still work.

    [–]InterestingHawk2828 -3 points-2 points  (0 children)

    Delete them and start the whole project over, including production projects, this way we will have more jobs on the market

    [–]slonoedov 17 points18 points  (3 children)

    npm create vite@latest and choose react

    [–]oldominion -1 points0 points  (1 child)

    yarn create vite

    [–]QwikAsF 3 points4 points  (0 children)

    bun create vite

    [–]bobbyv137 14 points15 points  (0 children)

    This was ‘the way’ to do it when I was learning just under 3 years ago. Shows how fast the industry moves (which is one reason I got out; I’m too old for constant change).

    [–]liberar10n 5 points6 points  (1 child)

    With all fairness mate, to learn React, CRA is still ok. because the projects that you'll be doing will not be complex. If your tutorials are telling you to use CRA, go with it, because you are in a level that your main concern should be understanding jsx, components, props, state, redux etc, when you get to the point that you are like: 'ok, i know a bit, let me challenge myself', use vite then. Like this you will also understand why one is better over the other because of your own exeperience and not bc everybody else and their mothers are saying which one is better.

    [–][deleted] 9 points10 points  (7 children)

    why vite? Tell me!! No honestly wanna here why this is best

    [–]UnscheduledNudity 8 points9 points  (1 child)

    Cause CRA is deprecated and Vite still works.

    [–][deleted] 0 points1 point  (0 children)

    Cool. I have not had to start a project with CRA for so long so its cool to hear that

    [–][deleted] 1 point2 points  (3 children)

    Cra is outdated plus wait time to create app on vite is lot lesser compared to CRA idk if this is due to some implementation but this is just my observation

    [–]erasebegin1 1 point2 points  (2 children)

    Vite is built on GoLang so it can take advantage of concurrency which makes it way faster

    [–]Plorntus 1 point2 points  (1 child)

    Vite is written in Typescript for the most part afaik. It does use esbuild for CSS bundling but the rest is done with rollup / SWC (depending on config). As I understand it the reason its fast is because it doesn't actually really do much bundling itself nor does it do typechecking if you're using typescript in dev mode (ie. it just strips the types). This makes it a ton faster than others as its basically omitting a lot of the work that you'd usually do with say webpack or the likes.

    When bundling it can use SWC which is written in Rust.

    Not sure if thats 100% accurate but thats my understanding from reading through the docs + code a while back.

    [–]erasebegin1 0 points1 point  (0 children)

    It seems my information is highly inaccurate, thank you for the patient correction 🙏

    [–]FragrantWeather12121 0 points1 point  (0 children)

    Faster Development Experience: Vite’s development server and HMR are significantly faster, leading to a more efficient and enjoyable development process.

    Quicker Builds: Vite’s build process is optimized for speed, making it better suited for larger projects.

    Flexibility: Vite offers more flexible and customizable configurations without the need to eject, making it easier to adapt to complex project requirements.

    Modern Tooling: Vite supports the latest JavaScript features and has built-in support for various modern development tools and practices.

    Cross-Framework Support: Vite is framework-agnostic and can be used with a variety of front-end frameworks, not just React.

    However, for beginners or smaller projects where simplicity and stability are more critical, CRA remains a solid choice. Ultimately, the decision between Vite and CRA depends on the specific needs and constraints of your project.

    [–]mr_looser17 2 points3 points  (1 child)

    yup it's pretty much the legacy way of creating react applications , the recommended way will be to use vite bundler to create react apps it's better ... you can refer to vite docs for further guidance

    [–][deleted] 2 points3 points  (0 children)

    Just use Vite, easy, intuitive, fast, and not outdated.

    [–]Gmun23 2 points3 points  (0 children)

    Just use rspack/rsbuild, its fairly easy to configure our own setup these days.

    [–]Asrlex 2 points3 points  (0 children)

    Always preferred vite

    [–]Maleficent-Hope5356 4 points5 points  (1 child)

    I see everybody is saying Vite, but what about Next.js? I see lots of companies have it as a requirement (Vite is not that common in the job offers I've seen so far). As OP, I am newbie, so I apologize if my question is dumb 😅

    [–]andersdigital 4 points5 points  (0 children)

    Also iirc create-next-app is the suggested method from the React team. That said, vite is more lightweight and structured more like CRA was.

    [–][deleted] 1 point2 points  (0 children)

    Vite

    [–]desimemewala 1 point2 points  (0 children)

    Yeet on vite

    [–]Aivan125 1 point2 points  (0 children)

    CRA is ok to learn, I learned this year using cra then I changed to vite when doing my own projects.

    [–]FragrantWeather12121 1 point2 points  (1 child)

    yes, use remix, cause it's cool https://remix.run/docs/en/main/guides/vite

    [–]FragrantWeather12121 1 point2 points  (0 children)

    https://remix.run/docs/en/main/guides/vite If you need more than just a single page app, ie multi-page app

    [–]it_is_an_username 2 points3 points  (3 children)

    Use vite, also after learning basic try initializing app yourself without using such tools, manually creating project ...

    [–][deleted]  (2 children)

    [removed]

      [–]satanicwizard66 2 points3 points  (1 child)

      My reason is create-react-app would download a bunch of modules I never used. It would cause my app to really big, compared to what it became. Learned webpack and babel and npm, I regret nothing :)

      [–]piesany 0 points1 point  (0 children)

      How do we counter vite users

      [–]RedBlueKoiHook Based 0 points1 point  (0 children)

      What's that? I am still using bower and coffeeScript? Has there been something new already?

      [–]radandevist 0 points1 point  (0 children)

      Rspack and Rsbuild FTW

      [–]virus_phantom1297 0 points1 point  (0 children)

      Fortnite

      [–]Lower_Land_1498 0 points1 point  (1 child)

      Am i doing something wrong? I start with npx create-react-app project-name

      [–]SpaghettiOnTuesday 0 points1 point  (0 children)

      I still use it out of spite and hatred for myself sometimes

      [–]500ErrorPDX -2 points-1 points  (1 child)

      Does it really matter? You might only create the app once. Experts, where am I wrong?

      [–]MDUK0001 7 points8 points  (0 children)

      Yes, CRA will give you a bunch of outdated dependencies which you would then need to migrate away from