nodejs

Using Elm inside create-react-app or: How to properly patch your `node_modules`

6 minute read Modified:

This article describes how you could use Elm inside a create-react-app and how you could patch your `node_modules` in a proper, reusable way.
Introduction In this Blog-post we will use create-react-app to demonstrate how you could use Elm inside and while doing that how to patch your node_modules in a reusable way by using patch-package. Create Application We will create a react-app with npx create-react-app elm-react-app This gives us a basic react-app with everything out of the box. Note that we are using react-scripts at version 3.1.1 here, future versions might have different line numbers we are using later on.

Rewriting functions with fold and reduce

11 minute read Published:

How to use fold and reduce to rewrite any function that operates on lists
Introduction In this post, I will explain how it is possible to use fold(in Haskell) or reduce(in JavaScript) to rewrite some common array functions to get a basic understanding of how they work and how much you can do with it. So, if you want to learn how fold/reduce work and what a powerful function it is, this post is for you. How does fold/reduce work? fold/reduce iterates over a list and operates on the current element and the already processed ones.

You might not need scripty

2 minute read Published:

Because no one should be shell-scripting inside a JSON file. That’s cool, but why should I use scripty? I could do this well without. What is the advantage of another dependency in my project? Recently I had to work on a project and the build were broken because of an update of scripty. That wouldn’t be a problem if our version constraints were more strict or we would had a shrinkwrap.