Newsletter #2 - Tooling News

Sébastien Dubois / December 10, 2019

5 min read

Welcome to the second edition of DeveloPassion's newsletter.

NG BE 2019 conference videos

I just saw that the videos for NG BE 2019 are already online: https://www.youtube.com/channel/UCnMfZM2S3QgbFvOyet5PMmQ/videos?view=0&sort=dd&flow=grid

I'm a sad panda because I would've liked to attend NG BE (it's really close to where I live), but it'll be for next year :)

Here are the talks that I'm planning to watch asap: Tackling Component state reactively by Michael Rx Hladky and and Jan-Niklas Wortmann: https://www.youtube.com/watch?v=JMLMpENUfQI Sustainable NG Architectures with Monorepos and Strategic DDD by Manfred Steyer: https://www.youtube.com/watch?v=mbL27ZKmJqU RxJS recipes by Kwinten Pisman: https://www.youtube.com/watch?v=cjjjaOsc6JI Having worked with Kwinten in the past I'm pretty sure this will be well worth the time ;-) E2E testing at half the cost by Isaac Mann (cfr next topic)

Nrwl NX 8.8

NX 8.8 has been released.

It now has great support for writing UI tests using Storybook and Cypress: https://blog.nrwl.io/ui-testing-with-storybook-and-nx-4b86975224c

Isaac Mann has given a cool talk explaining this in detail at the NG BE conference: https://www.youtube.com/watch?v=C88th0SbepE Aside from this, also take a look at this article for a nice intro about how to write Storybook stories with Angular: https://alligator.io/angular/storybook-angular/

Learn TypeScript 3 by Building Web Applications - Missing chapter

In my book about TypeScript, there's a missing chapter. Not that I forgot to write it, but my editor forced me to remove tons of pages at the very end of the project.

Initially, the book ended with a long list of resources and pointers towards cool things to learn next. The book already covers a ton (not too surprising given the high page count :p), but there's always more to learn.

Since I didn't want all those pages to be lost, I've published the first part here in case someone's interested: https://medium.com/@dSebastien/typescript-3-projects-whats-next-c22c38293788.

I'll publish another part later on about #accessibility; another subject that I initially covered but had to drop!

Funny backstory about TypeScript

With the 5th anniversary of TypeScript, a story was published about the first TypeScript demo: https://medium.com/hackernoon/the-first-typescript-demo-905ea095a70f. It's really fun and interesting to see what they did to give a good impression about it in the beginning ;-)

Synchronizing files to Kubernetes and back using DevSpace sync

In my current project, I'm developing directly within Kubernetes in an effort to stay as close as possible to the production environment.

Of course the similarity has its limits. For instance, the front-end application is based on Angular and is built using the NG CLI. When the app runs in production mode, then only the production build output remains, hosted inside an NGINX pod. During development though, the Angular CLI is used (i.e., ng serve) so that the app can be rebuilt each time any part of the project changes.

As I iterate on the code base within VS Code, I need it to be synchronized within the pod so that the NG CLI process in the pod can detect the changes and rebuild the app.

I use Minikube to run the Kubernetes cluster. One solution to synchronize files from the local host machine towards the K8S cluster is to use a hostPath volume, but I've experience huge performance issues when doing that. Also, I had to enable polling with the Angular CLI for it to detect the file changes, leading to really high CPU usage.

Currently, my alternative is to use the "sync" functionality of the DevSpace CLI client: https://devspace.cloud/docs/cli/development/configuration/file-synchronization

Using a simple YAML template, I could define multiple synchronization jobs targeting specific pods (selected using labels, as always with K8S).

DevSpace sync works like a charm and is really efficient (it uses an rsync-like approach)

You can learn more about it through its official docs and also this nice blog article: https://medium.com/@lukas.gentele/devspace-sync-kubectl-cp-on-steroids-51207bdf5a3e

Last but not least, the developers behind the DevSpace CLI are really reactive and helpful. I've reported two issues, which were both fixed within days and released, so congrats and thanks to them! :)

Redux style guide

I don't know if it's recent of if it has been there for a long time already, but I've stumbled upon a nice style guide for Redux in its official documentation: https://redux.js.org/style-guide/style-guide.

There are some gems of wisdom to take away from that page! Certainly there are tons of important attention points while using a Redux-like architecture. It is definitely a complex subject with many many pitfalls.

In my current system we're having quite some fun (i.e., growing more gray hair by the minute) with NGRX, RxJS etc ;-)).

For instance, defining actions as events rather than commands is really helpful.

On another level, writing good reducers also has some subtleties. BTW I still need to free up some time to really give Immer a try!

That's all folks!

I'm really interested to hear about what you think of this new initiative, ideas to improve, links to share, etc. Don't hesitate to contact me through Twitter: https://twitter.com/dSebastien

If you find this newsletter interesting, then please share the link around: https://mailchi.mp/fb661753d54a/developassion-newsletter

PS: check out my Dev Concepts books, join the Software Crafters community, the Personal Knowledge Management community, and come say hi on Twitter!
Discuss on TwitterEdit on GitHub