Skip to content
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

Discussion: Refactor/Rewrite/Replace some parts of this library #855

Open
kamikazechaser opened this issue Feb 9, 2021 · 9 comments
Open

Comments

@kamikazechaser
Copy link
Collaborator

kamikazechaser commented Feb 9, 2021

This library has some deprecated libraries e.g. request. Node.js has also progressed since when the core of this library was written; It has support for native promises/Async await e.t.c.

Some of the proposals are:

  1. Replace the bloated and deprecated request library with a more light weight alternative. The current proposals include: ethanent/phin, node-fetch/node-fetch, matthew-andrews/isomorphic-fetch, sindresorhus/got .The replacement library should support most of what request supported.

  2. Potentially replace Event Emitter 3 with a better drop in replacement like mcollina/mqemitter or native Event Emitter. This needs more research.

  3. Replace bluebird with native promises/async-await.

  4. Support Node.js v12+ as per LTS schedule. Any feature/polyfill supporting < v12 should be removed.

  5. Replace pump with pipeline.

Feel free to make your own proposals.

@danielperez9430
Copy link
Collaborator

  1. Move the samples/tutorials to a secondary repository
  2. Possibility of making an interactive documentation using documentationjs

@jmaister
Copy link

jmaister commented Feb 24, 2021

Would transition to TypeScript be considered too?

I could help with that.

@varsubham
Copy link

Hey I would like to work on replacing the request library with node-fetch/node-fetch library

But the problem is what about the options.request parameter ? It is compatible with the old request library
https://github.com/request/request#requestoptions-callback

@gengjiawen
Copy link

  1. Replace the bloated and deprecated request library with a more light weight alternative. The current proposals include: ethanent/phin, node-fetch/node-fetch, matthew-andrews/isomorphic-fetch, sindresorhus/got .The replacement library should support most of what request supported.

node-gyp goes with https://github.com/npm/make-fetch-happen

@wojpawlik
Copy link
Contributor

I suggest https://github.com/telegraf/client. It's typed, and should be close to supporting https://grammy.dev/advanced/transformers.html.

@kamikazechaser
Copy link
Collaborator Author

Agree with @wojpawlik, high time this library used a lite client like telegraf/client while keeping the API consistent with the current version so that there is no barrier to entry for existing devs.

Maybe even use middleware composition instead of event emitters.

@wojpawlik
Copy link
Contributor

wojpawlik commented Sep 27, 2022

@telegraf/client was archived and is now being upstreamed into telegraf: telegraf/telegraf#1705. I suggest you to just copy and adjust it to your needs.

Related to #1007.

@wojpawlik
Copy link
Contributor

@Doc999tor
Copy link

Do you have any news about migrating this amazing package to more lightwight?

  • I have very humble needs just to send a message to a channel - maybe there are simpler and lighter alternatives? I didn't find anything well-documented and maintained like node-telegram-bot-api
  • For now the package size is ~ 600k and startup time ~300ms on my local machine (fast and modern)

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