Newsletter #8 - Bash
Welcome to the 8th 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 this link to others on social media: https://mailchi.mp/fb661753d54a/developassion-newsletter
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 and Medium where i publish my articles.
TypeScript newsTypeScript 3.9 is here. Now we just have to be patient for all of our tooling/frameworks to support it. I'm currently stuck "because of" Angular, but it'll support it real soon. As a matter of fact RC0 of Angular 10 is out: https://github.com/angular/angular/blob/master/CHANGELOG.md#1000-rc0-2020-05-21
By the way, a while ago I've also published an article about type-only imports, which provide a clean solution to a little but annoying issue when you're using types only as types and never as values.
Why you should stop installing npm packages globally
Today, I've published an article about why installing npm packages globally doesn't make sense to me anymore. I have maybe 1-2 packages installed globally. For the rest, I rely solely on project dependencies and npx, which provide much better solutions.
Those who know me are certainly aware that I'm a big fan of Bash. I always have (at least) one terminal open, ready to serve me.
As a scripting language, Bash isn't that great, and it's not really the part I love the most. I like it for its ubiquity, but the syntax is really painful. Compared to Bash, PowerShell just feels soooo much cleaner. Having been a Windows sysadmin for a while and having a programming background, I really dug into it and could see how powerful it is. But I'll write about PowerShell another day ^^.
No, what I enjoy most about Bash is not really the scripting. It's rather its support for aliases and functions, which I really use all the time.
I wrote an article about this, highlighting cool things that one can do with Bash (or Fish, or zsh :p); you can check it out here: https://itnext.io/bash-aliases-are-awesome-8a76aecc96ab.
Git concepts series
I think that many Git users stick to the real basics because they don't truly understand the core concepts. Using Git without understanding it clearly (I don't mean the internals :p) is really sad. Git is a tremendously powerful tool but, as with anything else, it requires quite a bit of time to really master it.
There are already quite a lot of great tutorials/courses about Git, but I wanted to have a go at explaining it. This is why I've started writing a series about Git concepts. So far, I've published two articles.
The first one explains what it means for Git to be a distributed version control system: https://itnext.io/git-concepts-for-newcomers-part-1-what-is-a-dvcs-bc873076c424.
The second one explains the different areas to be aware of when using Git: the working tree, the index and the repository. You can find it here: https://itnext.io/git-concepts-for-newcomers-part-2-git-repository-working-tree-and-staging-area-a2e720bf3528.
Over the next couple of weeks, I'll continue this series, progressively going from basic concepts like branches and commits to more advanced ones like remotes, fetch, merge, rebase, etc. I hope that these articles will prove useful to some people! :)
Angular route vs scrolling
Out of the box, Angular's router provides support for handling scrolling automatically when navigating from route to route, whether via routerLink, back/forward Web browser buttons or otherwise.
Unfortunately, that support isn't all that great. In my current project, I've had to spend a whole evening hacking around to make it work as I wanted. I took the opportunity to share my solution and explain it in the following article: https://medium.com/front-end-weekly/handling-scrolling-on-angular-router-transitions-e7652e57d964
What I did is create an Angular service that keeps track of the scroll position so that it can be properly restored when navigating. But I went a tad further and added support for defining the scroll behavior through route data. Thanks to that, I can now easily define how the scrollbar should react (or not) when navigating to specific routes.
This solution ain't perfect, but it is at least clean and functional. Hopefully Angular will provide a better solution for this in the future!
That's all folks!
I'm really interested to hear about what you think of this newsletter. If you have remarks, ideas/articles to share, then please don't hesitate to contact me through Twitter (https://twitter.com/dSebastien). DMs are open.
If you find this newsletter interesting, then please share the link around: https://mailchi.mp/fb661753d54a/developassion-newsletter
Don't forget that you can also follow me on Medium where I currently publish my articles: https://medium.com/@dsebastien
See you next time!