Skip to content

Koa v3 Tracker #1837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 of 13 tasks
jonathanong opened this issue Aug 29, 2024 · 14 comments
Closed
4 of 13 tasks

Koa v3 Tracker #1837

jonathanong opened this issue Aug 29, 2024 · 14 comments

Comments

@jonathanong
Copy link
Member

jonathanong commented Aug 29, 2024

Starting a new tracker for v3

Milestone: https://github.com/koajs/koa/milestone/4

Other Breaking Changes:

Future:

  • Deno support
  • Bun support
  • Rewrite in TypeScript

Tests:

  • Migrate to jest
  • Properly close down server after each test run

Improved Documentation:

@jaydenseric
Copy link

Regarding the goal to move to Jest; please don't. Use the native Node.js test runner! It should be more than adequate.

You can pair it with coverage-node, a very lightweight CLI tool, to enforce 100% code coverage in tests:

https://github.com/jaydenseric/coverage-node

@talentlessguy
Copy link

to add, Node test runner has identical API to Jest

for assertion, node:assert could be used

@benmccann
Copy link

Vitest is another fairly lightweight option for jest-compatible test runner. My last experience was that Jest is terrible to use with ESM as it doesn't fully support it yet. vitest is much better in this regard.

A rewrite might also be a nice time to take a look at including only minimal dependencies (e.g. https://npmgraph.js.org/?q=koa vs https://npmgraph.js.org/?q=polka)

@jonathanong
Copy link
Member Author

I just realized that I already migrated it to jest a while go haha. if anyone is interested in migrating to node's official test runner, that would be great. otherwise, I will leave it as is

@sirenkovladd sirenkovladd mentioned this issue Sep 20, 2024
6 tasks
@koajs koajs deleted a comment from iietmoon Oct 20, 2024
kevinpeno pushed a commit that referenced this issue Oct 28, 2024
## Checklist
use `node --test` instead of `jest`
See: #1837 (comment)

- [X] I have ensured my pull request is not behind the main or master
branch of the original repository.
- [X] I have rebased all commits where necessary so that reviewing this
pull request can be done without having to merge it first.
- [X] I have written a commit message that passes commitlint linting.
- [X] I have ensured that my code changes pass linting tests.
- [X] I have ensured that my code changes pass unit tests.
- [X] I have described my pull request and the reasons for code changes
along with context if necessary.
@titanism titanism pinned this issue Feb 27, 2025
@titanism
Copy link
Contributor

I just pinned this issue. Also I merged a core bug fix just a bit ago at #1593 which fixes #1547 – tldr; HEAD requests with http2 server instance were broken and not working.

@titanism
Copy link
Contributor

titanism commented Feb 27, 2025

👍 to c8 https://www.npmjs.com/package/c8 and Node's native testing
👍 to using np for releases

@jonathanong
Copy link
Member Author

Just need to spend time to write a migration doc for v3 and then I am going to launch it

@jrnail23
Copy link

I know this is blasphemy these days, so at the risk of sounding like a luddite, I have to beg you, PLEASE, PLEASE don't convert Koa to ESM-Only unless you'll be actively updating/patching the v2 branch for an extended period of time (like multiple years).

Migrating existing NodeJS codebases to ESM still isn't effortless, and going to ESM-only risks leaving CJS users in a vulnerable state where they can't safely upgrade to incorporate security patches and critical bug fixes.

@talentlessguy
Copy link

talentlessguy commented Apr 18, 2025

I know this is blasphemy these days, so at the risk of sounding like a luddite, I have to beg you, PLEASE, PLEASE don't convert Koa to ESM-Only unless you'll be actively updating/patching the v2 branch for an extended period of time (like multiple years).

Migrating existing NodeJS codebases to ESM still isn't effortless, and going to ESM-only risks leaving CJS users in a vulnerable state where they can't safely upgrade to incorporate security patches and critical bug fixes.

why would you want to migrate existing codebases to a semver incompatible version of a web framework without upgrading Node.js?

starting version 20.x you can require(esm) so in case you're on that version, you can safely use Koa as ESM

@jonathanong
Copy link
Member Author

let me know if anyone contributed that I missed in the release notes https://github.com/koajs/koa/releases/tag/v3.0.0

@TechQuery
Copy link

TechQuery commented Apr 28, 2025

let me know if anyone contributed that I missed in the release notes https://github.com/koajs/koa/releases/tag/v3.0.0

@jonathanong I have a big thank for your hard working, but I'm worried about how many popular middlewares will be broken by this major upgrading, do we have a draft list in the latest migration guide?

@jonathanong
Copy link
Member Author

@TechQuery it should just be send or any middleware that serves from the filesystem due to the ENOENT removal, I will take a look later

@jonathanong
Copy link
Member Author

actually, send handles ENOENT itself. looks like tests are passing with koa@3 so we're good

@titanism
Copy link
Contributor

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

No branches or pull requests

7 participants