April 30th, 2020

(no subject)

Ryan Florence is good at demoing.

Here, he is showing off a framework on top of React and React-Router that they (the team behind React-Router) are building. It's being positioned as a competitor to Next.js. Some things, such as scroll position restoration, make my mouth water. Great use of React Suspense caching too.

Only the word is, they want to licence this framework and make it a paid product. Which is a shame.

(no subject)

Typescript surprises me.

Say we have a function:

What will the type of the return value be? What if there is no colon in the provided string — then bar will be undefined. But typescript has the utmost confidence in the programmer, and is happy to infer that both foo and bar are strings:

This is dangerous! Here, we shall get an undefined is not a function:

Flow behaves the same, by the way.