# DeveloPassion's Newsletter 9 - Angular 10 Welcome to the 9th edition of DeveloPassion’s newsletter. Before we start, I’d like to ask all of you to **help me out a bit**. If you find this newsletter interesting, then please do take a bit of time to share to others on social media: With your help, others will also get a chance to discover and enjoy reading it. As an added benefit, it’ll also motivate me to continue the experience! Don’t forget that you can also follow me on [Twitter](https://medium.com/@dsebastien) and [Medium](https://medium.com/@dsebastien) where I currently publish my articles. I’m still working on my SaaS product project, Didowi, which is also the source of inspiration for many of my recent articles. The nice thing with building software is that there are many discoveries made along the way and many tips & tricks to share. The difficulty is always taking the time to crystallize the ideas and explain them ;-) ![[DeveloPassion's Newsletter Logo.png|DeveloPassion's Newsletter logo: lightbulb sprouting colorful idea nodes]] ## TypeScript news As usual, here are some news about [TypeScript](https://www.amazon.com/gp/product/B081FB89BL).[TypeScript 3.9.5](https://github.com/microsoft/TypeScript/releases/tag/v3.9.5) has been released a while ago. The great news is that Angular 10 (cfr next topic) is out and supports [TS 3.9](https://medium.com/@dSebastien/whats-new-with-typescript-3-9-9095ff9f68a5), so if you’re using Angular, then you can migrate over to this new TypeScript version right now! Cool :) Since then, a [first beta](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/) of [TypeScript 4.0](https://medium.com/javascript-in-plain-english/whats-coming-with-typescript-4-0-language-features-3a98fc8db48f) has been announced. My articles about TS 4.0 stays right on target. I just need to update it to cover Variadic Tuple Types; an awesome new feature that this version will bring. In any case, check out the [beta release notes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/) and my article want to learn more. Note that [my book about the language](https://www.amazon.com/gp/product/B081FB89BL) stays more than relevant; of course it misses a few concepts that were introduced since end of last year, but it remains a really solid [introduction to TypeScript](https://www.amazon.com/gp/product/B081FB89BL). LINK: [[What's coming with TypeScript 3.9 (Article)]] ## Angular 10 The other big news of the last days is of course the release of Angular 10. It isn’t an earth shattering release, but it does brings cool new features and many many bug fixes. I took an evening to go through the release notes and I’ve published an in-depth article about the changes. If you’re using Angular, then my article is a pretty good starting point to get up to speed. You can of course also check out the [official Angular blog](https://blog.angular.io/version-10-of-angular-now-available-78960babd41), but it doesn’t cover everything ;-) As stated in the previous point, this version brings support for TS 3.9, which is awesome news for everyone. I’ve also published and the strict mode that was added back in Angular 9. If you didn’t enable that flag yet, then do it now! LINKS: - [[Angular Template Type Checking (Article)]] - [[Angular 10 In Depth (Article)]] ## Nrwl NX 9.5 While we’re onto releases, Nx 9.5 is out. I didn’t write an article about that release because I’m eagerly waiting for the release of NX 10, which will also include support/migration for Angular 10. Still, Nx 9.5 brings a few new features, like an OSS preset for create-nx-workspace, the possibility to rename the master branch (cfr #blacklivesmatter), and a few things for React. But clearly, the big release around the corner is Nx 10… By the way, even if you’re not using Nx but the Angular CLI, note that Nrwl has released a [cool wrapper for NG CLI](https://blog.nrwl.io/discover-how-to-make-the-angular-cli-faster-by-up-to-10-times-more-2d51d59decb9), which adds support for their caching mechanism; allowing you to benefit from their distributed cache solution (Nx Cloud). ## NGRX 10 beta with component-store and component The last notable release is the [first beta of NGRX 10](https://github.com/ngrx/platform/blob/master/CHANGELOG.md). This beta includes a few bug fixes and, more importantly, two new modules: component and component-store. The new component module aims to help us create more efficient Angular components, ideally letting us get rid of Zone.js and thus creating so-called “zone-less” applications. Component includes the [*ngrxLet](https://ngrx.io/guide/component/let) directive and the [ngrxPush](https://ngrx.io/guide/component/push) pipe. The former provides a way to find observables to a view context (i.e., a DOM element scope); it allows to track the observables next/error values and complete state and handles change detection nicely, whether zone.js is there or not. The ngrxPush pipe is a drop-in replacement for the async pipe, but again, better handling change detection and supporting a zone-less mode. I didn’t dive in detail into the component module just yet, but plan on writing a small article about it in the coming weeks. I did dive into the other new module: component-store, which I find really interesting and well worth learning about. Component-store is going to help us better deal with complex Angular components by letting us extract component-specific state and business-logic (and thus complexity) out of the components. By creating so-called component-stores, we will also be able to reuse complex components (which is hard to do otherwise) and even share those across applications. In addition, it’ll allow us to avoid polluting the global NGRX store with state that doesn’t really belong into it. I wrote two articles about NGRX component-store: LINKS: - [[Introducing NGRX component-store (Article)]] - [[NGRX Component-store deep dive - Part 2 (Article)]] ## Never miss a switch case with TypeScript Switch statements are sometimes considered a code smell, but when they do make sense to use, you’d better make sure you don’t forget a single *case*. Luckily, TypeScript can help. I wrote a small piece about a nice trick I use whenever I can with enums, helping me ensure that the compiler tells me if I ever forget a switch case. It’s also a neat use case (far from the only one!) for the “never” keyword of TypeScript. Check out the article here: LINK: [[TypeScript Switch Case best practices (Article)]]