Add file serialization support to the `form` component / `use_form_data` hook
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start with the form component and use_form_data hook, using PR #58 and the original feature in #7 for context. Resolve whether file fields use metadata, multipart upload, or both before implementing. Done means mixed file and regular fields serialize without a reload, the behavior is tested, and documentation is updated.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Follow-up to #58 (the form component and use_form_data hook, which closed #7).
The form component's client-side interception currently serializes non-file fields only. File inputs (<input type="file">) are silently excluded because the submission handler iterates FormData entries and calls .toString() on each value, which for File objects yields [object File] and loses the file content.
The PR description for #58 explicitly deferred this:
Non-file fields only; file serialization is deferred.
Proposed scope
Support forms that contain file inputs, matching how the current behavior treats other input types. Possible options to evaluate:
- Include file metadata (name, size, type, lastModified) in the serialized form data, without uploading file content — useful for validation/UI feedback on the server.
- Defer file content upload to a separate multipart
POSTwhen the form is submitted, integrating with the router's navigation model. - Combination: send metadata for a GET-style/
pushStatenavigation while supporting an optional file payload.
Acceptance criteria
- Defining a form with one or more
<input type="file">fields does not break serialization of the other fields. - File fields are represented in the
use_form_data()output in a well-defined way (currently undocumented behavior). - No full page reload occurs on submit of a form with file inputs (consistent with #58).
- A test covers a form that mixes file inputs with regular fields.
- Documentation updated for file-field behaviour.
Related
- PR: #58
- Original feature: #7
- Vorherrschende Sprache
- Python
- Sterne
- 15
- Forks
- 9
- Ø Merge
- 9 Std. 57 Min.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
Die Einrichtungsdateien dieses Projekts haben wir noch nicht geprüft. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus reactive-python/reactpy-router
-
Create PyScript compatible routerEvtl. wieder frei @Archmonger hat das vor 709 Tagen übernommen, und es ist kein Pull Request offen. Offencomplexity: 0 (highest) priority: 1 (high) type: feature
reactive-python/reactpy-router#32 · 1 zugewiesene Person ·
-
complexity: 2 (medium) priority: 3 (low) type: feature
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Alle Issues in reactive-python/reactpy-router
Ähnliche Issues
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag
-
docs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
benchmark-gap
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag