How to Build Framework-Agnostic Open Source Tools (The Engine-Adapter Pattern)
Look at your codebase right now. If you are building an open-source library, an SDK, or a generic backend tool, and you are importing express, next/server, or hono directly into your core business ...
Source: dev.to
Look at your codebase right now. If you are building an open-source library, an SDK, or a generic backend tool, and you are importing express, next/server, or hono directly into your core business logic... you are building a trap. I know, because I fell into it. When you tie your logic to a specific HTTP framework, you alienate 80% of the developer ecosystem. A Next.js dev can't use your Express tool. A Hono dev can't use your Fastify plugin. If you want to build tools that other developers actually adopt, you have to think like an architect, not just a coder. You need to master The Engine-Adapter Pattern. This is exactly how I built TableCraft to seamlessly support Hono, Express, Next.js, and Elysia from a single codebase. Let's break down how you can build this pattern for your next open-source project. 🛑 The Anti-Pattern: Framework Coupling Most developers start building an API library like this: // ❌ BAD: Tightly coupled to Express import { Request, Response } from 'express'; expo