website icon indicating copy to clipboard operation
website copied to clipboard

feat: bun related docs (@stonega)

Open MasedMSD opened this issue 1 year ago • 29 comments

Originally PR was created by @stonega, but it looks like he's not going to continue with this PR. So, I think we should mention Bun as a possible way to work with a bot, even though Bun has a large number of issues. Also Bun finally supports conversations plugin and a decent part of Russian language chat users use it for their projects.

I made some changes and added Bun mentions to the hosting files documentation

MasedMSD avatar Oct 01 '24 13:10 MasedMSD

🚀 Deployed on https://690dd35ebfa55ee9a3317450--grammy.netlify.app

github-actions[bot] avatar Oct 01 '24 13:10 github-actions[bot]

Should we leave index.ts or should we tell the user to create a bot.ts file each time in order for the NodeJS and Deno examples to be the same?

MasedMSD avatar Oct 02 '24 00:10 MasedMSD

I have now wasted more time on this than I ever wanted, maybe I'll get back to this in a week or so

KnorpelSenf avatar Oct 02 '24 07:10 KnorpelSenf

I'll get into this page in more detail tomorrow

MasedMSD avatar Oct 15 '24 15:10 MasedMSD

Remember to merge main in order to fix CI

KnorpelSenf avatar Oct 15 '24 15:10 KnorpelSenf

Scratch that, it already happened

KnorpelSenf avatar Oct 15 '24 15:10 KnorpelSenf

I even did it myself *facepalm*

KnorpelSenf avatar Oct 15 '24 15:10 KnorpelSenf

Unfortunately we can't fix it. We will have to ask the user to change it manually every time. But I don't understand the point of this, because everything works with the current tsconfig O.O

MasedMSD avatar Oct 16 '24 11:10 MasedMSD

Yeah but I don't want to go through all the code examples and make sure that they compile even with the non-standard TS config that bun introduces. It can be fixed very easily by running tsc --init in the getting started guide.

KnorpelSenf avatar Oct 16 '24 11:10 KnorpelSenf

@KnorpelSenf : Yeah but I don't want to go through all the code examples and make sure that they compile even with the non-standard TS config that bun introduces. It can be fixed very easily by running tsc --init in the getting started guide.

@MasedMSD: But I don't understand the point of this, because everything works with the current tsconfig O.O

I am agree with @MasedMSD. I don't see any problem with the default generated tsconfig.json. Pretty sure it works well with our examples.

quadratz avatar Nov 05 '24 23:11 quadratz

@KnorpelSenf : Yeah but I don't want to go through all the code examples and make sure that they compile even with the non-standard TS config that bun introduces. It can be fixed very easily by running tsc --init in the getting started guide.

@MasedMSD: But I don't understand the point of this, because everything works with the current tsconfig O.O

I am agree with @MasedMSD. I don't see any problem with the default generated tsconfig.json. Pretty sure it works well with our examples.

Then please go through them and verify this. Also, please test all future changes to the docs for bun compatibility. I don't care what the config file contains, I just won't double the time I spend on code examples just to make a few bun users happy.

KnorpelSenf avatar Nov 06 '24 08:11 KnorpelSenf

Fine, so we going to use this solution?

MasedMSD avatar Nov 06 '24 16:11 MasedMSD

Only as soon as we find somebody who actually puts in the work and makes sure that the code examples work. I don't want to merge docs that don't type-check because then I'm gonna be the one who has to deal with all the complaints.

If somebody is willing to

  • make sure that the current docs type-check, and
  • make sure that all future docs type-check

then we can ship docs that use a new TS config setup.

KnorpelSenf avatar Nov 06 '24 19:11 KnorpelSenf

@KnorpelSenf It would be useful to create some package for easy unit testing of the bot. I don't think that's possible given the flood handling by telegram

MasedMSD avatar Nov 06 '24 19:11 MasedMSD

Is that in any way related to the current pull request?

KnorpelSenf avatar Nov 06 '24 19:11 KnorpelSenf

I mean that we should have some kind of tests to make sure that the bot and the code work. For example, as for the situation now, when we can't be sure that bun will pass all type-checks

MasedMSD avatar Nov 06 '24 19:11 MasedMSD

That's why you have to test it, or adjust the TS config. But I'm beginning to repeat myself a little

KnorpelSenf avatar Nov 06 '24 19:11 KnorpelSenf

I mean that we should have some kind of tests to make sure that the bot and the code work. For example, as for the situation now, when we can't be sure that bun will pass all type-checks

It’ll be hard to write integration tests for Bun and grammY because the existing test suite is in Deno. We’d have to spend a lot of time instrumenting some Docker CI test just specifically for Bun, and I am not sure if it’s worth the effort.

winstxnhdw avatar Nov 06 '24 19:11 winstxnhdw

There's no need to actually run any tests, why do you think this? I can't follow

KnorpelSenf avatar Nov 06 '24 20:11 KnorpelSenf

@KnorpelSenf still confused. We don't gonna use this?

MasedMSD avatar Nov 20 '24 17:11 MasedMSD

I don't have strong opinions on what exactly you're gonna do. I just need you to make sure that the code examples are correct. It doesn't matter to me if you achieve this by making people use the setup that is known to work, or if you want to test all present and future code snippets against a new setup.

KnorpelSenf avatar Nov 20 '24 17:11 KnorpelSenf

What I mean is that this command generates the typescript config that we use in all the examples. I think we should add Bun, but if there are any problems (which I'm not sure about at all, Bun is quite stable) we should deal with them as they come up.

MasedMSD avatar Nov 20 '24 17:11 MasedMSD

So is there still a question? If yes then I don't understand it

KnorpelSenf avatar Nov 20 '24 17:11 KnorpelSenf

Yes. We will merge this PR into main if we leave the command to generate the config we use everywhere else? We should mention the Bun's support, because a lot of users in our community use it

MasedMSD avatar Nov 20 '24 17:11 MasedMSD

I mean, this PR has been hanging around for a long time and we need to do something about it. Either put it on hold or get on with it

MasedMSD avatar Nov 20 '24 17:11 MasedMSD

I don't care if you use the command or not and I'm not opposed to mentioning bun support

KnorpelSenf avatar Nov 20 '24 17:11 KnorpelSenf

I'm not opposed to mentioning bun support

Great, I'll take care of that PR

MasedMSD avatar Nov 20 '24 17:11 MasedMSD

I mean, this PR has been hanging around for a long time and we need to do something about it. Either put it on hold or get on with it

That's true, what was stopping you?

KnorpelSenf avatar Nov 20 '24 17:11 KnorpelSenf

I'm not opposed to mentioning bun support

Great, I'll take care of that PR

Nice

KnorpelSenf avatar Nov 20 '24 17:11 KnorpelSenf