Allow form action handlers to access data loaded by page/layout.
Open
Nobody has claimed this yet.
forms
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
In form action handler there is no way to call const myData = await parent()
Describe the proposed solution
The parent function could be made accessible in the scope of the handler
Alternatives considered
No response
Importance
would make my life easier
Additional Information
Workaround is using hooks to populate locals with the data needed
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing SvelteKit's form action handlers and the page/layout data-loading path to understand how parent() is currently scoped. Determine whether handlers can safely access loaded data, then add coverage showing a handler can use the relevant parent data; done means the proposed access works without the hooks-based workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100