Writing · 34 posts
Things I’ve learned
Short posts on frontend engineering, written when I figure something out. Many come out of a project, and link back to it.
2026
How our designers started shipping screens in codeI set up the workflow for our dashboard rebuild where designers build screens in the real app and engineers take them to production. The scripts, rules and branch policy behind it, and what it changed.AI · Process · Developer toolsFrom An AI agent that lets designers ship codeA card field that respects the caretFormatting a card number as you type is easy until someone edits the middle of it. Here’s how to keep the caret where the person put it, plus the Luhn check.Forms · JavaScript · PaymentsFrom One shared library, two checkoutsA migration playbook an AI agent can followPorting a legacy tool screen by screen is repetitive and easy to get subtly wrong. Writing the rules down as an agent skill made every port consistent.AI · Migration · ProcessFrom Architecting two dashboardsAn image budget that fails the buildLarge images creep into apps one pull request at a time. A small script that runs before every build stops them at the door.Performance · Build tools · Next.jsFrom Architecting two dashboardsBrand colours and text that stays readableWhen every merchant can pick their own header colour, the text on it has to choose its own colour too. Relative luminance does the work.Accessibility · CSS · ThemingFrom White-labelling a checkout from configDeadlines in days, then hours, then overdueIn dispute management a missed deadline costs real money. Giving the whole product one way of talking about time made it calmer and clearer.UX · Payments · CopyFrom Leading the disputes rebuildWriting emails that list many disputes at onceNotes from writing fifteen transactional email templates for dispute management, including bulk emails that loop over rows and a naming scheme that kept them sane.Email · HTML · TemplatesFrom Leading the disputes rebuildFilter chips that don’t fight youTwo dashboards had each grown their own filter chips, and they had drifted apart. Moving them into a shared design system meant agreeing on a few small rules.Design systems · React · UXFrom Maintaining a 35-component design systemGuardrails for an AI agent that edits your appI built an in-app design agent for a payments codebase. Most of the work went into what it is not allowed to do, enforced in code rather than in the prompt.AI · Security · Developer toolsFrom An AI agent that lets designers ship codeMigrating a console nobody can stop usingHow we moved an operations tool to a new app one screen at a time, with the old and new apps running side by side and talking over postMessage.Architecture · Migration · iframesFrom Architecting two dashboardsMoney inputs show one number and send anotherAn amount field should look friendly to a person and stay exact for the API. Notes on grouping, decimals per currency and limits.Forms · Payments · i18nFrom Leading the invoicing rewriteOne animation, 80 KBHow a bundle analysis on a hosted checkout found an animation library that drew a single loader, and what replacing it with CSS did for mobile load times.Performance · Webpack · CSSFrom Cutting 18% from a checkout bundleThirty-five components, one set of shadowsOur design system had shadows picked by hand in every component. Turning them into named elevation tokens made the whole library feel like one thing.Design systems · CSS · TokensFrom Maintaining a 35-component design systemThe crawler that failed real paymentsSome payments were ending in SYSTEM_ERROR for no reason we could see. The culprit was a text-to-speech feature loading our payment page on its own servers.Debugging · Payments · ProductionLink previews for a single-page appChat apps build link previews from your HTML and never run your JavaScript. How we gave every payment link its own preview with a Cloudflare Worker, and the details that are easy to get wrong.Architecture · Cloudflare · PaymentsFrom Link previews from one edge WorkerGetting paid in dollars, and keeping themAn Indian exporter paid in dollars usually gets rupees. An EEFC account lets them keep the dollars instead. What it is, why exporters want one, the rules in short, and how a payments platform settles into one.Payments · Banking · Cross-borderFrom Letting exporters keep their dollarsDoes this alert even apply to a browser app?Upgrading axios in a frontend-only app, and what I learned sorting its advisories into "affects us", "only on a server" and "worth patching anyway".Security · Dependencies · axiosFrom Eleven security fixes across five appsPin your web server, and make the build check itOur frontend's Docker image installed whatever nginx the OS repository offered. I switched to nginx's own mainline repository, pinned a version, and made the build fail on anything older.Security · nginx · DockerFrom Eleven security fixes across five appsHow Indian exporters prove they were paidIndian exporters need an eBRC to prove they were paid, for tax refunds and export incentives. Since 2023 they generate it themselves, by mapping bank messages to shipping bills. How that works, and the rules that trip people up.Payments · Cross-border · ComplianceFrom Self-serve proof of payment for exportersThe audit gate we switched offOur dashboard ran npm audit before every commit. Within a month I'd narrowed it twice and then turned it off. Why pre-commit is the wrong place for it, and where it belongs.Security · Tooling · npmFrom Eleven security fixes across five appsWhen the UPI attempts run outEach payment on our orchestration checkout allows only so many UPI attempts. After a reload mid-payment, the page didn't always respect that. Four cases, one decision at the door, and the one I broke on the way.Payments · UPI · ReactTheme settings, not partner flagsWhen one client needs your page to look different, the quick fix is an if-statement with their name in it. What I learned restyling a checkout for a wallet partner through configuration instead.Design systems · CSS · ArchitectureFrom White-labelling a checkout from config
2025
The patch that needed a patchIn December 2025 Next.js shipped security fixes three times in nine days, and one of them was incomplete. What our dashboard upgrade taught me about reading advisories and lockfiles.Security · Next.js · DependenciesFrom Eleven security fixes across five appsWhen the security fix is a new build toolSome security alerts can't be fixed by bumping a version, because the tool holding the old version is no longer maintained. Moving a React app off Create React App to clear them.Security · Build tools · ReactFrom Eleven security fixes across five appsFixing vulnerabilities in packages you never installedMost security alerts on our dashboard were for packages nobody on the team had added. How transitive dependencies get flagged, and the right and wrong ways to force a fix.Security · npm · DependenciesFrom Eleven security fixes across five appsWhy every Indian export stays open until it’s paidEvery export from India opens an entry in an RBI system that stays open until the payment is matched to it. What EDPMS is, why open shipping bills hurt exporters, and what "regularising" them means.Payments · Cross-border · ComplianceFrom Self-serve proof of payment for exportersKnowing when a popup is done, without pollingPayPal told our backend when a merchant finished linking, but the backend had no way to tell the open page. So the dashboard asks at the two moments that matter, when the PayPal tab closes or the merchant comes back, instead of polling.Payments · JavaScript · BrowserFrom Linking PayPal without pollingThe build that ran twiceOur dashboard took 12 minutes to deploy and 3 to build on a laptop. Reading the pipeline line by line found the app being built twice.CI/CD · Docker · AWSFrom Twenty months building the merchant dashboardLetting one app frame another, safelyTo move an operations console to a new app screen by screen, we embedded new pages in the old one with iframes. What I read along the way about framing headers, cookies, postMessage and the iframe attributes that make it work without opening a hole.Security · Browser · iframes · ArchitectureFrom Architecting two dashboardsWhat a one-rupee deposit tells youBefore sending money to a bank account, you want to know it exists and whose it is. Penny drop answers both by sending ₹1. How it works, why the name check is the hard part, and what I built for our operations team.Payments · Banking · FormsWhen code splitting doesn’t helpI split our checkout’s bundle into chunks, measured, and took it out two days later. Code splitting is good advice, but not for every page. Here’s how to tell.Performance · Webpack · Build toolsFrom Cutting 18% from a checkout bundleTwo tiny attributes that speed up a pageAlongside a big bundle cut, two one-line changes helped our payment page start faster on phones. What defer and preconnect do, and when to use them.Performance · HTML · BrowserFrom Cutting 18% from a checkout bundleThe best patch is deleting the packageOur checkout's HTML sanitiser had a published XSS bypass. I patched it, and a few months later removed it. Why the second fix was the better one.Security · DependenciesFrom Eleven security fixes across five appsWhen a web page has to answer a POSTOur payment page only answered GET, until a merchant's system could only send customers to it with a form POST. Why that happens, why nginx says 405, and the ways to fix it.Payments · HTTP · Infrastructure
Nothing here yet.