Skip to content

Conversation

@niemyjski
Copy link
Member

No description provided.

Migrates from Superforms to TanStack Form for improved form management and validation.

This change introduces Zod for schema definition and validation, and leverages TanStack Form's capabilities for handling form state and server-side error integration, and includes guidelines for form handling with TanStack Form and Zod, reactive bindings, safe data cloning, dialogs, and trigger components.

Updates frontend instructions to reflect the new form handling approach.
Updates the API model generation process to use Zod schemas, improving type safety and validation.

This change replaces the previous class-validator based approach with Zod, offering a more modern and flexible solution for defining and validating API data contracts.
The update also includes removing the no longer used class-validator dependencies and templates.

This aligns with improved type generation and client side form validation as the single source of truth.
Replaces the existing api.ts file with a new version.
Adds a schemas.ts file containing schema definitions.

The new api.ts file includes interfaces and enums representing the API's data structures. The schemas.ts file defines Zod schemas for data validation.

These changes provide strongly-typed API definitions for improved code maintainability and data validation capabilities.
Removes form components that are no longer in use, cleaning up the codebase and reducing unnecessary code.
Implements a set of reusable UI field components for form creation.

These components include Field, Set, Legend, Group, Content, Label, Title, Description, Separator, and Error.
The Field component provides layout and styling, while the others handle specific aspects like labels, descriptions, and error messages.
Updates the chart tooltip type definitions to use `unknown` instead of `any`.

This change ensures better type safety and prevents potential issues
related to using `any` type, improving the overall code quality.
Adds `@tanstack/svelte-form` package.

Removes unused packages related to form validation.
@niemyjski niemyjski self-assigned this Dec 18, 2025
Improves documentation for handling forms, including error conversion and data initialization.

Explains patterns for server-side error handling using `problemDetailsToFormErrors()`, covering both API exception and response object scenarios.

Clarifies form initialization techniques, demonstrating simple and reactive approaches with `structuredCloneState()` for preventing cache mutation.
Refines the AGENTS.md documentation to improve clarity on
UI patterns, specifically focusing on TanStack Form usage with
Zod schemas for form validation.

Also updates documentation to reflect Svelte 5 syntax changes.
Updates various dependencies to their latest versions, ensuring compatibility and incorporating bug fixes and performance improvements.

Removes the `perfectionist/sort-enums` rule from the ESLint configuration.
This rule was causing issues and doesn't align with the desired code style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants