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

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ส.ค. 2022
  • Why Vite: • Vite vs Create React A...
    Written tutorials I used:
    craftsmenltd.com/blog/2022/06...
    www.darraghoriordan.com/2021/...

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

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

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

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

    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!

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

    Keep up the good work 🔥

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

      Thanks, will do!

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

    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...

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

    Oddly enough i actually enjoyed watching the debugging 😄

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

      Haha I understand the satisfaction

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

    Loved it 😅

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

    Thanks 😍

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

    Thanks ❤

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

    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.

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

    Thanks it helped

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

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

  • @Luka-qm1ri
    @Luka-qm1ri 8 หลายเดือนก่อน +2

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

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

    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 15 วันที่ผ่านมา

      how did it go?

  • @CadisDiEtrama000
    @CadisDiEtrama000 5 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

      that’ll cause you to lose version history

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

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

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

    Hey, did you fix the CSS issue?

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

    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  ปีที่แล้ว

      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 ปีที่แล้ว

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

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

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

    • @kennedydre8074
      @kennedydre8074 ปีที่แล้ว +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.

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

      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.