You should upgrade! NestJS v10

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • Very quickly going over the recent major version release of Nest.js which introduces SWC as an alternative compiler, along with a few other small changes. I'll also show you how to actually upgraded your application in the simplest way possible.

КОМЕНТАРІ • 46

  • @kellslte
    @kellslte Рік тому +7

    Woah! This is beautiful! As usual the Nest team keep doing a great job.

  • @dinoscheidt
    @dinoscheidt Рік тому +4

    The adult framework gets an update 🤩 if this would just make it to the hot take twitter crowd

  • @YOUdudex
    @YOUdudex Рік тому +2

    Cool, excited about the next end to end typesafe video

  • @droidfone9648
    @droidfone9648 Рік тому +2

    Thanks for the really helpful content. They have been huge inspiration in choosing our stack. Eagerly awaiting grpc video. Please try to include error handling, auto type generation and reflection etc with respect to nestjs integration.

  • @ravenlb
    @ravenlb Рік тому +1

    Looking forward to more new content from you!

  • @phenomenal-hardy4438
    @phenomenal-hardy4438 Рік тому

    Thanks for the video, i will now update my nest js projects to use swc, great addition!

  • @daguttt
    @daguttt Рік тому

    Great to check the NestJS 10 updates from you! 👌🏼
    BTW, eagerly looking forward to next video. I've been looking for and end-to-end type safety with NestJS since a while

  • @dawid_dahl
    @dawid_dahl Рік тому

    Love your channel, thank you so much!

  • @DustinTownsend
    @DustinTownsend Рік тому +1

    Have you (or anyone) seen anything about getting SWC to work with NX & Nest? I have already upgraded to Nest v10 and latest NX but haven't had time to try and get swc to work with that setup and haven't really found any good info on it.

    • @mariusespejo
      @mariusespejo  Рік тому

      Regardless if it’s a monorepo, the swc setting is only for your Nest app. Not sure what that has to do with Nx. But I haven’t used it before to be honest. Shouldn’t it be able to work with whatever compiler each of your apps are using?

  • @hateem8287
    @hateem8287 Рік тому

    Hey, thanks for all your content, i'm enjoying everything about your courses and Nest content.
    I wanna ask about an error that i get from swc: Cannot find module '../ormconfig'
    although i can solve this issue by just writing the configs in the app module or moving the config file to be within src, i'm curious about the reason of this error.

    • @mariusespejo
      @mariusespejo  Рік тому

      Not sure what the problem is there sorry

  • @lukebui2962
    @lukebui2962 Рік тому

    Please make a video about running Nestjs on Bun 🙏🏻🙏🏻🙏🏻

    • @mariusespejo
      @mariusespejo  Рік тому

      I was actually just thinking about what that integration might look like, I’ll have to spend some time trying it out

  • @mostafakhattab7933
    @mostafakhattab7933 Рік тому +1

    what is the advantage of fast building,if you build once in development?

    • @mariusespejo
      @mariusespejo  Рік тому +3

      What do you mean? Assuming you’re using watch mode it’s meant to re-compile every time you change the code

    • @mostafakhattab7933
      @mostafakhattab7933 Рік тому

      @@mariusespejo i got it thank you

  • @hugossp
    @hugossp Рік тому

    Great man thx

  • @tristan7668
    @tristan7668 Рік тому

    Hi Marius, I'm stuck on looking for a right ORM, which ORM should you recommend to use in NestJS? Or you just use database driver in pg? Thank you in advance!

    • @mariusespejo
      @mariusespejo  Рік тому +1

      For Nest specifically I think typeorm integrates the best because it is directly supported and has the same style of classes + decorators. I have video on typeorm 0.3.x setup in the channel. Prisma is also popular, I have a first impressions video on that also with nest I think. Finally drizzle orm is worth checking out if you want something lighter weight, think of it like just a thin layer above drivers like pg. Although it’s newer and you might find some features missing. I also have an impressions video on that if you want to check it out

  • @simbolmina
    @simbolmina Рік тому

    I just updated. its nice and fast really. just does not like src/ imports

  • @jo.repossi
    @jo.repossi Рік тому

    In the new video can you connect with Sequellize instead TypeORM?

    • @mariusespejo
      @mariusespejo  Рік тому +2

      I don’t intend on using any ORMs for it because it’s unrelated. Nest has really good docs on sequelize if you haven’t seen

  • @charles_hacks
    @charles_hacks Рік тому +1

    What vscode theme and file icon do you use here?

    • @mariusespejo
      @mariusespejo  Рік тому

      Monokai pro, I think it comes with the icons?

  • @Zuluvideos06
    @Zuluvideos06 11 місяців тому

    Marius, I followed your tutorial usign Datasources for TypeOrm. In that tutorial you created a "db" folder outside of "src". The thing is that swc only builds the content of "src" into the dist folder, therefore the db content is missing there. How can you solve this issue?

    • @mariusespejo
      @mariusespejo  11 місяців тому

      I mean you could just move it in or duplicate into src right?

  • @kellslte
    @kellslte Рік тому

    Quickly question, I'm doing some research to build a video calling API with webrtc using nestjs. Any ideas on this ?

  • @GamesIllusion
    @GamesIllusion Рік тому

    But swc works bad with commonjs and has no some properties from tsconfig

    • @mariusespejo
      @mariusespejo  Рік тому

      Well it is optional. Modern libraries also typically will support ESM

  • @dawid_dahl
    @dawid_dahl Рік тому

    After upgrading and trying to compile with swc, I get this in my console: "Error: Cannot find module..." and then the app won't start.
    If I switch to relative paths it is working. It turns out swc can no longer compile absolute paths like "import TaskEitherUtil from "src/shared/pure-utils/monad/TaskEitherUtil"" but have to do "import TaskEitherUtil from "../../../src/shared/pure-utils/monad/TaskEitherUtil" to make it work.
    Previously I used tsconfig-paths to make it work.
    Do you have any idea how to solve this? I've googled for hours but to no avail. Thank you kindly.

    • @mariusespejo
      @mariusespejo  Рік тому

      I don’t sorry. Although even without swc I suggest always using relative imports for Nest. Because in the dist you may or may not always have an src in there, depends on the project

    • @dawid_dahl
      @dawid_dahl Рік тому

      @@mariusespejo Thanks for replying! My app is huge. Do you know if any tool that automatically can convert from absolute to relative? If not no worries. Thanks!

    • @mariusespejo
      @mariusespejo  Рік тому +1

      I don’t, sorry! But you can setup vs code to prefer relative imports, then just delete imports and you can auto import all missing. You’d have to do that manually per file though

  • @cholasimmons
    @cholasimmons Рік тому

    I started trying out Nest a few days ago, all was going good but the login route now throws a 500 error and that's all the info i'm getting

    • @mariusespejo
      @mariusespejo  Рік тому +1

      All errors you don’t catch will result in 500

    • @cholasimmons
      @cholasimmons Рік тому

      @@mariusespejo thanks for the quick response mate, I get that, I worked on a svelte project recently and I was catching all errors but that was frontend only.
      The errors I'm getting now are somewhere from within the AuthGuard.
      I've tried to label my Exceptions but still getting a bland 500 and this is just from the demo "login" and home routes.
      Any suggesstions?
      I could share my repo later on if you don't mind giving me an assist

  • @sujayxaradhya
    @sujayxaradhya Рік тому

    Please create a tutorial of it

  • @outer-space-coding
    @outer-space-coding Рік тому

    ❤ Could anyone say if swc compiler supports forwardRef in order to resolve circular dependencies?

    • @mariusespejo
      @mariusespejo  Рік тому +1

      That’s the solution typically for circular dependency on nest, but it’s the circular import on the ts files that are a problem for swc so it might not solve it for you.

    • @outer-space-coding
      @outer-space-coding Рік тому

      @@mariusespejo Thank you for your responce! Ok. But as I can see now "For all circular dependency injections in your project, you will also need to use the custom wrapper type". So I wil try...

    • @mariusespejo
      @mariusespejo  Рік тому

      Yeah it does look like perhaps you need both forwardRef (solve the circular dep for nest) and the wrapper type (solve circular import for swc). But it might only be relevant to typeorm/microorm

    • @outer-space-coding
      @outer-space-coding Рік тому

      @@mariusespejo It works for me! My code: @Inject(forwardRef(() => AuthService))
      private readonly authService: WrapperType