Make Granian the default backend and Uvicorn/Gunicorn explicit opt-in

Open
#6,820 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Locate the backend-selection logic, the REFLEX_USE_GRANIAN default and documentation, and the Uvicorn fallback warning. Read the existing backend tests first, then add coverage for each selection-matrix row, update user-facing documentation and the news fragment, and confirm whether the change belongs in 0.9.x or 0.10.0.

Written by the indexing model from the issue text.

Description

Context

Reflex was intended to default to Granian in 0.9, but the current automatic selection still chooses the Uvicorn/Gunicorn backend when both packages are importable and REFLEX_USE_GRANIAN is unset. This is especially visible in upgraded environments that retain the old backend dependencies.

PR #6758 only updates the resulting warning. The underlying selection behavior should be fixed instead.

Proposed behavior

  1. Default REFLEX_USE_GRANIAN to True.
  2. Use Granian when REFLEX_USE_GRANIAN is unset or true, regardless of whether Uvicorn/Gunicorn happen to be installed.
  3. Use the Uvicorn/Gunicorn backend only when REFLEX_USE_GRANIAN=0 and its required packages are installed.
  4. Remove the Uvicorn fallback warning because that backend becomes fully opt-in.

Expected selection matrix

REFLEX_USE_GRANIAN Result
Unset Granian
1 / true Granian
0 / false, Uvicorn/Gunicorn available Uvicorn/Gunicorn
0 / false, required packages missing Define and test an actionable failure or fallback behavior

Acceptance criteria

  • Update backend-selection logic and the environment-variable default/documentation.
  • Remove the obsolete Uvicorn fallback warning.
  • Add unit coverage for every row in the selection matrix.
  • Update user-facing documentation and add the appropriate news fragment.
  • Confirm whether this ships in the next 0.9.x release or requires 0.10.0 before implementation.

Supersedes #6758.

Dominant language
Python
Stars
28.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
173

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reflex-dev/reflex

All issues in reflex-dev/reflex

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.