New posts from Manton Reece


This year I've become fascinated with my family tree. Just got back my DNA kit results. (Yes, there are privacy issues. I'm ignoring those for now.) So far it reveals just about what I expected. Still amazing.
2023-04-17


Shoutout to the guy holding a "thoughts and prayers ain't working" sign downtown this morning. Banning assault weapons should not be controversial. It's time.
2023-04-18


One of those just try random code until it works mornings. Not proud of it. Sometimes coding is less well-crafted and more stubborn persistence.
2023-04-18


I've been impatient for Bluesky to ship, but this interview with The Verge has helped convince me that it's okay to wait. The API is still in flux. Already I need to go back and update some early experiments.
2023-04-18


There are always more ideas than time. One of the things I've most enjoyed about building Micro.blog is that it's a platform where many blog-related ideas can fit together. The "micro" was always a bit of an undersell.
2023-04-19


Got lost down the rabbit hole of W3C membership fees... Interesting scaled fee structure, in the United States from $2k/year to $77k/year depending on the member company's revenue.
2023-04-19


Thunderbird Coffee. ☕️


2023-04-20


Accidentally clicked on a phishing email. Ugh, must not be awake yet. Stopped short of signing in and giving them my password, though.
2023-04-20


React Native diary #8: Objective-C

I haven’t written a new React Native diary blog post in a while because there hasn't been anything noteworthy. We’ve shipped new versions of Epilogue for iOS and Android. Micro.blog 3.0 for iOS is almost ready — also a rewrite for React Native.

We did hit one feature that I wanted to preserve from the previous version of Micro.blog: Markdown and HTML syntax highlighting when writing a new blog post. The best way to preserve this was to port the Objective-C code over to React Native. (This feature won’t be available on Android yet.)

The “native” in React Native is because it uses native iOS and Android controls, even though they are driven from a JavaScript engine. This means we can make our own native components, written in Swift or Objective-C.

There are a few pieces of code to make this work:

  • MBHighlightingTextView: a UITextView subclass, but it could be any control.
  • MBHighlightingTextManager: a RCTViewManager class, helping us build an interface between JavaScript and native code.
  • HighlightingText: a React.Component, wrapping up the native control.

Here’s a snippet of the MBHighlightingTextView interface:

@interface MBHighlightingTextView : UITextView

@property (copy, nonatomic) RCTBubblingEventBlock onChangeText; @property (copy, nonatomic) RCTBubblingEventBlock onSelectionChange;

@end

And the MBHighlightingTextManager interface:

@interface MBHighlightingTextManager : RCTViewManager <UITextViewDelegate>

@end

For the MBHighlightingTextManager implementation, the important bits are the macros that define what properties we care about:

@implementation MBHighlightingTextManager

RCT_EXPORT_MODULE(MBHighlightingTextView)

RCT_EXPORT_VIEW_PROPERTY(onChangeText, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTBubblingEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(inputAccessoryViewID, NSString, MBHighlightingTextView) { if (json) { NSString* input_id = [RCTConvert NSString:json]; // … } }

  • (UIView *) view { // make a new MBHighlightingTextView and return it // … }

@end

Finally, the JavaScript side that loads the native component:

import * as React from 'react';
import { requireNativeComponent } from 'react-native';

const MBHighlightingTextView = requireNativeComponent(“MBHighlightingTextView”);

export default class HighlightingText extends React.Component { render() { return ( <MBHighlightingTextView {…this.props} /> ) } }

Now we can simply use <HighlightingText> in place of <TextInput> in our XML when laying out the UI. Handlers like the property onChangeText will be referenced from Objective-C so we can call them in response to methods from our UITextView delegate.

I’m leaving some code out in the above examples for readability. And I have a bunch of code still to write, working in a branch of our project on GitHub. But already the basics are working, after (frankly) a lot of trial and error and sifting through the documentation, Stack Overflow, and even asking ChatGPT, which knows a surprising amount of how this works.
2023-04-20


The Verge has a long article by David Pierce today about ActivityPub. The quote from me about domain names doesn't come across quite how I intended it… Yes, domain names are hard, but we need to make them much easier to deal with because they're actually great.
2023-04-20


Tantek Çelik blogs about yesterday's The Verge article on ActivityPub, underscoring some of the IndieWeb principles that are covered. There's really a lot in there and I'm glad to see the article getting so much attention. Thanks @pierce@mas.to!
2023-04-21


Updated my code for Bluesky for the recent API endpoint changes. Looking forward to enabling this for Micro.blog folks.
2023-04-21


One of those afternoons where I'm hopping between unrelated tasks. Currently revisiting how to best crunch through OpenStreetMap data.
2023-04-21


On this week's episode of Core Intuition, we talk about the Mastodon API and upcoming new MarsEdit release. And of course, blogging.
2023-04-21


If it was starting to feel like Humane’s device would be overhyped or vaporware, I’m ready to put aside those concerns. It looks like they are onto something fascinating, both the projection and the AI language translation.
2023-04-21


Lunch at Easy Tiger earlier today. 🥪

Photo of building with tiger logo.
2023-04-21


The bookmarks pages in Micro.blog haven't felt quite right to me, so today I rolled out a small redesign that I think better integrates bookmarks, highlights, and links. (This is only for Micro.blog Premium subscribers. Premium adds web page archiving and making highlights in bookmarked pages.)

Screenshot of new Micro.blog interface with bookmarks tab and search box.
2023-04-22


"Make no little plans. Make the biggest one you can think of, and spend the rest of your life carrying it out." — Harry Truman
2023-04-22


Trees by the trail at Lady Bird Lake.

Photo of lake with large tree in front of it, apartments in the background. Just east of I-35.
2023-04-22


It breaks my heart a little when I drive through a historic neighborhood to see old houses bulldozed to make room for modern mansion monstrosities. I know a house is just a thing, but it feels like erasing a bit of history that mattered to someone.
2023-04-22


Matt Baer blogs about the future of Write.as and WriteFreely — taking features that are currently separate products and integrating them into more of a suite:

At this point, I don’t think it makes sense for our self-hosted product to be chopped up into multiple components like our hosted tools are. Instead, I want to bring all those tools into a single application in WriteFreely.

Remark.as will also get fediverse replies. Sounds like a good direction.
2023-04-22


It’s a good day to have a good day.

Photo of wall and sign at Freddo ATX
2023-04-22


HTML's srcset is such a weird image attribute. Can't help but feel there was a better way to handle this. (But no, I don't have any obviously better ideas.)
2023-04-24


Mastodon to Blog Archive script

Tantek Çelik blogged about Mastodon’s account migration and its post export, which is based on ActivityStreams. No other apps really import this format yet, not even Mastodon itself. He also mentions the Blog Archive Format and how useful it would be to convert between Mastodon and this format:

Such a library would make an excellent drop-in addition to any #ActivityPub implementation, allowing both export of posts, and also a browsable archive format, so you could visually double check when importing to another service that these were the old posts you were looking for.

I’ve taken a first pass at writing a Ruby script to convert Mastodon’s export to Blog Archive Format. It’s available as a GitHub Gist here. It's not packaged as a general-purpose library but certainly could be adapted for that.

Direct posts import from Mastodon will be baked into Micro.blog soon. We already support several formats — WordPress, Medium, Tumblr, Ghost — and I learned a lot about how best to process large archives while building the new Twitter import.
2023-04-24

Manton Reece @manton