Skip to content

Releases: hoangvvo/next-connect

v1.0.0-next.4

04 May 11:52
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-next.3...v1.0.0-next.4

v1.0.0

04 May 12:06
Compare
Choose a tag to compare

Published v1

v1.0.0-next.3

23 Jul 10:35
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-next.2...v1.0.0-next.3

v1.0.0-next.2

06 Jul 13:38
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-next.1...v1.0.0-next.2

v1.0.0-next.1

06 Jul 08:24
77ad0e1
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-next.0...v1.0.0-next.1

v1.0.0-next.0

06 Jul 04:26
Compare
Choose a tag to compare

This is the rewrite of next-connect. Most APIs may not be backward-compatible.

  • breaking: Drop built-in support for Express.js middleware. You can always create a tiny wrapper function to maintain this functionality. https://github.com/hoangvvo/next-connect#expressjs-compatibility
    • Remove next(err) pattern
  • improvement More straight-forward implementation and avoid patchy solutions. Now the handler will resolve based on pure promise resolution. One should expect a boost in perf as well.
  • feature Async middleware paradigm like Koa
router
  .use(async (req, res, next) => {
    const start = Date.now();
    await next(); // call next in chain
    const end = Date.now();
    console.log(`Request took ${end - start}ms`);
  })
  .use(authy)
  .use(databasey)
  .get(getty)
  .post(posty)
  • feature Forward returned values from handlers
router
  .use(async (req, res, next) => {
    return (await next()) + 1;
  })
  .use(async () => {
    return (await next()) + 2;
  })
  .use(async () => {
    return 3;
  });
console.log(await router.run(req, res));
// The above will print "6"
  • breaking Move to named export to avoid some issues with bundler. We also have full support for ESM/CJS
  • improvement Rewritten in TypeScript
  • fix in handler(), if there is no matching .method() (even if there are matchign .use()`, nothing should be executed.
  • fix onError should also be triggered when throwing in onNoMatch

v0.12.1

07 Feb 18:58
Compare
Choose a tag to compare
  • breaking: flow change: handle() does not use onError (ad857be)
  • fix: make sure handler is resolvable (#178)

v0.11.0

19 Oct 04:29
Compare
Choose a tag to compare
  • Allow regular expressions to be used for route. (#157)

v0.10.2

04 Aug 15:36
Compare
Choose a tag to compare
  • Export the options interface (#152)

v0.10.1

16 Mar 15:22
Compare
Choose a tag to compare
  • Make NextConnect compatible with NextApiHandler (#128)
  • docs(README): fix typo (#123)
  • Mark sideEffects false and update README (21c9c73)