ITADN

Tighten up form transport stuff

#16321OpenRich-Harris 创建于 2026-07-10
R
Rich-Harriscommented
### Describe the problem It's a bug that you can manually specify the `name` of a remote form input: ```svelte <form {...myform}> <!-- good --> <input {...myform.fields.message.as('text')} /> <!-- bad --> <input name="message" /> <button>submit</button> </form> ``` It's bad because it defeats type safety, and because it allows you to accidentally use a field from the wrong form, and because people will come to do weird shit that will break if we're forced to change some detail of the implementation at a later date. ### Describe the proposed solution Enforce the correct use of remote form fields by prefixing the `name` with an identifier, so that this... ```svelte <input {...myform.fields.message.as('text')} /> ``` ...renders as something like this: ```html <input type="text" name="xyz123/myform/s/message" value="..." aria-invalid="..." /> ``` (I don't think we should include the `id` of a `.for(...)` in the prefix, that would be annoying.) ### Alternatives considered _No response_ ### Importance nice to have ### Additional Information _No response_
0 条评论