feat: Node Slack SDK major version release candidate#2603
Draft
WilliamBergamin wants to merge 18 commits into
Draft
feat: Node Slack SDK major version release candidate#2603WilliamBergamin wants to merge 18 commits into
WilliamBergamin wants to merge 18 commits into
Conversation
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com> Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com> Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com> Co-authored-by: Ale Mercado <104795114+srtaalej@users.noreply.github.com>
🦋 Changeset detectedLatest commit: b4db796 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2603 +/- ##
==========================================
+ Coverage 88.86% 88.99% +0.12%
==========================================
Files 62 62
Lines 10230 10085 -145
Branches 450 460 +10
==========================================
- Hits 9091 8975 -116
+ Misses 1117 1086 -31
- Partials 22 24 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the major release of the Node Slack SDK. The headline changes: axios is gone,
wsis gone, and the SDK now runs on web-standard APIs (fetch,WebSocket) that work across runtimes.Why this release exists
globalThis.fetch, the SDK no longer carries a third-party HTTP client as an attack surface.axios,form-data,is-electron,is-stream,ws,@types/ws. Smaller install, fewer supply-chain risks.Errorsubclasses withinstanceofsupport, not duck-typed interfaces with factory functions.Minimum requirements
fetch,FormData, andWebSocketare stable)es2017toes2022Package Changes
@slack/web-api(v7 → v8)The biggest change in the SDK. Replaces axios with
globalThis.fetch.Breaking changes
agentoption removedNODE_USE_ENV_PROXY=1/http.setGlobalProxyFromEnv(), or pass a customfetchwith an undici dispatchertlsoption andTLSOptionsexport removedfetchwith an undiciAgentdispatcherrequestInterceptorandRequestInterceptortype removedfetchfunction insteadadapterandAdapterConfigtype removedfetchfunction insteadRequestConfigtype removedInternalAxiosRequestConfig— no longer neededattachOriginalToWebAPIRequestErroroption removedfiles.upload,rtm.start,workflows.stepCompleted,workflows.stepFailed,workflows.updateStepErrorsubclasses;instanceofworks;error.namevalues are descriptiveWebAPIHTTPError.headerstype changedRecord<string, string>instead ofIncomingHttpHeadersWebAPIRequestErrorusesError.causecauseproperty populated alongsideoriginalfor backward compatNew features
fetchoption: pass any function matchingglobalThis.fetch's signature for full transport control (proxies, TLS, instrumentation, testing)FetchFunctiontype export: TypeScript type for custom fetch implementationsSlackErrorabstract base class: catch all SDK errors with a singleinstanceof SlackErrorcheckError class hierarchy
Dependencies removed
axiosform-datais-electronis-stream@slack/socket-mode(v2 → v3)Replaces the
wslibrary withundici's spec-compliant WebSocket implementation.Breaking changes
httpAgentoption removedNODE_USE_ENV_PROXY=1/http.setGlobalProxyFromEnv(), or use the newdispatcheroption@slack/web-api@^8clientOptionsErrorsubclasses;instanceofworksNew features
dispatcheroption: pass any undiciDispatcher(e.g.ProxyAgent) to handle both WebSocket and HTTP traffic in one placedispatcherfor WebSocket +clientOptions.fetchfor HTTP when you need different proxy routingSocketModeDispatcherinterface: structural type for dispatcher compatibility across undici versionsError classes
SMWebsocketErrorSMPlatformErrorSMNoReplyReceivedErrorSMSendWhileDisconnectedErrorSMSendWhileNotReadyErrorDependencies removed
ws@types/ws@slack/webhook(v7 → v8)Drops axios in favor of
globalThis.fetch. Minimal API surface, so the migration is straightforward.Breaking changes
agentoption removedfetchwith an undici dispatcherIncomingWebhookHTTPErrornow hasstatusCode,statusMessage,bodydirectly (no moreerror.original.response)IncomingWebhookRequestError.originalis now a standardErrorAxiosErrorin v7New features
fetchoption: custom fetch for transport controlFetchFunctiontype exportSlackWebhookErrorabstract base class: catch all webhook errors withinstanceof SlackWebhookErrorDependencies removed
axios@slack/oauth(v3 → v4)@slack/web-api@^8and@slack/logger@^5No functional API changes — this is a dependency-bump major version.
@slack/logger(v4 → v5)No functional API changes — semver major for the engine constraint.
@slack/types(v2 → v3)No functional API changes — semver major for the engine constraint.
@slack/cli-hooks(v1 → v2)No functional API changes.
@slack/cli-test(v3 → v4)No functional API changes.
Infrastructure changes
tsconfigtarget raised fromes2017toes2022Migration guides
Coming soon...
TL;DR for most users
If you're not using proxies, custom agents, or
requestInterceptor:Your code likely works unchanged. The SDK now uses
globalThis.fetchunder the hood.If you are using proxies, the simplest migration is:
No code changes needed, Node.js routes all fetch/WebSocket traffic through the proxy automatically.
Related PRs