Skip to content

Conversation

@o-alexandrov
Copy link
Contributor

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

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: be37ff5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@ladle/react Patch
example Patch
test-addons Patch
test-babel Patch
test-config Patch
test-config-ts Patch
test-css Patch
test-decorators Patch
test-playwright Patch
test-programmatic Patch
test-provider Patch
test-baseweb Patch
test-msw Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another 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
Contributor 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.

@o-alexandrov
Copy link
Contributor Author

@tajo could you please review this PR?

@tajo tajo merged commit f9ad46e into tajo:main Nov 4, 2025
2 checks passed
@tajo tajo mentioned this pull request Nov 4, 2025
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.

2 participants