Uncategorized

  • Versioning an API is versioning a promise

    Version numbers in a URL suggest that consumers can be moved forward on a schedule. They cannot — a mobile application on a customer’s phone is a client…

  • Promise.all rejects on the first failure

    Promise.all gives one promise for many, and its failure behaviour is the part that gets assumed rather than read: the first rejection rejects the whole thing immediately, while…

  • CSS custom properties cascade; preprocessor variables do not

    A Sass variable is resolved at build time and does not exist in the output. A custom property is a real value in the cascade, which means it…

  • Order status transitions have hooks of their own

    Hooking save_post to react to an order being paid works occasionally and misses every transition made from a payment gateway callback, the REST API or WP-CLI. The status…

  • At-least-once means the consumer must be idempotent

    Every broker worth using guarantees at-least-once delivery, and the phrase is a warning rather than a feature: a message can and will arrive twice. Exactly-once is not available…

  • An alias is what makes a reindex atomic

    Reindexing into a new index leaves two: the old one still serving and the new one ready. Pointing the application at the new one by editing configuration means…

  • The strangler pattern needs a router in front of it

    Replacing a system incrementally requires something able to send some requests to the old implementation and some to the new. Without it, the migration is all-or-nothing however carefully…

  • Compose file version 2 moved services under a key

    A version 1 compose file is a bare map of service names. Version 2 nests them under services, which looks like churn and is what makes room for…

  • Composer 1.0 platform config pins the PHP it resolves against

    Composer resolves dependencies against the PHP running it, so a developer on 7.0 and a server on 5.6 get different — and both correct — lock files. The…

  • An anti-corruption layer for the API you cannot change

    Integrating with a third party whose model does not match yours spreads their vocabulary through your codebase — their status codes, their date format, their idea of what…