Headless pakket src/cms-client met importgrens, formulier dat pas verschijnt als de API antwoordt (anders blijft de mailto-knop), honeypot, idempotentie, token-vernieuwing en property-based tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
939 B
939 B
Tech Stack Decisions — contact-form (U4)
- No new runtime dependencies. Plain
fetchwithAbortController,crypto.randomUUID()for the idempotency key (fallback to agetRandomValuesbased UUID where unavailable), React hooks/reducer. - Forms: no form library; the headless hook owns state and validation (reusable by other sites).
- Tests: Vitest + Testing Library;
fast-checkas a dev dependency for the partial property-based testing (validation, reducer invariants, serialization round trips): vetted npm package, lock file committed, no runtime impact, respecting the repo's release-age policy (stop and report if blocked). - API types: hand-written minimal types now; generated from the CMS file
openapi/slpsoftware.v1.jsonis a follow-up whencms-clientmoves to SlpModularCms. - Boundary enforcement: ESLint
no-restricted-importsonsrc/cms-client/**(no imports from the app folders).