version 1.16.0
New Features
ASGI Adapter
Since this version, a new adapter that implements the ASGI standard is available. The novel adapter brings the following benefits to developers:
- A builtin way to deploy HTTP apps to production using the ASGI standard
- Allow bolt to be deployed on a web servers such as daphne, uvicorn and hypercorn without other dependencies
- A way to create small, lightweight and efficient docker images for bolt python
The adapter is compatible with both App and AsyncApp. You can run both of the following app code by running uvicorn app:api --reload --port 3000 --log-level debug:
from slack_bolt import App
from slack_bolt.adapter.asgi import SlackRequestHandler
app = App()
@app.event("app_mention")
def handle_app_mentions(say):
say("What's up?")
api = SlackRequestHandler(app)Here is an asyncio-based app:
from slack_bolt.async_app import AsyncApp
from slack_bolt.adapter.asgi.async_handler import AsyncSlackRequestHandler
app = AsyncApp()
@app.event("app_mention")
async def handle_app_mentions(say):
await say("What's up?")
api = AsyncSlackRequestHandler(app)To learn more on the implementation and grab more code examples, please check @WilliamBergamin's pull request adding the feature: #780
Changes
- #780 Add ASGI adapter - Thanks @WilliamBergamin
Document / Project Updates
- #779 Fixing link to message event subtypes docs - Thanks @filmaj
- #776 CI python 3.6 bug fix - Thanks @WilliamBergamin
- #770 Fix #757 by using Falcon 3.1.1 - Thanks @seratch
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/65?closed=1
- All Diff: v1.15.5...v1.16.0