There are 88 posts here

2021

3 in April
4 in March
5 in January

2020

6 in October
2 in August
2 in July
2 in June
8 in May
1 in April
1 in January

2019

2 in October
1 in August
3 in June
2 in May
2 in March
2 in January

2018

4 in October
1 in July
4 in May
1 in April
1 in March

    Don't Let Ad Blockers Break Your Website

    [Jan 27, 2019]

    If you're a web developer working on a website running tracking or analytics scripts of any type, you absolutely need to make sure it works for users blocking third-party scripts. This is just the latest example, from fabric.com, but I've seen this happen many times: a completely blank screen when Ghostery is blocking scripts.

    the fabric.com website in a broken state because ghostery blocked tracking scripts

    In this particular case the site threw the error:

    Uncaught TypeError: window.cmRecRequest is not a function

    I personally run Chrome with Ghostery in "shut it all down mode", or set to block everything. The issue is always the same: a piece of code that fires a call to a tracking script (usually set as a global variable), that doesn't check that the variable exists before making the call. It's not often you find it on page load, but turn Ghostery blocking on and watch how many call-to-action buttons on marketing sites stop working.

    Even less extreme ad-blocking can cause some unwanted behavior. This is from css-tricks on Firefox running uBlock Origin. also-broken

    I don't need any help managing my projects, but it still took me a bit to parse what exactly was going on with this sentence, until I viewed it in another browser and found out it was uBlock hiding text that was a doubleclick link.

    The ad blocking wars are only going to get worse going forward, especially now that Apple is blocking ads at an operating system level, while Google and Microsoft are trying to prevent ad blocking at that same level, and the browsers and lining up on opposite sides of the same battle, with Safari and Firefox helping users block ads and trackers out of the box, and Edge and Chrome have a business interest in delivering ads and tracking their users.

    Permalink

    Stenciling

    [Jan 2, 2019]

    I spent a little time over the holidays playing around with Stencil, a JS compiler for web components. I wanted to look at it because we've been comparing component libraries at work, and we were finding a surprising number of them that were going all-in on web components, usually generated by Stencil. Some quick notes about it in general, and comparing it against React, our current JavaScript library of choice:

    • Stencil reminds me a lot of the joys of jQuery plugins, where deciding between creating an element and passing in children or creating an element and passing in attributes is just a flip of the coin kinda choice. That's not to say React is better - see the arguments for or against higher-order components - but at least in React everything is in React, unlike web components where your children / attributes are in HTML and the handling is in JavaScript.
    • I hate carousels. I wanted to try to recreate a carousel that's on our current public site - it kind of magically appears when the viewport gets small enough and is just a glorified overflow slider. I feel like I've built variations of carousels a thousand times now, so there's a certain appeal in building a web component and never ever doing it again.
    • HTML doesn't understand TypeScript. I use TypeScript on all my React projects, and having attribute completion is 💯so going back to "just" HTML made me a little sad. It also made me realize how long it's been since I've written anything in an .html file that wasn't just <div id="app"></div>.
    • ... but it is just HTML + JS so it works anywhere.
    • ... but Stencil is a compiler that requires a build step, so you haven't quite gotten away from build steps in your front-end development process, but you're closer for every project that uses the Stencil-generated components.
    • I would have killed for this setup 3 or 4 years ago. TypeScript? Sane JavaScript templating? Not having to transport the same stupid widget between HTML, Angular, and React projects? It would have been amazing. Now that I do everything in React it's less exciting.

    Overall I was impressed by Stencil. The documentation could be better, but they make it pretty easy to fire up a project and figure it out, and TypeScript + JSX is by far my favorite combination for JavaScript templating. Some of the decisions are close to React but not quite the same, like having props and state but not state update batching, or at least not that I could find. Digging through the shadow DOM in the Chrome inspector is painful compared to using React dev tools, especially if you're using child elements, which exist in some sort of alternate reality that allows you to interact with them like normal DOM elements. I built the carousel as a web component that accepts any children because that's how I would do it in React, but dealing with children beyond using the web component <slot> tag required some Stack Overflow searches and some solutions that I'm still not sure I grok.

    If there was ever a chance we were moving away from doing everything in React I'd jump to web components in a second, but when we are building everything in React, adding in another compiler feels like it's overcomplicating our development tooling. But maybe I'll regret saying that when we switch to Vue and have to build another carousel.

    I put the demo up on GitHub, it's probably broken in IE. I hate carousels.

    Permalink

    Defending the presents

    [Dec 25, 2018]

    41BE73D4-CE84-4075-B5FD-25F10951A481

    I think our cats might be half chicken. They've never tried taking the tree down - they're content to just roost under it.

    Merry Christmas, everyone.

    Permalink

    [Dec 16, 2018]

    Accessibility is hard. But it is no harder than security, performance, usability, internationalization, or quality code. And frankly, we don’t put up with software companies (even open source ones) saying “whoops, well you know, security is hard, so it fell by the wayside, sorry”. -- Anne Gibson

    Yes. And that's a great list of bullet points for anyone starting a new project. Define what accessibility, security, performance, usability, internationalization, and quality code mean for your project when you start - not halfway through, or at the end.

    Permalink

    [Dec 8, 2018]

    My most used apps, on a day to day basis, are:

    1. Visual Studio Code
    2. Slack
    3. Notion

    Just in case anyone wonders where I stand on the Electron debate.

    Permalink

    Veteran’s Day

    [Nov 12, 2018]

    I always knew my grandfather fought in France in World War II, but the details were fuzzy. As a kid I’d ask dumb questions like, “did you ever shoot anyone,” and he’d reply with, “I shot at them, they shot at me, who knows where the bullets went,” before shooing me off. In High School I was given an “Interview a World War II veteran” assignment for an American History class, so I asked him some more formalized questions, but he couldn’t quite remember the names of places he had been to, or when exactly things had happened. At the time I wondered how it would be possible to forget something like fighting in World War II, but he was there as twenty year-old in 1944, this was maybe in 1998, he was trying to recall fifty-four year-old memories of things he probably didn’t want to remember.

    I asked again, every few years, about what he remembered. At some point we got him a computer, and installed Google Earth, and he would mouse around France trying to figure out where he was. He would do some searches for the places he had been, but his misspellings of mispronounced locations in France didn’t return much. At some point he remembered (or saw on a map) that he had been in Metz, and we figured out that the fort he fought at was called Driant, not Durant or Verant, as he usually pronounced it. In 2009 I sat down and asked him a few more questions and actually recorded it.

    My grandfather passed away two years ago, but I listen to the recording every so often, and search around for any more details. Coincidentally, someone added a Wikipedia page about the battle in 2009, not long after I had talked to him: Battle of Fort Driant. The initial entry refers to it as a “minor skirmish” in the larger Metz conflict. This year I finally got around to transcribing some of our conversation so it was saved somewhere other than my iCloud Voice Notes. A lot of it is sort of - as he remembers it, not in a clear chronological order. Or it was pieces of conversations that I knew I had with him in the past the he was interjecting. But there’s one part of the story that was always clear in his mind:

    “...the fort was big. When we left the fort, two o’clock in the afternoon, they come down with a British (unsure of the word used here) they called it. See we only had a piece of the fort, we only had a little piece. And they put that in the tunnel, and they blew it. And the blew into the hole, because it was plugged. So they blew it out. So they sit there with machine guns firing at us, and they sit there with a machine gun firing at them, down the tunnel. You know, back and forth? And you know the back of the damn machine guns sit like there, and they had ten satchel charges here (1), they weighed 18 pounds a piece. TNT. And a bullet, or a uh, they don’t know whether it was a bullet, or... the door was right here, whether they put a hand grenade in. They blew up. And you know I was gonna go into the door, cause we were all retreating then, because they tell us, “everybody on that side of the fort get the Hell out”, because they were afraid the Germans was gonna break through. So we were all crawling through, and when that blast - the five guys in front of me they had faces like hamburger. The two guys in front, medic said they wouldn’t live, but the two guys in front, the lash above the eye was even gone, and the other guys they had their lashes but the meat was like the powder of the satchel charges, they were in the flame in other words. And the five machine gunners that were sitting there by the hole they were gone. I got blown across the room there, helmet fell off. Stunk! I mean the smoke, couldn’t even breathe. I got my handkercheif out, put it over my nose, then I could breathe, because it saved the big punches from coming in. Then we got out of there. When we got over to the next part, there was a tunnel that went into another opening. And that’s where we, we were so tired then we were just sitting and snoring so loud you’d wake yourself up. Because the last two or three days we didn’t get much sleep. And after that, they took us out.

    We went up with a hundred and forty-nine, went over with a hundred and forty-nine, and we came back with forty-nine.“

    1 - I believe he was pointing across the room while saying this, indicating the machine gun wasn’t far away from the charges.

    At some point in the recording you can hear my Grandmother chime in with, "I'm glad you didn't have to go to war Joey". Me too, Grandma.

    Permalink

    In case you worried UI development wasn’t important

    [Oct 28, 2018]

    81103EFB-D1F7-49DA-8430-E5B1488B9EF0

    From a Reddit thread on Texas voting machines. This is a pretty egregious failure on the part of some UI developer somewhere, but it does speak to an often overlooked part of UI development: if a user can see an interface, they're going to try to interact with it, and it's your job to make sure that they can. If you don't have a good understand of what interactive means (or what can block it), Phillip Walton's recent post, "Idle Until Urgent" is a good read.

    Permalink

    Shop Local

    [Oct 20, 2018]

    A great article on the problem with the idea of "shop local" saving small businesses, and an old school styled blog to go along with it.

    It paints a picture that lines up with what I've observed, that major city centers will eventually all look the same because only "big retail" can exist there, and smaller cities will take up the unique stores that big cities once had. If you want to save big cities, it might be time to switch all of the "keep CITY NAME HERE weird" slogans to "the rent is too damn high".

    Permalink

    [Oct 15, 2018]

    2D45DB2F-C1A4-43FF-95DB-CD131BF4D81C

    I always set out to make Halloween decorations that are creepy-cute, like something from Tim Burton, but end up with things that are disturbing-cute, like a bunch of clown dolls in an attic.

    Permalink

    Book Thoughts: From Here to Eternity by Caitlin Doughty

    [Oct 13, 2018]

    Let me start this by saying: I like cemeteries. I find the quiet relaxing, I like wandering around looking for unique headstones, and I make a game out of trying to find the oldest grave in the park. I especially love the colonial-era headstones you can find in New England, with their hand-hewn skulls that are either dopey or terrifying or reverent or some mix of all three.

    I was also raised by a father who thought that the maybe-true story of Eskimos putting the elderly out on ice floes when they became a burden was a good idea. So, reading a book with a section about the dead being fed to vultures was kind of right up my alley.

    I learned some surprising things while reading this book. I always thought a funeral pyre was a neat idea, like a dramatic cremation, but it turns out they're not great for the environment. I would have assumed a dead body in the wild would be gone overnight, but it turns out unless you have the right kind of animals around, it's unlikely something is going to show up and eat your body. I learned that, in general, it's actually kind of hard to get rid of a body, especially the bones, and it's mostly regulations and price gouging that requires you to take something that is already hard to break down and wrap it in a bunch of metal and wood and cement enclosures that are even harder or impossible to break down.

    More than anything, the book reminded me that death in the United States is an inglorious thing, and there's really not much you can do about it. The options for alternative burials are incredibly limited, and the system is setup in a way that means end-of-life for most people involves dying in an uncaring hospital environment and picking a pre-packaged plan from a funeral home, with the nice plan giving you two hours to grieve and please make sure the photos we're going to display on the TV in the lobby are formatted correctly. Or as the book puts it:

    In our Western culture, where are we held in our grief? Perhaps religious spaces, churches, temples - for those who have faith. But for everyone else, the most vulnerable time in our lives is a gauntlet of awkward obstacles.

    I am not religious, so I understand this. If I was, and I could pick a religion that I thought would respect my death in the way I want it to be respected I'd go with the religion of the ancient Egyptians and be buried in a rock pyramid with my cats. Since that's probably out of the question, cremation seems like a fine backup plan, but after reading about the Bolivian Ñatitas, I kinda want someone to keep my skull around too. Doesn't even have to be a family member, a future web-worker can make me a crown of USB cables and I'll help them decide which JavaScript datetime library to use, or something.

    Anyway, I recommend this book. It's a quick read, it's mid-October, you can finish it before Halloween, when Americans dress up as ghosts and ghouls and pretend that death is terrifying, and most of the rest of the world throws a party to celebrate the part of life that is death.

    Permalink