Secret React-Native Hack For React Web Devs!

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 38

  • @jherr
    @jherr  2 месяца назад +6

    My apologies to the pnpm faithful (myself included). The `patch-package` module didn't work for me, but that does not mean that you can't patch with pnpm. Pnpm has native functionality for patching, as does yarn, with the `pnpm patch` or `yarn patch` commands. Though these commands vary in their options and use.

  • @florentklein42
    @florentklein42 2 месяца назад +39

    This DOES work with pnpm. Actually, pnpm supports this feature natively: pnpm patch

    • @gersom3318
      @gersom3318 2 месяца назад +2

      My first thought was, huh why didn't Jack know until recently about patching packages and then my second thought was exactly what you are pointing out. I use this at least once in every project, using pnpm natively. I hope he adds a little floating note to the video pointing out his mistake. Also spent way too much time on this video because of its non-descriptive title. Should've scrubbed.

    • @mikopiko
      @mikopiko 2 месяца назад

      Pnpm patch seem to be a better alternative

    • @jherr
      @jherr  2 месяца назад +3

      Thanks for the clarification. This was an honest mistake. I tried patch-package with pnpm and it didn't work, but I didn't go looking for the native patch functionality within pnpm. I'll add some text to the video and an expository comment.

  • @aexalven
    @aexalven 2 месяца назад +30

    Got excited for a second for RN content, but turns out its SSR content, sadge ;_;

  • @jherr
    @jherr  2 месяца назад +4

    Infinite Red is the sponsor of this weeks video. Infinite Red is an React-Native consultancy. They have been in the React-Native community from the start. And they have built amazing framework like Ignite and MLKit to support React-Native devs. If you are looking for some help with your React-Native application, give them a look! You'll get a great consultancy and you'll help this channel! infinite.red/

    • @irjamon
      @irjamon 2 месяца назад

      💜 Thanks Jack, you're the best. Great vid too! patch-package is an essential tool IMO

  • @johnpagley
    @johnpagley 2 месяца назад +1

    Good stuff! We heavily use RN.

  • @van_valdis
    @van_valdis 2 месяца назад +9

    The irony of installing yet another package to fix a broken package

  • @HBMoulvad
    @HBMoulvad 2 месяца назад +1

    Remembering this. I wanted to use KY with React Native project I was working on. I didn't work out of the box, used "patch-package" to fix what caused the issue.

  • @aham_sammich
    @aham_sammich 2 месяца назад

    Nice! I've had to do this a couple times in the past. Very useful!

  • @simonreggiani
    @simonreggiani Месяц назад

    I'm a RN dev. I always thought this was a JS/React ecosystem thing, not just RN 🤯

    • @jherr
      @jherr  Месяц назад

      It's more of an ecosystem thing, but I've only seen folks use it in RN-land.

  • @hakuna_matata_hakuna
    @hakuna_matata_hakuna 2 месяца назад +4

    try doing that with minified code

  • @tofful
    @tofful 2 месяца назад

    @jherr Hi Jack, could you please share your custom oh-my-posh json? it looks fantastic. Thank you

  • @epshtielsl
    @epshtielsl 2 месяца назад +2

    As someone who is primarily a RN dev, why would there be hesitation in using patch-package from those in React-land?

    • @_y7ya
      @_y7ya 2 месяца назад +2

      Because if a package needs patching that's usually an indication that it shouldn't be used in the first place. If you ever run into a situation where you feel you need to patch a package, there's almost always a better up-to-date package or DIY solution. If you do decide to patch a package you increase the maintenance overhead for every package you patch.
      I don't know why patching is a standard part of the dev flow for react native devs, my best assumption is that react native is fragile relative to react so it can take more tinkering to get things working across devices and systems.

    • @epshtielsl
      @epshtielsl 2 месяца назад +2

      @@_y7ya That makes sense, thanks. Yeah there are a lot of moving pieces with changes on the iOS and Android sides that a particular package may not have kept up with resulting in it not working for certain versions of React Native leading devs to utilize patches to get their apps running until updates are released.

    • @piotroszko2
      @piotroszko2 2 месяца назад

      @@_y7ya I am also an RN developer. patch-package is usually used for legacy projects. A year ago in the company I got a project on a very old version of RN. 1/4 of the packages had not been updated for a while, and since there was no budget to rewrite those funkconalities we patch-packaged those packages to run on the latest RN. It is not a beautiful solution, but for large projects it is a savior.

  • @tthiagolino8
    @tthiagolino8 2 месяца назад

    Instead of using a dedicated library to do patches you can use the existing patching functionality in all package managers (except npm)
    E.g. bun patch bad-library

    • @mikopiko
      @mikopiko 2 месяца назад

      Someone else pointed out that pnpm already has that feature

  • @monarchgam3r
    @monarchgam3r 2 месяца назад

    Great stuff… but how did u get those icons in your terminal, especially the react one ? Never seen that before

    • @zlackbiro
      @zlackbiro 2 месяца назад

      Its some MAC bullshit thing. You cant get this on windows because windows terminals sucks. You will spend hours to make one work.

  • @geekySRM
    @geekySRM 2 месяца назад +1

    Wow this is great

  • @AleksanderGjinollari
    @AleksanderGjinollari 2 месяца назад

    This video comes after I thought of creating a mobile App (I'm a frontend dev), and researched React Native yesterday. Is it fate?

  • @gnrsn9714
    @gnrsn9714 2 месяца назад +1

    Not a react native dev but I’ve used patch package a brunch for tooling that doesnt behave well in our monorepo at work.
    I understand click bait titles are a part of getting reach on RUclips but nothing secret about me and got a bit annoyed at the scrubbing it took to find out what this was about.

  • @gerkim62
    @gerkim62 2 месяца назад +1

    what if you npm update a patched package

    • @epshtielsl
      @epshtielsl 2 месяца назад

      It will show a warning message and attempt to apply the changes in the patch file. If the patch file is no longer applicable due to changes in the source file, it will error.

  • @dagonzalez1757
    @dagonzalez1757 2 месяца назад

    Audio is kinda out of sync

  • @kristianulvund4274
    @kristianulvund4274 2 месяца назад +1

    It's not secret anymore🥴

  • @greendsnow
    @greendsnow 2 месяца назад

    Even the low end phones have 8GB RAM.
    I use Capacitor, let user's mobile browser handle that thing.
    Also I'm done with styling RN components. I don't like the ecosystem at all.

    • @karolbielen2090
      @karolbielen2090 2 месяца назад

      ekhm... this comment seems to off tthe topic...

  • @sarcasticdna
    @sarcasticdna 2 месяца назад +1

    L video

    • @_y7ya
      @_y7ya 2 месяца назад

      Agreed. Patching a package for SSR purposes is such a terrible use case.