Uncategorized

  • Pre-bundling with esbuild, and the dependency it cannot parse

    Dependencies are pre-bundled with esbuild once and cached, because a package shipping four hundred small CommonJS files would otherwise be four hundred browser requests. The scan finds imports…

  • Transactions per test, and the three things that break

    Wrapping each test in a transaction and rolling back is much faster than migrating between tests, and three things do not survive it. The second connection case is…

  • Glob imports, and the routes directory that registers itself

    A directory of route modules had an index file listing them, and the file was updated by hand every time somebody added one. The lazy form is what…

  • Vite’s proxy for the API in development

    The dev server runs on a different port from the API, which is a cross-origin request, and proxying is simpler than configuring CORS for development only. changeOrigin rewrites…

  • import.meta.env is not process.env

    There is no process in a browser, so Vite exposes environment variables on import.meta.env and only the ones with a prefix. The prefix requirement is a security default…

  • A Vite build is Rollup, and the plugin API is Rollup’s

    Vite uses esbuild in development and Rollup for the production build, which means the plugin ecosystem to look in is Rollup’s. The two-engine arrangement is the source of…

  • SINTERCARD counts without materialising

    Counting the intersection of two large sets meant building the intersection first, which allocates a set you immediately discard. The LIMIT is the part that changes what is…

  • The N+1 that only appeared in the API serialiser

    A controller with eager loading and four hundred queries anyway, because the query count depends on which fields the client asked for.

  • Named arguments through an interface are a gamble

    PHP does not require an implementation to use the same parameter names as the interface it satisfies, so a named argument through an interface type is only as…

  • A queue worker that stops cleanly

    A deploy killed a worker mid-job and a customer was charged without an order. SIGTERM, a grace period that was too short, and the job that must be…