Webpack Watch Cached And Not Refreshing Bundles

webpack code showing [cached] everywhere

If you use webpack as your JavaScript bundler, you might have experienced an issue with webpack --watch not refreshing your bundles when modifying the source files. In this case, webpack’s output after changing the file is similar to the following one:

Webpack output showing [cached]

As you can see, there are some [cached] mentions there in a few places and no [code generated] statements at all. The effect is that your bundles are not rebuilt at all. In order to have them refreshed, you need to restart the building process, which takes time and makes your development flow painful. If you want to know how to solve that problem, read on 😉

How Does TypeScript Types Narrowing Work?

Have you ever heard about TypeScript types narrowing? Have you ever seen such an error in your TypeScript code:

TypeScript complains about "name" property not existing  on "person" object of type "object"

Even tough, you really knew that the name property exists on the person object? How did you solve this problem? Did you cast the variable to the expected type?

If the answer to at least one of those questions is yes, you might read on. There are better ways of determining the type of local variable in TypeScript. What’s more, TS compiler does a lot of stuff for us by leveraging types narrowing. In this article, we are going to see how it works and how it can be useful 🙂

Run Cypress Tests From NUnit Test (C#)

In one of our projects, we recently started using Cypress for end-to-end testing. Cypress executes tests written in JavaScript or TypeScript. However, we wanted to first perform some data-preparation operations using C#. In fact, we needed to run Cypress tests from NUnit C# tests.

In this article, I’m sharing how this can be done 🙂 It will also be useful if you use another testing framework than NUnit, but the examples are based on it.

Migrating JavaScript React App to TypeScript

Featured image of Yumasoft article on migrating JavaScript to TypeScript

In one of our biggest projects, we develop and maintain a React web application. Last year, we decided to migrate it to TypeScript. How did it go? How did we migrate JavaScript to TypeScript? Was it worth it? What struggles we met and are we still having any issues? I’ll try to address these questions in this article.

Disclaimer: I’m not describing the migration process step-by-step or TypeScript itself in this article. You can find many resources on that online, including official TS docs.

How to Use JavaScript Component in React Component

We recently run into a problem of having to display a vanilla JavaScript component in a React component. This component exposes a static method to render itself, like many of pure JS components do. In a “normal” JavaScript context it would be very easy to just call such a method, providing a DOM element to render itself into. However, when you want to render such a document as a part of your React component, this becomes a bit tricky. Read on to see how we solved this issue.

How To Replace npm Library With Your Own Implementation?

How to replace npm library with your own - Yumasoft

In one of our projects at Yumasoft we needed to replace npm library’s implementation with a custom one. This was needed because one of the components we use created their own version (fork) of this npm package (the component uses this library internally). In order to make the component working correctly, we had to use the component’s authors version of the library, instead of using the original npm package. It turned out to not be an easy task, but finally we found a nice and easy solution.

Resources to learn JavaScript

When starting your journey with JavaScript, you should have knowledge about valuable information sources. In my opinion, having such lore can save you a lot of time and it can greatly accelerate your learning process. In this article I will try to present you some web pages with JavaScript resources, from widely renowned to slightly underrated ones. I hope that it will help you to increase your skill without pointless wandering through internet depths.