vercel / micro

Asynchronous HTTP microservices
MIT License
10.59k stars 459 forks source link

npm package is out of date #455

Closed jameshfisher closed 2 years ago

jameshfisher commented 2 years ago

The latest npm package is 9.3.4. It seems to have no TypeScript declarations. However, there are TypeScript declarations on the master branch, committed almost 3 years ago.

jameshfisher commented 2 years ago

Is the recommendation to use @types/micro instead? It says it's for v7, so two major versions old.

jameshfisher commented 2 years ago

(n.b.: I'm only reluctantly using this package because NextJS has no convenient way to get the request body as a buffer)

Bessonov commented 2 years ago

@jameshfisher you can use 9.3.5-canary.3.

@leerob is there a plan to release 9.4.0?

leerob commented 2 years ago

@jameshfisher FYI https://github.com/vercel/next.js/discussions/27702#discussioncomment-2929911

jameshfisher commented 2 years ago

Thanks @leerob, that's much nicer! 😍

Bessonov commented 2 years ago

@jameshfisher FYI vercel/next.js#27702 (comment)

If I understand this correctly, then the one caution about this is that you can consume the body only once. Micro uses a WeakMap for caching for this reason.

leerob commented 2 years ago

Closing as this is addressed 🙏

tonyxiao commented 2 years ago

It's not address given that the types aren't released just yet. What's blocking the 9.4.0 release?

Bessonov commented 2 years ago

Still not released, see Versions: https://www.npmjs.com/package/micro .

leerob commented 2 years ago

Done: https://github.com/vercel/micro/releases/tag/9.4.0