hjertnes.blog

Testing Out Sunlit

25.01.2018 01:00

2017-11-04

```text ```

2017-11-11

```text ```

2017-11-12

```text ```

#

24.01.2018 01:00

React Fragments.

24.01.2018 01:00

As React have developed over the years, they have slowly removed redundant nodes from the HTML that React renders. For example, when I started something like this {this.props.value} would be wrapped with spans by React.

One of the awesome additions to React 16 was fragments, I think it went past most of us, because we were too busy testing out the new ErrorHandling and performance improvements.

Fragments solves a very pressing issue that most React developers will meet sooner or later. Every component only returns one root component. That means that you have to wrap a lot of stuff in unnecessary divs or spans to meet this requirement.

You can now wrap anything that you previously wrapped in divs just because of “React Reasons”, in either <> and </> or and .

The result is that you can have just one root element, without adding unneeded nodes to the dom.

#

23.01.2018 01:00

I just got my invite to the Drafts 5 beta. Drafts have been one of my all time favourite iOS apps, I’m pretty sure I have used more or less every single point release of it. And I continue to enjoy it quite a lot.

The idea behind it is very simple: just start writing and worry about where it goes later. What makes it powerful is how you can define your own actions. In the past it was limited to url actions. While powerful, you were limited to sending the text to applications on your iOS device that had implemented a url scheme.

A url scheme is just a way where apps can define their own “protocol”, you could think of http:// as a url scheme claimed by Safari, 1Password used to have a 1p:// scheme (or something like that) in the old days to make it easier to open stuff in the 1Password in-app browser. This was way before extensions in mobile Safari.

Version five brings this to the next level by adding integrated support for talking to web services; this is done through JavaScript. This means that you could post directly to Micro.blog or your WordPress site instead of having to first send it to the WordPress app or Micro.blog app and then publish it from there.

It looks great, and I can’t wait. And it looks like more of the heavy lifting have been taken care of, compared to if you wanted to do something similar using Pythonista.

#

23.01.2018 01:00

[@hjertnes]1 test

#

23.01.2018 01:00

I’m not that interested in the smart speaker stuff. Also, I’m more or less 100% sure that my dogs and fiancĂ© wouldn’t appreciate listening to geeky podcasts as much as I do.

#

23.01.2018 01:00

Handling errors in React

23.01.2018 01:00

With React 16 handling errors with React became a hell of a lot easier than it used to be. The official documentation has all the code you need to get started.

The basic idea is that there is a lifeCycleMethod, and if there is an exception thrown in any component in this or somewhere “under” this component it will trigger. With all the information you need to display an error message to the user, or more important saving it somewhere.

Showing it to the users? Not that important, because most of them will not ever read them. Having a place to keep track of them? Very important, makes it so much easier to fix and deal with all the problems with your app; instead of just those you hear about.

#

22.01.2018 01:00

It’s micro Monday again. This week I recommend [@jack]1. A awesome follow, especially if you are into photography, analog stuff or emacs.

#

22.01.2018 01:00

Installing SilverFast always drives me nuts. The installation process is designed as bad as the software itself. Download a new copy (because the one included with the scanner is outdated). Make sure the scanner is connected to the computer. Then type in a long serial number, before you need to insert the original installation media for it to verify that you actually have the original CD or DVD.

It requires two USB-A to USB-C adapters plus a USB CD Drive to install the damn thing on a modern MacBook Pro.