feat!: migrate from axios to fetch (v8)#2591
Conversation
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v8 #2591 +/- ##
=====================================
Coverage ? 87.20%
=====================================
Files ? 62
Lines ? 10261
Branches ? 417
=====================================
Hits ? 8948
Misses ? 1288
Partials ? 25
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
These changes migrates this project
axiosto the native Fetch API — a major step toward v8.What changed
@slack/web-api— Removedaxios,form-data,is-electron, andis-stream. HTTP requests now useglobalThis.fetch(or a user-suppliedfetchfunction). The public API surface is simpler: a singlefetchoption replacesagent,tls,requestInterceptor, andadapter.@slack/webhook— Same migration:axiosremoved, replaced with nativefetch.@slack/socket-mode— Replaced thewsWebSocket library withundici's spec-compliant WHATWGWebSocket. A newdispatcheroption enables proxy and custom TLS configuration.undiciis declared as a peer dependency.Breaking changes
agent(http/https Agent)fetchoption with a custom dispatchertls(pfx, cert, ca, etc.)fetchoption with custom TLS configrequestInterceptorfetchfunctionadapterfetchattachOriginalToWebAPIRequestErrorhttpAgent(socket-mode)dispatcheroption (undiciDispatcher)WebAPIHTTPError.headerstype changed fromIncomingHttpHeaderstoRecord<string, string>Proxy configuration examples
Web API — proxy via custom
fetchSocket Mode — proxy via
dispatcherSocket Mode — separate proxy for HTTP vs WebSocket
Webhook — proxy via custom
fetchCustom
fetch— override for testing or instrumentationTesting
web-api,webhook,socket-mode)prod-server-integration-tests/)bolt-js#test-bolt-with-sdk-v8bolt-js-starter-template) works as expected with these changesfetchoverride, and advanced transport scenarios validated via dedicated test project:WilliamBergamin/test-slack-node-sdk-8Requirements