FastAPI 0.139.0 is now available, bringing a key feature for frontend development and a sweeping update to its internationalization (i18n) coverage. This release focuses on making frontend endpoints more flexible and ensuring the documentation stays current for a global audience.
Key changes in this release:
- Dependencies in
app.frontend()— The core feature: you can now add dependencies to frontend routes defined viaapp.frontend(). For example, you can implement automatic cookie-based authentication for the frontend by passing a dependency that checks cookies. This enables cleaner separation of concerns and reusable authentication logic for static or templated responses. PR #15908 by @tiangolo. - Translation updates — The project updated translations for 16 languages:
fr,ja,zh-hant,de,es,tr,pt,zh,uk,ko,ru. Additionally, missing translations were added forko,es, andzh-hant. These updates ensure that non-English developers have access to the most current documentation and examples. Relevant PRs: #15897, #15895, #15896, #15899, #15892, #15891, #15893, #15898, #15900, #15890, #15894, #15888, #15880, #15889.
Why this matters: The dependency injection support for app.frontend() unlocks more robust patterns for full-stack applications built with FastAPI, allowing developers to share authentication, session validation, or other logic between API routes and frontend pages without duplication. Meanwhile, the extensive translation refresh demonstrates FastAPI's commitment to accessibility, lowering the barrier for developers worldwide. If you serve any kind of frontend from FastAPI, upgrading to 0.139.0 is a no-brainer.
Source: https://github.com/fastapi/fastapi/releases/tag/0.139.0