feat: Bolt version 5#2940
Draft
WilliamBergamin wants to merge 9 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: 397b7d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 #2940 +/- ##
==========================================
- Coverage 94.38% 94.20% -0.19%
==========================================
Files 44 42 -2
Lines 7857 7295 -562
Branches 699 668 -31
==========================================
- Hits 7416 6872 -544
+ Misses 435 417 -18
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 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
Bolt v5 completes the Node Slack SDK's transition from axios to the native Fetch API, removes the long-deprecated Workflow Steps feature, improves error handling with proper
Errorsubclasses, and raises the minimum Node.js version to 20.Release candidate:
@slack/bolt@5.0.0Why a new major?
axiosremoved from the dependency treeagent,clientTlsoptions no longer exist;respond()returns nativeResponseWorkflowStep,app.step(), and all related types deleted@slack/*dependencies bumped to next majorsweb-apiv8,socket-modev3,oauthv4,loggerv5,typesv3Breaking Changes
1. Minimum Node.js version → 20
"engines": { - "node": ">=18", + "node": ">=20", }Action: Upgrade your runtime to Node.js 20+ before upgrading Bolt.
2.
agentandclientTlsoptions removed fromAppOptionsThese axios-era options no longer exist. For proxy/TLS configuration:
NODE_USE_ENV_PROXY=1andHTTPS_PROXYenv vars, or callhttp.setGlobalProxyFromEnv()at startupfetchviaclientOptions.fetchExample: undici ProxyAgent
3.
SocketModeReceiver:dispatcherreplaces proxy agentsSocket Mode now accepts a
dispatcheroption for unified proxy/TLS on both the WebSocket connection and HTTP API calls.Example: Socket Mode with proxy
4.
WorkflowStepremoved entirelyWorkflowStep,app.step(),WorkflowStepEdit, and all related types/error codes have been deleted. Slack retired Steps from Apps in September 2024. Useapp.function()with custom functions instead.5.
respond()returns nativeResponserespond()now returnsPromise<Response>(Fetch API) instead ofPromise<AxiosResponse>. If you inspect the return value:const result = await respond('Done!'); -console.log(result.data); // AxiosResponse.data +console.log(await result.text()); // Fetch Response bodyIf you only call
await respond(...)without reading the return value (the common case), no changes needed.6. Upgraded
@slack/*dependencies@slack/web-api@slack/socket-mode@slack/oauth@slack/logger@slack/typesKey inherited changes:
@slack/web-apiv8 removesagent,tls,requestInterceptor,adapterfromWebClientOptions@slack/web-apiv8 errors are properErrorsubclasses withinstanceofsupport@slack/socket-modev3 replaces thewslibrary with undici's native WebSocket7. Improved error handling
Errors thrown by the internal
WebClientare now properErrorsubclasses.instanceofchecks work correctly and TypeScript narrows types:Migration Checklist
For most apps that don't use proxy configuration, Workflow Steps, or inspect
respond()return values, this upgrade is a version bump and done:npm install @slack/bolt@5.0.0agent/clientTlsfromAppconstructor if present — replace withclientOptions.fetchor env-based proxyWorkflowStepcode if any — migrate toapp.function()with custom functionsrespond()return handling if you readresult.dataorresult.headers— use Fetch Response methods insteaderror.code === 'slack_webapi_platform_error'string checks withinstanceofchecks@slack/*imports — if you import from@slack/web-apior@slack/socket-modedirectly, review their respective migration guidesIncluded PRs
chore: drop support for node 18chore: remove deprecated workflow steps referencesfeat: remove references to axios in favor of fetchfeat: improve error handlingchore: update biome configurations and applied settings