One important thing I forgot to do is to mark our DTO properties as "readonly" for immutability. :) 🌟Support my content and work and buy me a pizza here: buymeacoffee.com/markmaksi ⭐ GitHub repo for this series: github.com/mmaksi/nestjs-series
Hi Mark, great topic to to make video. Great content. I can suggest to prepare more what you want to say, as I can feel you repeat the same things several times. Despite that I will watch you content and subscribe. Hope you do more videos.
Interesting stuff. I never got the hang of throwing and catching Errors as a way of managing code flow. I realize it's the done thing but I won't change my ways now. AFAIK, Promises and uncaught Errors go poorly together. If you don't catch the Error before it gets to the Promise, things stop. Since I don't want my server to stop, I consider Errors to be like nitroglycerin. Internally, I prefer to just use return codes, in the spirit of 'not-found', 'nothing-to-do' and 'unauthorized'. More complex than that: a return object, I guess. So it's like an Error but without the danger factor.
Well, I always do try/catch for promises to avoid the unhandled promise rejection error as you stated, and I throw a specific error. If it was a general error that I didn’t handle, the middleware will do the job and throws 500 internal error or 400 bad request. Returning objects isn’t wrong, but gets repetitive very quickly and also no centralised place to handle errors. I’m not fixated towards one approach or another. I prefer to learn what every approach has to offer.
@@markmaksi "gets repetitive" That's no lie! The nature of our stuff is that these are flung out into the world so the idea of centralization is different than you might imagine. We spend a lot of thought on sifting events to be explicitly sent upstream. "try/catch for promises" That makes sense. It seems strange to have to do that, no? I never got the hang of using the 'reject' of a Promise. If it failed, we resolve with an error code in the status object.
Yes of course! I am currently planning for 2 videos that aim to teach how to prepare production workflow: next.js app > write tests (there’s a playlist on my channel) > create CI pipeline using github actions > docker container > deploy to AWS EC2 instance. It’s all made for beginners. After that I will make that video that you have just requested. :)
Yep of course. The next video is how to prepare a production workflow: dockerize next.js app > build a CI pipeline > deploy to AWS EC2 instance. It’s coming this weekend. Thanks for following my content. If you have ideas in mind regarding docker or other topics please let me know. 😎👊🏼
To be honest I never seen such a great tutorial on RU-vid in terms of Docker especially when it comes to -i for STDIN and -t for STDOUT commands explained in a very short video !!! Awesome work !!! Regard from Pakistan
You're welcome! Glad you liked it. Feel free to check out my blog post around authentication and authorization where I shared what I wish someone told me in the beginning of my career: markmaksi.hashnode.dev/fundamental-authentication-concepts
the lack of runtime type safety has always been the deal breaker for me with typescript. to even simulate that you need libraries that are verbose and complex.
Property 'toHaveTotalPrice' does not exist on type 'JestMatchers<{ id: number; name: string; price: number; }[]>'. thank you sir mark. i watch to 4 videos, i get a problem on the custom matcher using typscript. i code along with your video then as im trying to import the toHaveTotalPrice.. i got this error. someone my also bump on this error. its just syntax error for ES6. here is my updated code. //Cart.test.ts test("checks if the shopping cart has the correct total price", () => { const items = [ // array of items ]; expect(toHaveTotalPrice(items,60)) expect(toHaveTotalPrice(items, 50)).not.toBeTruthy(); });
Hey bro! One minor constructive criticism. Start making timestamps for your videos. Will be easier to look thru what you have coming up and then look carefully on those topics within the videos.
Thank you! It's not a matter of time, but my views dropped dramatically after posting 4 videos on Testing. Now I'm preparing for a hot video for the coming weeks, tests will be there but not the main topic, but it's gonna be a great one. I'll drop different videos before that hot one is ready to be released. Be ready for it!
Good video!! .You've saved me. I've been awake for 24 hours and I have to submit a project in a couple of hours for a job interview. Greetings from Argentina!
I no longer use Next 13. For the app router API, yes I can do that. The series starts from a beginner level so it’s gonna take a while until I cover more advanced content. What exactly are you struggling with?
I haven't even watched the video yet, but already gotta say, thank you! For me it was never a debate as conceptually they represent different ideas, so it was all the more surprising to me as to how many youtubers recommend to always use types (unless interfaces are explicitly needed). Types are shorthands, interfaces are strict, non-dynamic structures for objects. Therefore I use them as such.
That’s very true. When I see a RU-vid thumbnail made for clickbaits of use types don’t use interfaces.. I just shake my head. I remember seeing a video where the content creator said “I can’t believe the docs recommend you to use interfaces”. I digged deeper into that RU-vidr and they claimed to have 10 years of experience in software development. 🤔 I really can’t see the point of: 1. Talking about a topic we don’t have knowledge about. 2. Repeating what others say in different format without testing the validity of their information. I wish this video goes viral so that I create some trouble in the community for good. Thanks for your knowledge and can’t wait to hear your feedback on the entire video. Also a hashnode blog is also available in the description box.
Thank you. I just feel weird when I see clickbait thumbnails and titles of use types and don’t use interfaces.. so I decided to make this video. Please read the description as well.