A must-have VSCode feature for Next.js developers

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 31

  • @vladislavnovoselov3699
    @vladislavnovoselov3699 6 місяців тому +1

    Nice feauture, thanks for sharing
    can you help me to make that work for dynamic folders too
    If I have " app/landlords/[id]/{layout,page}.tsx " then the label output is [id] page
    I tried to make dirname(2) - so it takes landlords folder name - but it conflicts with folders that doesnt have dynamic routing

    • @nikolovlazar
      @nikolovlazar  6 місяців тому +4

      I got you! So VS Code uses a special glob syntax that doesn't work exactly like regex. I managed to make it work for both cases when there's a dynamic segment and not.
      You'd need to add multiple patterns to match the different cases, depending on the position of the dynamic segment in the path. Let's say the dynamic segment is the direct parent of the file. You'd need two patterns - one for the regular files, and one for the dynamic one:
      // Regular - prefixed with src/app so it doesn't affect files outside of the app dir
      src/app/**/{layout,page}.tsx - ${dirname} ${filename}
      // Dynamic - the dynamic segment is the direct parent
      src/app/**/[[]*[]]/{layout,page}.tsx - ${dirname(1)}${dirname} ${filename}
      Play around with this and see what value works for you. This dynamic pattern will produce this: "landlords[id] page".
      I hope this helps you.

  • @magiczz420
    @magiczz420 7 місяців тому +5

    I knew immediately what this would be about and it's actually really useful. I used to click the file to see in the file explorer where it was located to know what was in it. This will save me so much time. Great video!

    • @nikolovlazar
      @nikolovlazar  7 місяців тому

      Yes! This is one of those "simple but delightful" features that improve the QoL. I'm glad you found it useful.

  • @0xtz_
    @0xtz_ 7 місяців тому +2

    thats sooooooo cool man thanks

  • @blaizeW
    @blaizeW 6 місяців тому +1

    woah. thats brilliant, thank you!!!

    • @nikolovlazar
      @nikolovlazar  6 місяців тому

      Glad you like it!

    • @blaizeW
      @blaizeW 6 місяців тому

      @@nikolovlazar btw, what’s the theme and icons you use?

    • @nikolovlazar
      @nikolovlazar  6 місяців тому +1

      @@blaizeW Here's my setup:
      - Color Theme: marketplace.visualstudio.com/items?itemName=DaltonMenezes.aura-theme
      - Icon Theme: marketplace.visualstudio.com/items?itemName=Equinusocio.moxer-icons
      - Font: Dank Mono

    • @blaizeW
      @blaizeW 6 місяців тому +1

      @@nikolovlazar Tysm.

  • @quantumrim3805
    @quantumrim3805 9 днів тому +1

    thank you, it helped me a lot

  • @LukasSmith827
    @LukasSmith827 7 місяців тому

    this video has saved my life, so much better than messing with custom css

  • @eclipse-224
    @eclipse-224 3 місяці тому

    Amazing tip, thanks a lot!

  • @adrian34234
    @adrian34234 7 місяців тому +1

    thanks and appreciate it!

  • @ViktorStevanovic-qf2dm
    @ViktorStevanovic-qf2dm 7 місяців тому +2

    Great! Can i ask you what theme are you using? Love the setup!

    • @nikolovlazar
      @nikolovlazar  7 місяців тому +2

      Thanks Viktor! Here's my setup:
      - Color Theme: marketplace.visualstudio.com/items?itemName=DaltonMenezes.aura-theme
      - Icon Theme: marketplace.visualstudio.com/items?itemName=Equinusocio.moxer-icons
      - Font: Dank Mono

  • @harshalkudale4877
    @harshalkudale4877 7 місяців тому +1

    Finally. I am now free of frustration. Thanks.

  • @NikolaiLehbrink-tj4di
    @NikolaiLehbrink-tj4di 7 місяців тому +1

    That's a cool tip, thank you!

    • @nikolovlazar
      @nikolovlazar  7 місяців тому

      Glad you found it useful, Nikolai!

  • @DjokoB
    @DjokoB Місяць тому +1

    Ok this was helpfull, thanks 👌

    • @nikolovlazar
      @nikolovlazar  Місяць тому +1

      Glad to hear that man! Long time no talk.

  • @ryostyles9904
    @ryostyles9904 7 місяців тому +1

    Cooool

  • @bleakCode
    @bleakCode 7 місяців тому +1

    Noice!

  • @thaian3272
    @thaian3272 7 місяців тому +1

    noice!

  • @TalkMalk
    @TalkMalk 7 місяців тому +1

    good

  • @sivaganesh4489
    @sivaganesh4489 7 місяців тому

    Are you able to use partytown with nextJS 13 approuter ?

    • @nikolovlazar
      @nikolovlazar  7 місяців тому

      Haven’t worked with Partytown so far, but I’ll let you know. What’s the problem with partytown and app router?

    • @sivaganesh7727
      @sivaganesh7727 7 місяців тому

      Nextjs script worker strategy is not supported in partytown