Build form_data from field names only (remove id-based form fields)
MA
1d ago+167+167+012345678901234567890123456789-439-439-012345678901234567890123456789
Follows reflex-dev/reflex#7386 (merged), which deprecates id-based form fields in 0.10.1. This PR removes them for 0.11.0.
Breaking changes
- Form data comes only from each control's
name. The submit handler no longer reads the values of controls with anidfrom their refs. Anidno longer adds a field, and no longer replaces the value submitted under an equalname. Before, a control with both was submitted twice. name[]fields reachdicthandlers as lists. Adict(or unannotated) handler now receives the values of a field such as a two-thumb slider'srange[]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_varsoverride, and thegetRefValue/getRefValuesimports. Thestate.jshelpers stay, because published reflex-components-core releases still import them (#7391 tracks removing them before 1.0).- The
_get_all_refs/_form_control_sourcedelegation 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
idbut nonamestays, as a plain warning that their value is not submitted. - Root
reflexnow requiresreflex-components-core >= 0.10.1.dev0. Without the memo delegation, a core that still collects id refs would silently miss id fields inside memoized subtrees.
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 a reflex-components-core release containing #7386 but not 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. No such release exists yet.
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?
🤖 Generated with Claude Code