Build form_data from field names only (remove id-based form fields)

Merged
MA
4d ago
+248-507

Follows reflex-dev/reflex#7386 (merged), which deprecates id-based form fields in 0.10.1. This PR removes them for 0.12.0.

Breaking changes

  • Form data comes only from each control's name. The submit handler no longer reads the values of controls with an id from their refs. An id no longer adds a field, and no longer replaces the value submitted under an equal name. Before, a control with both was submitted twice.
  • name[] fields reach dict handlers as lists. A dict (or unannotated) handler now receives the values of a field such as a two-thumb slider's range[] as a list, not just the last value.

Other changes

  • Remove the machinery that existed only to feed id refs:
    • Form._get_form_refs, its _get_vars override, and the getRefValue/getRefValues imports. The state.js helpers stay, because published reflex-components-core releases still import them (#7391 tracks removing them before 1.0).
    • The _get_all_refs / _form_control_source delegation on auto-memo passthrough bodies and page wrappers.
    • The redundant children swap in passthrough memo compilation.
    • The id-ref argument of getFormData.
  • TypedDict submit validation now matches only static names.
  • The compile-time warning about controls with a static id but no name stays, as a plain warning that their value is not submitted.
  • Root reflex needs a reflex-components-core that no longer collects id refs: without the memo delegation, such a core would silently miss id fields inside memoized subtrees. Main's floor, reflex-components-core >= 0.11.1.dev0, already excludes 0.10.1 and 0.11.0, the releases that carry #7386, so this PR doesn't change it.

The first commit reverts the commit of #7386 that added the deprecation path. This PR keeps that PR's deprecation fragment, which will already be in the 0.10.1 changelog when this lands.

Before merging: if reflex-components-core 0.11.1 (or any later release without this PR) is cut first, raise the root reflex floor on reflex-components-core to that release's next .dev0. Such a release still collects id refs, so it must not pair with this reflex. The latest release is 0.11.0, which the current floor already excludes.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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?

https://claude.ai/code/session_01TmumE4Q7EpbbSpvEAAoqZ6


Generated by Claude Code