fix: remove dead serialize_dict call in format_prop

MA
21h ago
+21-8

Requested by Masen · project thread

Before: format_prop({"a": 1}) raised AttributeError: module 'reflex_base.utils.serializers' has no attribute 'serialize_dict'. The dict branch in format_prop called a serializer that no longer exists, hidden behind a pyright-ignore.

After: a plain dict is JSON-encoded like every other literal and wrapped in braces, so format_prop({"a": 1}) returns {{"a": 1}}.

The branch was unreachable from inside the framework, since every internal caller passes a Var or EventChain and returns earlier; only direct callers with a raw dict hit it.

How: drop the isinstance(prop, dict) branch and the unused serializers import so dicts fall through to json_dumps, which already encodes nested values through the registered serializers. Adds a regression test and a reflex-base news fragment.

Closes ENG-10109.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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?

Generated by Claude Code