Nebula - 3.0.0
Nebula 3.0.0 Release Notes
Nebula 3.0.0 is a major update that transitions the framework from WSGI to ASGI, bringing native async support and a more modern architecture.
Highlights
-
Full migration to ASGI
-
Nebula no longer depends on eventlet or werkzeug
-
Built for modern async Python
-
Native async support
-
Route handlers now support async def
-
Better performance and scalability
-
New development runner
-
Introduced run_dev() for quick local development
-
No need for external WSGI servers like Gunicorn
-
Simplified API
-
Cleaner routing
-
More intuitive request handling
Breaking Changes
-
WSGI removed
-
app.wsgi_app is no longer available
-
Gunicorn + eventlet setup is no longer supported
-
Routes are now async-first
-
Handlers can use async def
-
request object is now passed to route functions
-
Routing signature simplified
-
endpoint argument is no longer required in most cases
Migration Guide
Before (WSGI)
# tiny.py
from nebula import Nebula
from nebula.utils import htmlify
app = Nebula(__file__, "localhost", 8000)
@app.route("/", endpoint="main")
def root() -> None:
return htmlify("<h1>Welcome to Nebula!</h1>")
main = app.wsgi_app # gunicorn -w 1 -k eventlet tiny:mainAfter (ASGI)
from nebula import Nebula, run_dev
from nebula.utils import htmlify
app = Nebula(__file__, "localhost", 8000)
@app.route("/")
async def root(request) -> None:
return htmlify("<h1>Welcome to Nebula!</h1>")
run_dev(app)What This Means
- More aligned with modern Python frameworks
- Ready for high-performance async workloads
- Easier to use for modern web development
Final Notes
This is a breaking release, but it sets the foundation for future features and performance improvements.
If you were using Nebula before, migrating is straightforward and worth it for the async benefits.