anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes

Home Page:https://github-readme-stats.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Cloudflare workers deployment

harryzcy opened this issue · comments

Is your feature request related to a problem? Please describe.

Vercel has cold start issues once there's not request for a while. Cloudflare workers shouldn't have this problem.

Describe the solution you'd like

Support deploying to Cloudflare workers.

Describe alternatives you've considered

No response

Additional context

No response

Hey, @harryzcy! Thanks for your feature request! I'm okay with adding cloudflare workers deployment as not officially supported way for using github-readme-stats. Feel free to implement this and open pull request. There is only one condition that your solution should not increase maintanance efforts of our small team on an ongoing basis. Let's also wait for other maintainers input.

@qwerty541 Thanks for the reply. I have implemented it here: #3442.
The major change is that Cloudflare pass in environment variables to the handlers, rather than populating process.env, so I did some refactoring to support that.

@harryzcy Sadly, I think #3442 contains too many changes to merge into the main branch without increasing maintainer effort. We can keep it open as a reference if people want to deploy to Cloudflare and close #3433. @qwerty541, what do you think?

Agree, if we are not even deploying to cloudflare actively, it becomes a maintenance burden for us to maintain this code, we can just add this PR as a example or if @harryzcy wants to deploy on cloudflare he can fork the repo and deploy as per his needs.

@harryzcy Sadly, I think #3442 contains too many changes to merge into the main branch without increasing maintainer effort. We can keep it open as a reference if people want to deploy to Cloudflare and close #3433. @qwerty541, what do you think?

@rickstaa @harryzcy @anuraghazra I just checked the pull request. This major change through all codebase about passing environment variables to the handler instead of using process.env is exactly what is said about increasing maintanence efforts, since if we merge this we need to take into account this difference during development of any feature in future. May be we can review this pull request one more time if @harryzcy can rework it without changes inside src/ folder. I mean after receiving environment variables in cloudflare handler load them into process.env to avoid some code changes, but i'm not sure that it is possible to modify process.env.

After taking another try, I decide to just keep changes in my own fork instead. Cloudflare runtime uses V8 engine instead of Node.js, which can be quite different. And using process.env has some difficulties.

Thanks