hjertnes.blog

Webpack

15.01.2018 01:00

Webpack is your compiler, and learning how to use that tools shouldn’t be the first thing you do, because a lot of people will probably give up before they get started. I think that most experienced developers should understand what the webpack configuration does. And all teams should have at least one person that can wrangle together a config file from scratch.

I say, start with create-react-app, then learn how to write react code, and then learn how webpack works when you have a thing you need to do that create-react-app can’t do.

It isn’t that complicated really. You have a entry point (the javascript file where webpack will begin) some configuration of how you want to transform your code, some configuration of how the output should be and that’s it. The great thing about using something like webpack is that you can build everything from your javascript code, and styling plus generating HTML files (both for development and production). You can for example add a hash to the file names to avoid caching problems in production.

I typically start with create-react app these days, and then move on to using my own webpack, if or when I need to.

#

14.01.2018 01:00

#

14.01.2018 01:00

I’m going to do my best to not make jokes about checks and health care in America this year.

#

14.01.2018 01:00

hjertnes/mb.el: A Emacs Lisp function to post to Micro.blog’s

#

13.01.2018 01:00

#

13.01.2018 01:00

Annoyance of the day: people saying “pod”

#

13.01.2018 01:00

This is the funniest thing I’ve seen in a very long time. 😂

#

12.01.2018 01:00

#

12.01.2018 01:00

😂

Redux vs MobX

12.01.2018 01:00

I think I was pretty clear about the fact that I think redux is awesome, and that I don’t like MobX very much. But I do recommend that you take a serious look at both before you make up your mind. Because I think it is a good idea to make sure that as much as possible of your application code lives outside your UI Library / Framework. I say this because it makes it much easier to work with and it also makes it easier to switch away from React in the future.

Which one you chose should come down to your and your teams preferences and your projects requirements. My view is – preferences set aside – that MobX means less code, which is good – and that redux gives you much more control of where and how state flows through your application. The latter can be a huge performance win, while the former can be a huge productivity win.