Published on Sunday, March 18, 2018 6:00:00 AM UTC in
& User Experience
I have a new "hobby" that I've been actively pursuing for the past weeks: hunting down what keeps waking up my computer at night. At first it simply was a matter of me not wanting to shut down the computer completely (I like my five hundred open windows be restored instantly), but I also didn't want it to just sit there and idling along, consuming power for nothing. But the more I tried to solve this issue, the worse it got, seemingly. I once turned it off in the morning, and when I left for work half an hour later, it was already running again. I swear it mocked me. Getting this under control turned into a mission, a mankind vs. machines class of battle. In the end, it turned out to be a bug in Windows 10 that seems at least two years old, and it made finding the cause for these problems a nerve-wrecking journey for me. If you also find your computer waking up spontaneously at night and already tried out all the hints, configuration switches and registry settings you could find on the internet, this one might be for you.
Published on Monday, February 26, 2018 6:00:00 AM UTC in
When I extended good-injector with the possibility to use factory functions, I ran into a strange issue. In one of the unit tests I mistyped
registerInstance, but the compiler did not complain at all. It happily accepted a function of type
() => T in a place that required an object of type
T being a generic type argument), and left me a few minutes trying to figure out why my code is not working. I analyzed the problem and realized that it's a side effect of how TypeScript determines type compatibility. Let's see what that means and how to avoid it.
Published on Sunday, February 25, 2018 12:00:00 PM UTC in
A new version of good-injector has been pushed to NPM. I've used the container in one of my private projects and decided to move forward with it, as it's working quite well and stays unobtrusively in the background - just as I like the tools I have to work with. The current release adds the following features:
Published on Sunday, February 18, 2018 8:30:00 AM UTC in
I just released a new version of Dapper Extensions Reloaded that fixes an issue with handling DBNull values in the default logger. I also started updating some of the surrounding details, like the documentation on GitHub and the included license files. As always, head over to NuGet to get the latest bits (version 3.1.2), or visit the GitHub repository for sources and more.
Published on Tuesday, February 13, 2018 6:00:00 AM UTC in
Creating a TypeScript IoC container was only the beginning. Until it can be integrated with other frameworks, it's only of limited use. Of course, using something like this in different contexts is always possible, but ideally it feels natural to the environment your application resides in, and not forced. As you probably already guessed, this article describes how to integrate "good-injector" with Vue.js. But it goes further: today I announce good-injector-vue, an adapter of my IoC container for Vue.js that does all the required work for you and seamlessly integrates with it.
Published on Monday, February 12, 2018 6:00:00 AM UTC in
In classic languages and frameworks on the server side, like C# and ASP.NET (Core), dependency injection today feels like a natural piece of the infrastructure. With more and more complex applications being developed in the browser, developers seek similar mechanisms and features for client-side languages like TypeScript too. Not only does it reduce coupling and simplify testing; nobody wants to hand-craft deep dependency trees and manually tune these after each refactoring. In TypeScript, there are some conceptual differences to how the topic is typically approached in languages like C#. In this post I briefly talk theory and options, then proceed to create a simple IoC container for TypeScript from scratch: good-injector.
Published on Friday, February 9, 2018 8:00:00 AM UTC in
Plugins are the recommended way to augment the feature set of Vue.js with additional properties, methods, assets and more. Writing them in TypeScript with current versions of Vue.js is straight-forward, but the advice you can find on the web often refers to older versions and does not apply anymore. In fact, the contradictory recommendations you find there may be quite confusing: how do I refer to the Vue.js type in my plugin? Do I use
VueConstructor? Is it
typeof Vue? Well, here is a general rule of thumb that will help and never lets you google for the required syntax again.
Published on Wednesday, February 7, 2018 9:45:00 AM UTC in
As you may have noticed, I've rolled out some changes to this blog recently, one of it being better localization support. In detail:
- You can now change UI language with the switcher to the upper right
- Dates are displayed in your language format and converted to your local time zone
- I provide additional RSS feeds for those only interested in German or English posts
- Some pages (details about myself and my projects etc.) have been translated to both supported languages.
Of course, all content will still only be available in whatever language it has been created in.
I hope you all enjoy these changes :). If you find any inconsistencies, let me know.
Published on Wednesday, February 7, 2018 6:00:00 AM UTC in
Ideally, running your code in production is something that happens completely transparent to your application. Meaning: your app really shouldn't care about the environment it's currently deployed in, and deliberately be as agnostic about that as possible. Sometimes however, there are situations where you need to know this, particularly at development time. Is this legitimate? And if so, how do you get that information? I give you an example and show you how you can easily access this information with Vue.js from TypeScript.
Published on Tuesday, February 6, 2018 6:00:00 AM UTC in
Whenever you work with forms and input fields, sooner or later validation of user input becomes an issue. Of course there's always the possibility to hand-code valdation into your app, but this is one of the topics that look straight-forward at first and then turn into a mess of trial and error quickly. When you're looking for a library to help you with that, you'll probably stumble upon the great curated list on vuejs.org. There's exactly one validation framework listed there, Vuelidate, which looks nice, easy to implement and is very actively maintained. When you try to integrate your TypeScript-based app with Vuelidate, you'll run into several issues that are not so easy to resolve though. One of the major pain points also is that typings are missing completely. After a lot of searching and testing different options, I found a better alternative: Vee-Validate. It's equally active maintained, has a very good documentation and has proven to be an excellent choice for TypeScript developers.