FixTweet / FxTwitter

Fix broken Twitter/X embeds! Use multiple images, videos, polls, translations and more on Discord, Telegram and others
https://fxtwitter.com
MIT License
2.62k stars 77 forks source link

Use Hono as a router for regex #451

Closed ryoppippi closed 11 months ago

ryoppippi commented 12 months ago

https://github.com/FixTweet/FixTweet/blob/main/src/worker.ts#L438-L455

Hono solves this TODO! https://hono.dev/api/routing#regexp

dangeredwolf commented 12 months ago

I actually had planned on migrating to Hono but kept putting it off as I've been dealing with other issues affecting the project <.<

Unfinished branch from May: https://github.com/FixTweet/FixTweet/tree/honojs

ryoppippi commented 12 months ago

I will make a PR based on the latest main branch

ryoppippi commented 11 months ago

I'm working on, but rewriting to hono is so huge

dangeredwolf commented 11 months ago

Yeah, you can probably see why I've been putting it off tbh <.<

dangeredwolf commented 11 months ago

I really need to organize and split up parts of worker.ts because it feels overgrown at this point. I also want to add domain-specific routing to make stuff easier to deal with between API and domain (and other future uses). I don't know how much of this I want to do myself right now to avoid trampling on your Hono work

ryoppippi commented 11 months ago

As I was working on the implementation of Hono, it occurred to me too that it would be better to split the WORKER. I think it is better to separate the part that interacts with the user and the part that interacts with twitter. If you have a suggestion, I'll stop working on it for now.

ryoppippi commented 11 months ago

FYI, hono rpc is very good for combining more than 2 workers https://hono.dev/guides/rpc

dangeredwolf commented 11 months ago

Working on Hono rewrite, mostly finished with the core logic itself, still needs unit test rework: #479

ryoppippi commented 11 months ago

Nice work! I stop my work.

ryoppippi commented 11 months ago

I'll create some pr for that maybe