-
Notifications
You must be signed in to change notification settings - Fork 662
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
Support for cloudflare workers #1335
Comments
@roopakv - Thanks for writing in with this suggestion and for your interest in working on this! It's kicked up a healthy discussion amongst the maintainers, and I will let others (@filmaj @seratch @stevengill) chime in with their input as well. In general, the team isn't planning on working on enhancing of the web-api package to enable developers to use a different HTTP client, however we would be happy to work with you to review this if it's something you're interested in working on. [Edit] Or if you're thinking of creating your own solution to cover your use case and you make your work public, we are happy to share the repo out with the developer communities. |
@srajiang if i were to send PRs up moving from axios to something else would your team be open to reviewing and getting it in? If not I would probably look into making my own solution based off of a fork of this repo :) |
Hey @roopakv, If you want to attempt to replace axios, please feel free, though I have a feeling it is a big effort. There are many critical aspects of this package to the variety of different Slack customers, so all the various options (like proxying, file uploading, rate limit handling, request concurrency, custom TLS configurations, custom API URL) would have to be honoured and the test suites would need to pass. The If you do attempt to take this on, may I suggest you begin working in your fork on a branch, and before sending a PR to us, you ping us (in this issue is fine) to let us know when you think it is in a workable state before opening a PR? This way I can provide some feedback before we go through a full review and back and forth process. |
BTW, in case this is helpful, I was able to get an ES Modules-based version of Roughly:
Some more specifics on how a deno-compatible build was compiled: Esbuild command:
Some
The
The
NB: could probably use the same shim-in-deno-compatibility-node-modules approach for |
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. |
👍 on removing axios and replacing it with fetch (most preferable the new global built in fetch from node v18) so it dose not have any dependencies And then also ditching if ppl can't update to node v18 then i think they could add a polyfill themself maybe add: "engines": {
"node": ">=18.0.0"
} |
Judging by this ticket, looks like Slack API is not supported on Cloudflare Workers. Here's the error I get:
|
Actually, I just spotted this in the error message!
After adding this, the dev server starts, but then as expected, I get the error from the
Possibly useful: https://stackoverflow.com/a/70206333/47775
|
👋 I understand that many of you would like to have a 1st party / official SDK for Cloudflare Workers. However, the current SDK only supports Node.js, and our team has no plans to enhance it to support other types of runtimes, such as non-Node.js edge functions at this moment. Recently, I began a hobby weekend project, a tool for Cloudflare and Vercel. If you’re open to using an unofficial library, my project could be useful for you. For more details, please refer to #1603 (comment) |
Add Sentry logging for /donation/* Cloudflare Pages functions routes. At the time of writing, neither [bugsnag](bugsnag/bugsnag-js#637) nor [slack](slackapi/node-slack-sdk#1335) have official Cloudflare worker integrations. Given the criticality of these routes, I favoured reliability and introduced a new logging app which has official Cloudflare support: https://developers.cloudflare.com/pages/functions/plugins/sentry/ We should switch to bugsnag whenever official support is available. Testing: - (ENV and SENTRY_DSN secrets are already defined for the preview environment in Cloudflare's "owid" project) - temporarily disable the [Cloudflare Access rule](https://one.dash.cloudflare.com/078fcdfed9955087315dd86792e71a7e/access/apps/edit/d8c658c3-fd20-477e-ac20-e7ed7fd656de?tab=overview) by setting its subdomain to `temp` - send an empty JSON to https://donate.owid.pages.dev/donation/donate -> an error is logged in sentry and an alert email is sent to [TBD]@ourworldindata.org (this will be configured when the use of Sentry is confirmed). Slack integration is only available on paid plans.
With @seratch providing an alternative project, going to close this issue, as web-api has no plans to officially support a runtime beyond node. |
Description
the web-api npm package is not usable on Cloudflare workers since it uses axios. If this SDK were to consider using something like isomorphic-fetch, one could use this package in workers too.
I am happy to make a contribution but want input before I start working on this
What type of issue is this?
Requirements
Packages:
Select all that apply:
@slack/web-api
@slack/events-api
@slack/interactive-messages
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
The text was updated successfully, but these errors were encountered: