Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

htmx essays 7 min read Opinion easyNovice

Vendoring

Vendoring, copying a dependency's source directly into your repository, gives full dependency visibility, debuggability, auditable code and builds that don't resolve packages at deploy time. Its real weakness is the transitive dependency problem, but that friction usefully discourages large dependency graphs. htmx shows the cost of the alternative: 16 declared npm dev dependencies balloon to 411 packages and a 110 MB node_modules, including an unwanted polyfill that threatens IE compatibility. The essay argues for fewer dependencies, vendor-friendly zero-dependency libraries, and vendor-first dependency managers that handle transitive deps, updates and local modifications.

Related posts

  • Dependency prefixes are a supply chain risk: let's fix them

    Sourcegraph mediumAdept

    SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install. The recommended controls are to commit lockfiles and install with npm ci, pnpm --frozen-lockfile or yarn --immutable, pin exact versions for high-blast-radius packages such as build tools, auth libraries and native-binding deps, set save-exact defaults, disable install scripts with an allowlist for exceptions, and run audits against the locked tree. To roll this out across hundreds of repositories, a Sourcegraph Batch Changes spec with a Node script rewrites React dependency ranges to approved exact versions and refreshes lockfiles without running scripts.

  • If you're not using npm specifiers, you're doing it wrong

    Deno mediumAdept

    Deno now recommends importing npm packages with native `npm:` specifiers instead of HTTP transpile services like esm.sh or unpkg. Those services lack semver-aware deduplication, so duplicate copies of React can load, and they can't run install hooks for native add-ons or serve bundled data files. Native `npm:` imports resolve versions properly and need no node_modules or package.json, since packages go to a global cache. They also work in Jupyter and the REPL, fall under Deno's permission model with opt-in `--allow-scripts`, and support private registries via `.npmrc`.

  • Bun v1.2.14

    Bun mediumAdept

    Bun v1.2.14 adds dependency catalogs to `bun install`, letting monorepos define shared versions once in the root package.json and reference them with the `catalog:` protocol, which is rewritten to concrete versions on publish. The release also adds zstd decompression in fetch plus `Bun.zstdCompress`/`zstdDecompress` APIs, a `--react` flag for `bun init`, method-specific routes in `Bun.serve()`, and a default TypeScript `"module": "Preserve"` setting. Fixes include an HTTPS proxy hang affecting Codex, `worker_threads` emitting real `Error` objects instead of stringified events, and `node:http2` support for `maxSendHeaderBlockLength` and `setNextStreamID`.

  • Why We Added package.json Support to Deno

    Deno easyNovice

    Deno added package.json support because its HTTP-import module system, though decentralized and manifest-free, suffers from the Duplicate Dependency Problem, the clunky deps.ts pattern, non-composable import maps, and the limits of transpile servers like esm.sh. Bare specifiers with semver resolution solve deduplication, so Deno now runs existing Node projects while keeping safeguards such as node: prefixes, no arbitrary post-install scripts and permission enforcement. The next major release plans a deno: URL scheme with semver resolution (e.g. deno:oak@12) and encourages import maps in deno.json that mix deno: and npm: specifiers.

  • The Bun Bundler

    Bun mediumAdept

    Bun now ships a native bundler in beta, exposed as the `bun build` CLI and the `Bun.build()` JavaScript API. It shares one plugin API with the runtime, returns Blob-compatible build artifacts, can compile standalone executables, and supports browser, bun and node targets. Bundles built for the bun target carry a `// @bun` pragma so the runtime skips re-transpilation. It includes tree shaking (sideEffects, __PURE__, NODE_ENV/--define, ESM and limited CommonJS-to-ESM conversion), source maps and a new minifier, and it benchmarks at 1.75x faster than esbuild and 220x faster than Webpack on a three.js workload. Only ESM output is supported for now, and its architecture follows esbuild's design.

The quest for software engineering knowledge.

Look:
Layout: