Patching Packages - The ULTIMATE Guide

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

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

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

    Which package manager do you usually prefer and why? 👀

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

      pnpm because it’s a new. It’s use less space on ssd and it faster than yarn and npm how I read about it

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

      pnpm because I easily solve all the problems I encounter (which I cannot solve in others)

    • @slava_trushkin
      @slava_trushkin 3 หลายเดือนก่อน +1

      pnpm because it handles monorepos way better than others

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

      Bun, its fast and it has a lot of cool built in features :)

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

      pnpm, because I had some weird npm bug once, didn't know how to fix it so I switched lol also heard it's faster

  • @randomtimessomehow
    @randomtimessomehow 3 หลายเดือนก่อน +5

    What the hell, how come I needed this yesterday for the first time and this is exactly when you released this video 😃

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

      Perfect timing 🔥👌🏻

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

    Two (and a half 😅) extra notes that might be helpful:
    1) Using `pnpm-patch-i` package to patch dependencies with pnpm noticeable improves patching experience - this little tool creates a temp directory with a better name, automatically opens vscode and commits the patch with a single key press. Extra tip: in the temp directory, run `git init . && git add .` before making any changes to be able to preview the diff of your changes. Just don't forget to run `rm -rf .git` before committing a patch :)
    2) One extra caveats of patching dependencies is that if you ever decide to migrate to a different package manager (say from npm to pnpm), you would have to tweak your patch files as well because might have a slightly different format (it's definitely different between these two - compare 9:08 and 15:07)
    2.5) Use `-y` right after `npx` command to skip that annoying installation prompt 😄
    Thank you for all your great, truly helpful and valuable videos.

  • @levrairaphaeI
    @levrairaphaeI 2 หลายเดือนก่อน +1

    Thanks for this great content Alexander, you are the GOAT

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

      Thank you so much Raphael 🙏🙏🙏

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

    Talking about package managers, I would love to ear what you have to say about "Bun" and its usage/benefits with Nuxt

  • @michaelpumo83
    @michaelpumo83 3 หลายเดือนก่อน +1

    This is legit useful - thanks so much for a great video.

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

      Glad it was helpful Michael!

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

    Waited for this for so long time. Thanks, Alex ♥

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

      You are very welcome 🙌

  • @NicolasVanAarsen
    @NicolasVanAarsen 3 หลายเดือนก่อน +1

    Oh, I didn't know that, nice tip!

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

      Glad it was helpful! ☺️

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

    ooh frick, thats so cool 🤩, how did i not known about this O.O. Thx for the super cool video :)) No i don't have more excuses for anything that doesn't work XD

    • @TheAlexLichter
      @TheAlexLichter  3 หลายเดือนก่อน +1

      You are welcome!
      Exactly 👀 and a good chance to send in PRs too 👌🏻

  • @QueeeeenZ
    @QueeeeenZ 3 หลายเดือนก่อน +2

    How do you patch those packages that ship minified code? They only have a dist/ in node_modules which is minified and impossible to edit. Also how would you patch larger projects with TypeScript that requires building?

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

      Minified: if you find the corresponding source via debugging there, otherwise fork + publish a temp NPM package under your name. Same for having TS support too etc

  • @lbmgary
    @lbmgary 3 หลายเดือนก่อน +1

    holy crap... how do I not know things? :| Thanks bruv!

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

      You are welcome 🙌🏻

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

    Yarn and Pnpm patch flows do not make sense to me. How could I test my changes and know that it is time to create a patch, if I must edit not the live version of the package, but a temporary version of it?
    And, unfortunately, most packages can't be patched this way anyway. Because you need to patch their sources, not their distribution package.