<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tobias Gassmann on Medium]]></title>
        <description><![CDATA[Stories by Tobias Gassmann on Medium]]></description>
        <link>https://medium.com/@tobiasgassmann?source=rss-74ab3259ff06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Tobias Gassmann on Medium</title>
            <link>https://medium.com/@tobiasgassmann?source=rss-74ab3259ff06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 03:42:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tobiasgassmann/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Illusion of Professionalism — Today: Redux]]></title>
            <link>https://medium.com/@tobiasgassmann/an-illusion-of-professionalism-today-redux-2baa90803abf?source=rss-74ab3259ff06------2</link>
            <guid isPermaLink="false">https://medium.com/p/2baa90803abf</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tobias Gassmann]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 20:31:34 GMT</pubDate>
            <atom:updated>2024-12-16T20:31:34.237Z</atom:updated>
            <content:encoded><![CDATA[<h3>An Illusion of Professionalism — Today: Redux</h3><p>Before diving into this discussion, I want to make it clear that this is not meant as a criticism of the creators of Redux or its initial proponents. Every idea in software development deserves exploration and experimentation before we can truly evaluate its merits, and Redux is no exception. My frustration lies not with Redux itself, but with the way criticism is often handled. Over the years, I’ve seen developers who question Redux’s value dismissed as lazy, inexperienced, or simply not “senior enough” to understand it. For me, this dynamic introduced an emotional aspect to what should be an open and objective discussion. That’s why I am now making my case — with a pinch of passion and perhaps a dash of frustration.</p><h3>Where It Began and What It Promised</h3><p>Redux was introduced as a state management pattern designed to address the challenges of handling shared state in modern JavaScript applications. It provided a centralized store to manage state, alongside principles like actions, reducers, and immutable updates to ensure predictable state transitions. While originally implemented as a library for React, the pattern’s influence quickly spread, inspiring libraries like NgRx for Angular and Vuex for Vue.js. These implementations aimed to solve common issues, such as debugging complex state interactions, managing side effects, and synchronizing shared state across components.</p><p>At first glance, Redux appears to offer a clean and professional approach to state management. However, a closer look reveals several technical concerns. While its structure of dispatching actions to reducers through a centralized store may seem elegant, it often adds unnecessary indirection without delivering meaningful abstraction. Instead of simplifying state management, the Redux pattern frequently complicates it, introducing multiple layers of boilerplate. These patterns, while enforceable, scatter logic across multiple files, making code harder to follow and debug.</p><h3>Technical Concerns: Indirection Without Abstraction</h3><p>What Redux aims to achieve can often be implemented more directly using simpler and more intuitive patterns. A shared state object, managed through mechanisms like services in Angular or contexts in React, can encapsulate state and provide methods to update it. These methods can serve the same purpose as Redux’s actions and reducers but without the added indirection or boilerplate. Even features like immutability and time travel debugging can be achieved by designing the state object to keep a history of its previous states, allowing developers to trace changes just as effectively. This approach emphasizes simplicity and cohesion, avoiding the fragmentation of logic that often accompanies Redux’s pattern.</p><p>One of the fundamental problems with Redux is its unnecessary indirection, which masquerades as abstraction. Instead of allowing developers to call meaningful methods directly, Redux enforces a rigid workflow where state updates must pass through multiple unnecessary steps. Developers dispatch an action, which is essentially a signal to perform some functionality. The reducer then matches the action to the corresponding logic and generates a new state. However, this entire process mimics what a direct method call could achieve — only with additional, intermediate stops along a linear execution path. The action object itself is a duplication of intent, merely restating what the method already aims to do.</p><p>Rather than simplifying state management, Redux moves complexity into a rigid structure that scatters logic across actions, reducers, and middleware. What could have been a straightforward, cohesive state update is broken into fragmented steps, leading to a system that is harder to understand, maintain, and debug. This pattern is akin to replacing a clear, direct connection with an overly long and cumbersome extension cord: the connection exists, but the process of getting there is unnecessarily complicated and provides no meaningful improvement.</p><h3>The Social Dynamics of Redux’s Popularity</h3><p>Redux’s reputation as a best practice is deeply tied to the perception of its complexity as a mark of professionalism. The multi-step process of dispatching actions, processing them through reducers, and updating the state can appear intimidating, especially to developers new to the pattern. This intimidation often discourages meaningful critique. Rather than questioning whether Redux truly adds value, many developers simply adapt to its workflow, assuming that its complexity is necessary and justified.</p><p>Critics of Redux often face claims that they “don’t understand it” or are “not senior enough” to appreciate its value. Additionally, Redux is frequently positioned as a tool that truly shines in large applications, implying that its overhead is justified by the benefits it provides at scale. However, this argument falls apart under scrutiny, as the very complexity Redux introduces becomes a liability in large codebases, where simpler and more modular solutions often perform better.</p><h3>A Facade of Professionalism</h3><p>Redux has long been promoted as a cornerstone of modern JavaScript development, celebrated for bringing order to the chaos of state management. It is widely seen as a hallmark of professionalism, with terms like “dispatch,” “action,” and “reducer” adding to its allure. Many tutorials, conferences, and even job postings emphasize Redux as the “right way” to manage state in scalable applications. Yet, behind this professional veneer lies a tool that introduces significant complexity while solving few real problems. Instead of offering meaningful abstraction or easing the developer’s workload, Redux introduces unnecessary layers of indirection, masking its lack of substance behind a veil of complexity and jargon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2baa90803abf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FirebaseUI Without Google Fonts]]></title>
            <link>https://medium.com/@tobiasgassmann/firebaseui-without-google-fonts-bfdb81903124?source=rss-74ab3259ff06------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfdb81903124</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[google-fonts]]></category>
            <dc:creator><![CDATA[Tobias Gassmann]]></dc:creator>
            <pubDate>Fri, 08 Nov 2024 17:17:37 GMT</pubDate>
            <atom:updated>2024-11-08T17:17:37.755Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re using FirebaseUI for Web, you may have noticed that it loads Google Fonts by default, directly from Google’s servers. For developers concerned about data privacy or who simply want more control over their assets, this setup may not be ideal. That’s why I created a fork of FirebaseUI that removes this hardcoded font import, allowing you to manage fonts locally.</p><p>The package, published on npm as <a href="https://www.npmjs.com/package/tobias74-firebaseui-without-fonts-import">tobias74-firebaseui-without-fonts-import</a>, lets you integrate FirebaseUI without the automatic loading of Google Fonts. Simply install it via the following command:</p><pre>npm install tobias74-firebaseui-without-fonts-import --save</pre><p>This fork is intended for developers looking to avoid external font dependencies, offering a straightforward way to manage fonts locally or omit them as desired.</p><p>For more details on this fork and to access the source code, you can visit the <a href="https://github.com/tobias74/firebaseui-web">https://github.com/tobias74/firebaseui-web</a>. Here, you’ll find all the changes made to remove the Google Fonts dependency, along with any additional documentation or updates. Feel free to check it out or contribute if you have suggestions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfdb81903124" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Template Driven Forms in Angular]]></title>
            <link>https://medium.com/@tobiasgassmann/dynamic-template-driven-forms-in-angular-82fcaf42877?source=rss-74ab3259ff06------2</link>
            <guid isPermaLink="false">https://medium.com/p/82fcaf42877</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Tobias Gassmann]]></dc:creator>
            <pubDate>Fri, 05 Oct 2018 13:50:41 GMT</pubDate>
            <atom:updated>2018-10-05T14:18:16.762Z</atom:updated>
            <content:encoded><![CDATA[<p>This article describes how to create dynamic forms programmatically in Typescript based on the <a href="https://angular.io/guide/dynamic-component-loader">Dynamic Component Loader</a>. This example uses template driven forms (without a FormGroup). If you are looking for a more involved example using Reactive Forms (with a FormGroup) you might be interested in this article: <a href="https://medium.com/@tobiasgassmann/dynamic-forms-in-angular-ae00e2f5a38e">Dynamic Reactive Forms</a>.</p><p>In several tutorials (including the one on <a href="https://angular.io/guide/dynamic-form">angular.io</a>) dynamic forms are created by introducing a *ngSwitch-Statement which renders a different piece of html for every given input-type. This technique requires that every possible input-type has been implemented in advance in the according *<a href="https://angular.io/guide/dynamic-form">ngSwitchCase</a>. The switching component (in the example it is called “dynamic-form-question-component”) needs to know about all the different types of inputs. It might be more desirable for the dynamic component not to know anything about the components it will render.</p><p>In this article I want to show a solution how to render dynamic forms completely programmatically by dynamically loading components. As a downside every type of input-field has to be wrapped in a thin Component. In this example I am using a very simple input component and another dummy component to show how different types of components can be rendered by the dynamic-form-component.</p><h4>Sourcecode And Example First</h4><p>To get things rolling, here is an example on <a href="https://stackblitz.com/edit/no-formgroup-dynamic-components-demo">stackblitz</a> and the main component as a gist:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59118bcce0befc4a09ce8f0f1fbe1f46/href">https://medium.com/media/59118bcce0befc4a09ce8f0f1fbe1f46/href</a></iframe><p>The most important part of this component is the rendering of the dynamic components in the method</p><pre>private updateComponentPlaceholders()</pre><p>How this works is described in detail in the aforementioned article on angular.io: <a href="https://angular.io/guide/dynamic-component-loader">Dynamic Component Loader</a>. I will try to summarize this in my own words: To render a component dynamically in Typescript you first need to know where in the template you want to render your component. To solve this, a hosting element needs to be identified by a directive. In this example this directive is simply called placeholder-directive:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bc827870d0c6edb1bb409a84194a8b1/href">https://medium.com/media/4bc827870d0c6edb1bb409a84194a8b1/href</a></iframe><p>In order to display a component dynamically you can then use the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de9ad5ce855f988d55e2234e5db08589/href">https://medium.com/media/de9ad5ce855f988d55e2234e5db08589/href</a></iframe><h4>Waiting For The ViewChildren</h4><p>Whenever the form-definition changes (in our example whenever the user clicks the shuffle-button), the template is rendered and the according placeholders are set. Only after the placeholders have been rendered, the according ViewChildren (QueryList of Placeholders) will be available. This means we have to choose the correct Lifecyle-Hook to update our dynamically rendered components. I found that ngAfterViewChecked does the trick. AS you can see in the sourcecode above, the method</p><pre>this.updateComponentPlaceholders()</pre><p>is called in ngAfterViewChecked.</p><h4>Using the dynamic form component</h4><p>Here is a simple example of how to use this dynamic form component. For simplicity, the different inputs and dummy components are just shuffled randomly whenever the user click the button:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/676a21b5633e36a9b3add4f62b3f7d78/href">https://medium.com/media/676a21b5633e36a9b3add4f62b3f7d78/href</a></iframe><h4>Wrapping Inputs Into Components</h4><p>In order to load input-fields in a form dynamically they have to be wrapped in a thin component, since the presented technique only works with components (as far as I know).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/988a92c8f58aeee117912b26c83bab6d/href">https://medium.com/media/988a92c8f58aeee117912b26c83bab6d/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82fcaf42877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Forms in Angular]]></title>
            <link>https://medium.com/@tobiasgassmann/dynamic-forms-in-angular-ae00e2f5a38e?source=rss-74ab3259ff06------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae00e2f5a38e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Tobias Gassmann]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 16:27:26 GMT</pubDate>
            <atom:updated>2018-10-05T14:37:30.680Z</atom:updated>
            <content:encoded><![CDATA[<p>This article describes how to create dynamic forms programmatically in Typescript, as opposed to the template-based approach shown in the tutorial <a href="https://angular.io/guide/dynamic-form">Dynamic Forms on angular.io</a>, which uses a ngFor-loop and a ngSwitch-statement. If you are interested in the more simple approach using template driven forms, you might want to read this article first: <a href="https://medium.com/@tobiasgassmann/dynamic-template-driven-forms-in-angular-82fcaf42877">Dynamic Template Driven Forms In Angular</a>.</p><p><strong>Tl;Dr; </strong>To create a dynamic form programmatically in Typescript I used the technique presented in the tutorial <a href="https://angular.io/guide/dynamic-component-loader">Dynamic Component Loader</a>: A placeholder-directive is inserted into the template and later replaced by the dynamically loaded component. In order to use this technique (which afaik only works on components) I had to wrap my &lt;input&gt; in a small Component called BasicInputComponent.</p><p>Additionally this article is not meant as a tutorial but rather as a request for comments along the lines of: “What did I miss, or is there a better way to achieve the shown functionality?”</p><p><strong>Use-Case: </strong>An html-form consisting of multiple inputs which are dynamically added to or removed from the form, based on some criteria (for example the user’s choices in a previous select-input)</p><p>Lets first look at the concept in action: <a href="https://stackblitz.com/edit/dynamic-components-demo">https://stackblitz.com/edit/dynamic-components-demo</a>. To keep things simple the input elements are just randomly shuffled whenever the user clicks on the button below the form.</p><p>The main functionality of the dynamic form is implemented in the file dynamic-form.component.ts. The html-template used in this file is shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b89da8b73a6fb5a2f49e4df86bcf769d/href">https://medium.com/media/b89da8b73a6fb5a2f49e4df86bcf769d/href</a></iframe><p>Basically this component loops over an array of definitions for each formElement and then inserts a componentPlaceholder-directive with a specific placeholderName.</p><p>After these placeholder-containers have been rendered, their content can be replaced by means which are described in <a href="https://angular.io/guide/dynamic-component-loader">https://angular.io/guide/dynamic-component-loader</a>. The according parts of the dynamic-form.component are shown in the gist below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc568b095d5f1f2f0c3d09b0a2adc0b2/href">https://medium.com/media/cc568b095d5f1f2f0c3d09b0a2adc0b2/href</a></iframe><p>Using a ViewChildren-Annotation it is possible to access the placeholderDirectives in the dynamic-form.component:</p><pre>@ViewChildren(ComponentPlaceholderDirective)<br>componentPlaceholders: QueryList&lt;ComponentPlaceholderDirective&gt;;</pre><p>This QueryList of ComponentPlaceholderDirective will initially be empty. Only after the placeholders have been rendered they can be accessed through this QueryList and subsequently be replaced with the according component. Within the Lifecyle-Hooks of an angular-component the callback ngAfterViewChecked can be used to access the QueryList of ComponentPlaceholderDirective.</p><h4>Distinguish between input-components and regular components</h4><p>The dynamic-form.component distinguishes between regular components and those that wrap an input-element. It has to do so, because it needs to create a FormGroup for all visible inputs. Additionally, in case an input-field is hidden due to the current configuration, its FromControl will not be removed from the FormGroup, it will only be disabled.</p><h4>Updating the inputs according to their visibility</h4><p>The visibility of the input-elements in a dynamic form has to be reflected in the FormGroup of the dynamic-form.component. This is done in the private method updateInputStates(): All invisble input-elements will simply be disabled. Otherwise they would still contribute to the validity of the FormGroup.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccb2b015cb7e58987b5629e5a898cf77/href">https://medium.com/media/ccb2b015cb7e58987b5629e5a898cf77/href</a></iframe><h4>Choosing the correct Lifecycle-Hook</h4><p>Let’s recap: Inside the dynamic-form-component the form-definition is used to render the placeholders. Whenever the form-definition changes, the dynamic-form-component will update itself and render the new set of placeholders. Only after the placeholders have been rendered, the according ViewChildren will be accessible through the QueryList. This means that we have to wait(!) until the placeholders are available. One possible place for this is the ngAfterViewChecked-Lifecyle-Hook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c8f9a1c89539b560e78a7068ae223da/href">https://medium.com/media/3c8f9a1c89539b560e78a7068ae223da/href</a></iframe><p>First the component-placeholders and input-states are updated, then the method detectChanges() is called.</p><p>The dynamic-form-component will create a FormGroup based on the given form-definition. This FormGroup will then be emitted back to the parent component.</p><h4>How to use the dynamic-form-component</h4><p>Implementing a dynamic form based on this dynamic-form-component requires two steps: First insert the dynamic-form-component in your html-template:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89f282beb46c7edf424976a45a6a1054/href">https://medium.com/media/89f282beb46c7edf424976a45a6a1054/href</a></iframe><p>The dynamic-form-component needs a form-definition. This form-definition is basically an array of definition-objects:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a186084fc0ba00adcbf345f639ef585/href">https://medium.com/media/1a186084fc0ba00adcbf345f639ef585/href</a></iframe><p>Each definition-object has to declare an element-name and the component-class which should be instantiated. Additionally it is possible to set the inputs of the component.</p><h4>Updating Inputs of Components</h4><p>In case you need to update the inputs of one of your components you ca do so using a special method which is provided by the dynamic-form-component. In our example we just increment a counter and then apply the new value to the inputs of our DummyComponent:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29e1c605ea1e4131eada19edbee7481b/href">https://medium.com/media/29e1c605ea1e4131eada19edbee7481b/href</a></iframe><p>The according method in the dynamic-form-component is very simple, but has an important twist: We have to use the function</p><pre>Object.assign(componentInstance, componentInputs)</pre><p>to apply the new input-values:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8529fcbc4479024d751ff273f3295247/href">https://medium.com/media/8529fcbc4479024d751ff273f3295247/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae00e2f5a38e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>