Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* basic actions method * add form store * remove export let errors in favor of form store * make actions an object * implement FilesFormData * restrict values type, fix conversion, switch argument order * validation->invalid * start writing docs * implement handleFile * fix tests * test for files * complete migration message * support validation error thrown in endpoints * infer file type from handleFile hook * add handleFile to build * types, cleanup * $form -> $submitted * woops * allow arbitrary data on invalid, persist data in success case * fix infered FileType * give JSON response a well-defined shape * provide form state through form prop and $page.form * return invalid instead of throwing it * types for actions * fix, skip test * updateForm (simple version) * making a start at enhance * bye bye method overrides * update create-svelte default template * remove handleFile * full blown enhance and updateForm through $app/forms * fix type reference * adjust default template * remove $page.form for now (too much of a footgun due to resets) * tests, ensure form is only reset on page changes * ????? * cleanup * docs about multiple forms * make docs build * lint * fix * add toggle action * rename generated FormData type to ActionData * reset form on navigation, not invalidation * silence missing/unused form prop warnings, DRY out code a bit * Update packages/kit/src/runtime/server/page/actions.js * Update packages/kit/src/runtime/server/page/actions.js * Update packages/kit/src/runtime/server/page/actions.js * change message to reference actions * Update packages/kit/src/runtime/server/page/actions.js * Update packages/kit/src/runtime/server/page/actions.js * be more specific about what content-type is accepted * Update packages/kit/src/runtime/server/page/render.js * Update packages/kit/src/runtime/server/page/render.js * unskip test * fix types * tweak enhance function and make todos example work again * changeset * deduplicate type usage * lint * wording, make updateForm (now applySubmissionResult) more powerful * fix, docs * applySubmissionResult -> applyAction * change enhance function signature * fix template * fix template * Update .changeset/spicy-pugs-applaud.md * Update packages/kit/src/runtime/app/forms.js * Apply suggestions from code review * prettier * rename SubmissionResult to ActionResult * Update packages/kit/types/ambient.d.ts * Update packages/kit/types/ambient.d.ts * updateForm -> applyAction * use RequestEvent instead of ActionEvent * fix * invalidate first, delegate redirect/error handling to applyAction * remove token stuff, simplify a bit * show +error page without reloading route * check action return data can be serialized as JSON * add note to render.js * merge FetchFormResponse and ActionResult * update docs * remove logging * tiny docs tweak Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Rich Harris <[email protected]>
- Loading branch information