Fix 0.11 changelog and database guide gaps from 0.11.0a1 QA

Merged
MA
17d ago
+84-18

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • This change requires a documentation update

Docs and changelog only. No framework code changes.

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Found in the reflex 0.11.0a1 pre-release testing (FINDING-014, -020, -024).

FINDING-024: app() no longer returns a Starlette app. Since #7624, rx.App.__call__ returns _RootMiddleware, which has no add_middleware, routes or mount. The changelog mentioned this only in the Performance entry.

  • Added news/7624.breaking.md, which points at api_transformer, the documented way to add middleware and routes. app._api is private, so the entry doesn't mention it.
  • Removed the same sentence from news/+lighter-asgi-entrypoint.performance.md so the change isn't listed twice.
  • The fragment is named after #7624 instead of +<slug>. An orphan fragment gets renamed after the PR that added it, so a + name would link the entry to this docs PR instead of the PR that made the change.

FINDING-014: admin dashboard guide (docs/database/admin-dashboard.md)

  • The guide now says the dashboard is served at /admin/. /admin without the trailing slash returns 404 behind api_transformer: starlette-admin's Mount("/admin") doesn't match it, so the request falls through to Reflex's catch-all mount. The migration note no longer says existing links keep working. It now says rx.AdminDash redirected /admin, and that links without the slash need updating.
  • Defined the MyAuthProvider the example uses: a minimal starlette-admin 1.x AuthProvider that checks one username and password from environment variables. The page still links to the starlette-admin auth guide for a real user store.
  • Added a note on MappedAsDataclass models. starlette-admin's "New" form calls self.model() with no arguments, so every constructor field needs a default or init=False. Otherwise saving the form fails with a 500 (TypeError: __init__() missing ... 'name').

FINDING-020: custom serializer in docs/database/tables.md. The example called dataclasses.asdict, which follows relationships. That raises DetachedInstanceError for a relationship the query didn't load and RecursionError for a loaded one that links back. The example now builds the dict from sqlalchemy.inspect(post).mapper.column_attrs, and a sentence explains why.

  • Extended test_tables_custom_serializer in docs/app/tests/test_database_examples.py to give Post a relationship. The test now serializes a post with and without the relationship loaded. It fails with DetachedInstanceError against the old snippet and passes with the new one.

Verification

  • Ran the guide's main example verbatim in process through TestClient against starlette-admin 1.0.3: /admin → 404, /admin/ → 303 to login, login → 303, "New" for a SQLModel model → 303. "New" for a MappedAsDataclass model fails with a 500 / TypeError as described, and with a default or init=False it gives 303.
  • docs/app: pytest tests/test_database_examples.py tests/test_doc_links.py tests/test_rendered_markdown.py tests/test_frontmatter_meta.py gave 45 passed. The sitemap link check xfails locally because it needs an exported site; CI runs it with --runxfail.
  • pre-commit run --files on the changed files passes.

Generated by Claude Code