Skip to content

Remove action() export convention from route modules - #10

Merged
JoviDeCroock merged 1 commit into
mainfrom
feat/remove-action-convention
Apr 7, 2026
Merged

Remove action() export convention from route modules#10
JoviDeCroock merged 1 commit into
mainfrom
feat/remove-action-convention

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Owner

Summary

  • Remove the action() export convention from route modules — forms now POST to API routes (src/api/) directly
  • Simplify <Form> component to a thin fetch + redirect wrapper (no automatic revalidation, no ActionEnvelope parsing)
  • Add useRevalidate() hook for manual loader data refresh after mutations (useRevalidateRoute kept as deprecated alias)
  • Remove ActionArgs, ActionEnvelope, ActionFn, ActionResult types, useSubmitAction hook, SubmitActionOptions, CSRF validation on page routes, action dispatch in handleViactRequest, and revalidation hints
  • Non-GET requests to page routes now return 405
  • Update all examples (basic, cloudflare) and documentation (forms, auth, testing, data-loading, adapters, deployment, middleware, performance, getting-started, architecture)

Test plan

  • npx vitest run — 13 unit tests pass (framework)
  • npx tsc --noEmit — typecheck passes
  • pnpm run build — all packages build successfully
  • npx playwright test — 21 E2E basic tests + 3 build tests pass
  • Grep for orphaned action references in framework src — none found

🤖 Generated with Claude Code

Forms now POST to API routes directly instead of page route actions.
Simplify <Form> component to a thin fetch+redirect wrapper without
automatic revalidation. Add useRevalidate() hook (useRevalidateRoute
kept as deprecated alias). Remove ActionArgs, ActionEnvelope, ActionFn,
ActionResult types, useSubmitAction hook, CSRF validation on page
routes, action dispatch in handleViactRequest, and revalidation hints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoviDeCroock
JoviDeCroock force-pushed the feat/remove-action-convention branch from 48c8de3 to d3e2169 Compare April 7, 2026 22:07
@JoviDeCroock
JoviDeCroock merged commit 95acd88 into main Apr 7, 2026
1 check passed
@JoviDeCroock
JoviDeCroock deleted the feat/remove-action-convention branch April 8, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant