Home » Archives for Shannon Behrens

Author Archives: Shannon Behrens

Catholic, father of eight, open source enthusiast, Python, JavaScript, Ruby, Scala, Go, etc. programmer.

Python: PyWeek 32: Lil Miss Vampire

TL;DR A world that scrolls infinitely in any direction, an RPG-like UI, and simple, real-time fighting. My younger kids and I built this entry for PyWeek 32 based on the theme “Neverending”. The key innovations are: It has a neverending world. As the player walks along, it picks up tiles and places new ones invisibly. It uses an LRUDict to remember the ...

Read More »

JavaScript: Upgrading from MobX 2.7.0 to 3.0.2

As usual, you should check out the CHANGELOG. However, let me point out a few things specifically: Don’t use the @action decorator on a singleton object that you pass to observable(). If you have code that looks like observable({ @action f: () => {}), you should change it to observable({ f: action(() => {}). Apparently, using decorators on singleton objects ...

Read More »

JavaScript: Porting from react-css-modules to babel-plugin-react-css-modules (with Less)

I recently found a bug in react-css-modules that prevented me from upgrading react-mobx which prevented us from upgrading to React 16. Then, I found out that react-css-modules is “no longer actively maintained”. Hence, whether I wanted to or not, I was kind of forced into moving from react-css-modules to babel-plugin-react-css-modules. Doing the port is mostly straightforward. Once I switched libraries, the rest of the ...

Read More »

JavaScript: Upgrading from MobX 2.6.0 to 2.7.0

As usual, you should check out the CHANGELOG. However, let me point out a few things specifically: If you have something like: observable({ @computed get someProp() { ... } }); your code will work in 2.6.0, but in 2.7.0 reactions won’t occur properly. Your tests will end up timing out. It needs to be: observable({ get someProp() { ... } }); ...

Read More »

Doing Multiple Searches in VS Code While Refactoring

I spend a lot of my time refactoring code across a very large, legacy codebase at work. Often times, I’ll do a search for something and work my way through the results over a period of days. Sometimes, something I see might lead me to do another search and a minor refactoring job which is part of the overall refactoring ...

Read More »