feature(forms-submission): re-consider current implementation
Is your feature request related to a problem? Please describe.
Form supports was implemented a while back in https://github.com/netlify/cli/pull/780.
The current implementation looks at requests and tries to detect if they are form submissions (by looking at the request method and content-type), and invoke the submission-created handler accordingly.
That implementation as a few disadvantages:
- It can't include any information that wasn't sent by the browser in the functions event object. See issue
- It will detect any POST request with a matching content-type as a form submission and trigger the handler, where it should only track forms submissions.
Describe the solution you'd like
Ideally the CLI should parse the HTML to identify forms and link those to submissions
Describe alternatives you've considered
Keeping things as they are
Additional context
See https://github.com/netlify/cli/issues/447
Adding #1610 as another place where our CLI handling of forms is different from what we use on netlify.com
When we discussed it with the team, the solution we saw was redesigning the way we handle form submissions.