Skip to content

Conversation

o-alexandrov
Copy link

Replace koa-connect with custom middleware adapter

Motivation

  • koa-connect is last updated 5yrs ago
    • ladle doesn't work because of koa-connect when running using tsx
  • Reduce dependencies: One less external package
  • Simplicity: The required functionality is straightforward and can be implemented in ~10 lines of code
  • Better documentation: Custom implementation includes comprehensive inline documentation

Changes

  • ✨ Added lib/cli/vite-plugin/connect-to-koa.js - Custom middleware adapter with detailed JSDoc documentation
  • 🔄 Updated lib/cli/vite-dev.js - Replaced koa-connect import with custom connectToKoa function
  • ➖ Removed koa-connect from package.json dependencies

Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 99edf81

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@o-alexandrov o-alexandrov force-pushed the modernize-koa-connect branch 2 times, most recently from c4f6e34 to c49c0db Compare October 6, 2025 04:43
Remove the koa-connect dependency in favor of a lightweight custom implementation. The new connectToKoa adapter provides the same functionality for bridging Vite's Connect-style middleware to Koa, with comprehensive documentation and support for Vite 4.x-7.x.
@o-alexandrov o-alexandrov force-pushed the modernize-koa-connect branch from c49c0db to 99edf81 Compare October 6, 2025 13:52
@o-alexandrov
Copy link
Author

@tajo this PR is ready for review, when it'd be convenient for you.
there are ~10 code line changes, everything else is comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant