Converting to Vite from Create React App - lower your boot time to almost nothing!

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

ความคิดเห็น • 42

  • @sunilshah300
    @sunilshah300 ปีที่แล้ว +18

    This guy is a gem, not every one shows the process of debugging and googling, but showing the process is truly splendid.

  • @makinopvp
    @makinopvp ปีที่แล้ว +14

    thank you very much homelander, you saved my project

    • @Doothacvter144
      @Doothacvter144 ปีที่แล้ว +1

      ahahah, thought the same

    • @c_span
      @c_span ปีที่แล้ว +1

      🤣🤣🤣🤣🤣

    • @o.ifeoluwa7176
      @o.ifeoluwa7176 ปีที่แล้ว

      😂

    • @IanLenehan
      @IanLenehan  ปีที่แล้ว +1

      Hahaha I hope I don't come across as a psychopath like him!

    • @martinWein
      @martinWein 3 หลายเดือนก่อน

      So you migrated an entire app to save 13 seconds what about all the time you wasted migrating the actual app? As for me, I will be using CRA for a very long time as I despise vite for so many reasons I can’t even count. Watchers be warned. It is not a simple question.

  • @josecastaneda8082
    @josecastaneda8082 9 หลายเดือนก่อน +1

    This video really shows realistically how this process may look like. I just did a migration of CRA with typescript and it was not without some headaches.
    But worst of all was migrating jest tests to Vitest. I have 500+ tests in my solution.
    That took a couple of days of googling, rewriting and cursing.
    You can count on that you’ll need to rewrite some, as mocks behaves differently in vitest compared to jest, for example. Another one is different names on requireActual and jest.fn now being vi.fn etc.
    While it is faster with Vite and Vitest, you’ll notice that it is still not as mature as CRA, there is just less information to google about compared to CRA and Vite has its issues as well. I guess that it will get there eventually.

  • @CadisDiEtrama000
    @CadisDiEtrama000 9 หลายเดือนก่อน +2

    For anyone facing this problem, I found most success just initializing a new Vite app, then just copy-pasting all the old files inside... Then you just need to adapt some of the config, App.tsx file, and you are basically done 👍

    • @adventurer2395
      @adventurer2395 9 หลายเดือนก่อน +1

      that’ll cause you to lose version history

  • @Luka-qm1ri
    @Luka-qm1ri ปีที่แล้ว +4

    You look like the Homelander from The Boys from this angle at 1:00 hahah

  • @chizidotdev
    @chizidotdev ปีที่แล้ว +12

    Just needed to see what I’d have to go through before I propose this to the team… Lot of work😅

    • @IanLenehan
      @IanLenehan  ปีที่แล้ว +1

      Haha yeah. I looked at doing this at work and with a much more complex app. Too hard!

    • @acidhauss7018
      @acidhauss7018 ปีที่แล้ว +2

      @@IanLenehan I was trying to get storybook to run on it and its a right pain in the ass - would not recommend and gave up in the end. I'm sure I will stubbornly continue to try and fail over the next few weeks for the challenge...

  • @hamdiaminehkh
    @hamdiaminehkh 10 หลายเดือนก่อน

    I went through the same process and the same steps; for 2 hours or more, I found myself changing imports, altering extensions, adjusting configurations, and so on without success. Eventually, I was compelled to cancel everything and revert to the React script. However, after watching this video, I feel encouraged to give the migration to Vite another try.

    • @dekafmusic
      @dekafmusic 4 หลายเดือนก่อน

      how did it go?

  • @3491da
    @3491da ปีที่แล้ว +4

    Oddly enough i actually enjoyed watching the debugging 😄

    • @IanLenehan
      @IanLenehan  ปีที่แล้ว

      Haha I understand the satisfaction

  • @AbdoTech0
    @AbdoTech0 2 ปีที่แล้ว +2

    Keep up the good work 🔥

    • @IanLenehan
      @IanLenehan  2 ปีที่แล้ว +1

      Thanks, will do!

  • @tech4tech966
    @tech4tech966 ปีที่แล้ว

    Thanks 😍

  • @mohitspg
    @mohitspg ปีที่แล้ว

    I have done migrations but hot reload "HMR" is not working, any fixes for that issue?

  • @alibarznji2000
    @alibarznji2000 6 หลายเดือนก่อน

    Hey, did you fix the CSS issue?

  • @hamzakyamanywa9792
    @hamzakyamanywa9792 2 ปีที่แล้ว

    Loved it 😅

  • @MarcoLuz-b2f
    @MarcoLuz-b2f หลายเดือนก่อน

    First link is not working anymore

  • @kartikgupta9407
    @kartikgupta9407 ปีที่แล้ว

    Thanks it helped

    • @IanLenehan
      @IanLenehan  ปีที่แล้ว

      I have a friend called Kartik Gupta, don't suppose that's you??

  • @thebuddy.8765
    @thebuddy.8765 2 ปีที่แล้ว

    how to config tailwind and antd on vite? i followed ure steps, it's work but my css not working. vite showing @import must precede all other statements error.. how to fix these css errors..

    • @IanLenehan
      @IanLenehan  2 ปีที่แล้ว

      Sorry it's a bit hard to debug this way but hopefully you can google the error message or find help on stack overflow or something like that!

  • @kennedydre8074
    @kennedydre8074 2 ปีที่แล้ว

    Have they resolved the issues with vite not showing the error messages

    • @IanLenehan
      @IanLenehan  2 ปีที่แล้ว +1

      I didn't know about this. Which error messages?

    • @kennedydre8074
      @kennedydre8074 2 ปีที่แล้ว +4

      @@IanLenehan vite doesn’t show error messages on the browser like create-react-app. When you encounter an error, all you get is a blank screen and the guessing game begins

    • @Ree-rr1js
      @Ree-rr1js ปีที่แล้ว

      @@kennedydre8074 usually they show you the error on your browser console.

    • @bigyan_patel
      @bigyan_patel ปีที่แล้ว

      you need to configure eslint for vite to show those errors.

  • @luisbrazilva
    @luisbrazilva ปีที่แล้ว

    I get it. It's fast but why is everyone ignoring the huge security risk of exposing your API connections and key because it serves the JSX files in the network activity tab without masking them or encoding them.

    • @IanLenehan
      @IanLenehan  ปีที่แล้ว

      Hey Luis - interesting, do you have a link to somewhere that explains this? I am not aware of a risk with it

    • @luisbrazilva
      @luisbrazilva ปีที่แล้ว

      @@IanLenehan By the way, I do love your work.

    • @luisbrazilva
      @luisbrazilva ปีที่แล้ว +2

      @@IanLenehan I retract my comment. I did a quick deploy to Netlify to make sure and it wasn't exposing the API. I made a mistake in my migration and forced the PROD: true in the import.meta.env Object.

  • @martinWein
    @martinWein 3 หลายเดือนก่อน

    So you migrated your entire app to save 13 seconds what about all the time it took to migrate the actual app???? as for me I will be sticking with react app for a very long time as I despise vite for too many reasons to count. watchers be warned. It is not a simple question when you realize you are no longer allowed to use a JS file and you are not being warned about unused hooks and you are damned.

  • @martinWein
    @martinWein 3 หลายเดือนก่อน

    .

  • @codeNinja2320
    @codeNinja2320 ปีที่แล้ว

    Thanks ❤