tokio::join! lets you run multiple futures concurrently, and returns the output of all of them. For JavaScript developers: Promise.all is a good equivalent.| fettblog.eu
This is a long section. Here are some anchors to jump to the respective part:| fettblog.eu
Articles on web dev and software engineering: TypeScript, JavaScript, Rust, and more!| fettblog.eu
Articles on web dev and software engineering: TypeScript, JavaScript, Rust, and more!| fettblog.eu
One thing that I see more often recently is that folks find out about the never type, and start using it more often, especially trying to model error handling. But more often than not, they don’t use it properly or overlook some fundamental features of never. This can lead to faulty code that might act up in production, so I want to clear doubts and misconceptions, and show you what you can really do with never.| fettblog.eu
TypeScript adds a new flag to its compiler with version 5.8: erasableSyntaxOnly. It ensures you won’t use TypeScript features that generate code.| fettblog.eu
Articles on web dev and software engineering: TypeScript, JavaScript, Rust, and more!| fettblog.eu
I’m writing books about TypeScript and I do workshops and trainings online and in-house. Every time I meet a new group of developers there are some TypeScript facts that they need to be confronted with:| fettblog.eu
The following piece of code takes a PathBuf and extracts the file name, eventually converting it to an owned String.| fettblog.eu
Oops, I did it again! I’m writing another book, and it’s again about TypeScript. I’m happy to announce The TypeScript Cookbook, to be published in 2023 by O’Reilly. You can check it out in Early Release on the O’Reilly website.| fettblog.eu
Articles on web dev and software engineering: TypeScript, JavaScript, Rust, and more!| fettblog.eu
“TypeScript and I are never going to be friends”. Oh wow, how often have I heard this phrase? Learning TypeScript, even in 2022, can be frustrating it seems. And for so many different reasons. People who write Java or C# and find out things are working differently than they should. Folks who have done JavaScript most of their time and are being screamed at by a compiler. Here are some mistakes I’ve seen people do when getting started with TypeScript. I hope they’re helpful to you!| fettblog.eu
A couple of days ago I found this beauty on the internet: Give up and use any. That’s a fantastic website, absolutely hilarious! It also shows how much TypeScript has grown in popularity. You have to have a certain reach to get critics to create websites like this.| fettblog.eu
I had the chance to toy around with Deno recently. And with “toy around” I mean dissecting it into little pieces and see how the sausage was made. So, my view is not from a user’s perspective who wants to create and run apps with it, but rather one who has a huge interest in JavaScript runtimes, Serverless, and Rust.| fettblog.eu
I started doing university lectures on Rust, as well as holding workshops and trainings. One of the parts that evolved from a couple of slides into a full-blown session was everything around error handling in Rust, since it’s so incredibly good!| fettblog.eu
Sometimes when writing TypeScript, some of the things you’d usually do in JavaScript work a little different and cause some weird, and puzzling situations. Sometimes you just want to assign a value to an object property and get a weird error like “Type ‘string | number’ is not assignable to type ‘never’. Type ‘string’ is not assignable to type ‘never’.(2322)”| fettblog.eu
The Array.prototype.includes function allows searching for a value within an array. If this value is present, the function returns true! How handy! Of course, TypeScript has proper typings for this JavaScript functionality.| fettblog.eu
When you are coming from languages like Java, C++, or C#, you are used to doing your error handling by throwing exceptions. And subsequently, catching them in a cascade of catch clauses. There are arguably better ways to do error handling, but this one has been around for ages and given history and influences, has also found its way into JavaScript.| fettblog.eu
I’ve written a new book! On October 6, the pre-release of TypeScript in 50 Lessons started. It’s 450 pages, published by the wonderful people at Smashing Magazine, and available to read right now! The printed version is being produced as I write, and will be shipping in mid-November.| fettblog.eu
This list is a collection of component patterns for React when working with TypeScript. See them as an extension to the TypeScript + React Guide that deals with overall concepts and types. This list has been heavily inspired by chantastic’s original React patterns list.| fettblog.eu
Update: Please note that this article already has some age and Vite has seen significant updates. Also, the Preact team has created their own preset for Vite which you can find here. Be sure to check that out!| fettblog.eu
For the redesign of this blog, I created Twitter title cards that are generated automatically. So whenever people share my stuff on social media, they get a nice card telling them the article’s title and post date.| fettblog.eu
Note: Be very careful with this technique. Better checkout my new approach.| fettblog.eu
I originally wanted to launch my new website on June 1st, but there were more important things happening at the moment than relaunching a tech blog. Truth be told, it was really hard for me focussing on anything else but the protest. The ongoing protests have not lost any importance. Do your part and educate yourself and be an ally.| fettblog.eu
In JavaScript, you can define object properties on the fly with Object.defineProperty. This is useful if you want your properties to be read-only or similar. Think of a storage object that has a maximum value that shouldn’t be overwritten:| fettblog.eu
TypeScript’s control flow analysis lets you narrow down from a broader type to a more narrow type:| fettblog.eu
symbol is a primitive data type in JavaScript and TypeScript, which, amongst other things, can be used for object properties. Compared to number and string, symbols have some unique features that make them stand out.| fettblog.eu
React typings for TypeScript come with lots of interfaces for all possible HTML elements out there. But sometimes, your browsers, your frameworks or your code are a little bit ahead of what’s possible.| fettblog.eu
If you are doing traditional OOP with TypeScript, the structural features of TypeScript might sometimes get in your way. Look at the following class hierachy for instance:| fettblog.eu
We successfully set up the projector in the first chapter. We are able to record the speaker’s video as described in the second chapter. Now let there be sound!| fettblog.eu
We successfully set up the projector in our last chapter. Now it’s time to record the speaker himself. I’ll show you a couple of options how you can record the speaker video. It’s up to your budget and up to the quality you want to achieve.| fettblog.eu
When we did Script’18 in January 2018, we borrowed an A/V equipment worth of 35.000 EUR to make sure we get kick-ass videos. A+ camera, an A/V mixer and a hard disc recording system that does editing on the fly. We wanted to go live with our recordings directly after the conference.| fettblog.eu
One way to think about TypeScript is as a thin layer around JavaScript that adds type annotations. Type annotations that make sure you don’t make any mistakes. The TypeScript team worked hard on making sure that type checking also works with regular JavaScript files. TypeScript’s compiler (tsc) as well as language support in editors like VSCode give you a great developer experience without any compilation step. Let’s see how.| fettblog.eu
It’s that time of the year again! For the fourth time in a row, I’m sharing my most favourite conference talks of the year! And again I found some incredible gems that I can’t wait to share with you!| fettblog.eu
Type predicates in TypeScript help you narrowing down your types based on conditionals. They’re similar to type guards, but work on functions. They way the work is, if a function returns true, change the type of the paramter to something more useful.| fettblog.eu
If you follow me you know that I’m super late to the React game. It was not until functional components showed up that I got really interested in the framework. I just loved the idea of having everything wrapped in an easy function rather than needing to navigate up and down a class to get everything together. One thing that put me off in the beginning though was JSX. And I’m sure I’m not the only one. Every time I talk to people about my newly found React love, this point comes up cons...| fettblog.eu
I’m writing these lines as I fly back from an excellent Angular Connect. I started public speaking a couple of years ago, and this particular talk will be one I’m going to remember for a long time. I think it’s easily on par with my most favourite speaking experience that I had back in 2013 with Breaking Development.| fettblog.eu
When starting with TypeScript it took not much time to stumble upon some of the type system’s odds. Odds that make a lot of sense if you take a closer look. In this article I want to show you why and how in some cases, TypeScript allows non-matching method signatures.| fettblog.eu
The other day I was holding a workshop on performance optimisation for single page applications. For this workshop I needed an example that I could optimise step by step. I decided not to use a framework, as I didn’t know the experiences and background of my attendees. Also, I didn’t want to draw attention to framework details, rather focus on concepts that build on the platform and that are universally applicable to SPAs.| fettblog.eu
The almighty JAMStack brings you fast and secure static websites, and with things like headless content management systems they become even easy to edit! However, every once in a while you will find yourself in front of a Wordpress blog that has way too many articles (and way too many authors that fear change!) to be reasonably transferred. But Wordpress can be headless, too. In fact, Wordpress’ own hosting service uses its core only via API, the editing interface comes with the shiny new C...| fettblog.eu
So it IS finally a tradition. After my most favourite talks of 2015, and the top talks to watch in 2016 – the conference videos strike back!, we complete the trilogy with my most favourite talks of 2017 – Return of the Bingewatch:| fettblog.eu
I started taking reading seriously again in 2017. I had highs where I read about 10 books a month (phew), and also lows where I haven’t touched a page for a couple of months. Now with having both a toddler and a Kindle*, I gladly spend night again guarding the crib while reading both fiction and non-fiction. And oh, did I read a lot of non-fiction this year. There were some amazing books, and I want to share with you the ones that I found the most compelling.| fettblog.eu
Let’s make this a tradition! I love to watch conference talks. Be it live or on tape. And just like last year I try to collect the talks that I loved most. I know, since I started organising Script I began seeing conference talks differently. However, those are the ones I put my attendee-hat on. And let’s be honest: A good organiser needs to do that! So enjoy my list of talks I enjoyed most in 2016.| fettblog.eu