I'm pretty bad at writing feature requests, so I asked Gemini to do it for me
Current Functionality:
Elysia's Eden client provides excellent end-to-end type safety with TypeScript by leveraging type inference instead of code generation. While this approach offers a lightweight solution, it can involve more manual type definition compared to frameworks like SvelteKit.
Desired Functionality:
We propose a new feature that enables auto-generation of types for Eden, similar to how SvelteKit generates types from API routes. This would significantly improve the developer experience by:
Reducing boilerplate: Automatically generating types for request bodies, responses, and path parameters would eliminate the need for manual type definitions.
Enhancing type safety: Auto-generated types would ensure consistency between client and server types, further strengthening type safety.
Improving developer productivity: Developers can focus on application logic rather than writing repetitive type definitions.
Implementation Options:
Explore the possibility of using a code generation tool like ts-trpc to automatically generate types based on server-side API definitions.
Implement a build-time process that analyzes server-side code and generates corresponding TypeScript type definitions for the client-side Eden client.
Benefits:
Improved developer experience: Reduced boilerplate and automatic type generation will streamline development.
Enhanced type safety: Auto-generated types will strengthen type safety and prevent potential runtime errors.
Increased productivity: Developers can focus on application logic rather than manual type definitions.
Alignment with Elysia's Goals:
This feature aligns with Elysia's focus on developer experience and end-to-end type safety. Auto-generated types will streamline development, promote type safety, and solidify Elysia's position as a developer-friendly framework.
Conclusion:
We believe that auto-generation of types for Eden will be a valuable addition to the Elysia framework. It will significantly improve developer experience, enhance type safety, and further differentiate Elysia from other frameworks.
I'm pretty bad at writing feature requests, so I asked Gemini to do it for me
Current Functionality:
Elysia's Eden client provides excellent end-to-end type safety with TypeScript by leveraging type inference instead of code generation. While this approach offers a lightweight solution, it can involve more manual type definition compared to frameworks like SvelteKit.
Desired Functionality:
We propose a new feature that enables auto-generation of types for Eden, similar to how SvelteKit generates types from API routes. This would significantly improve the developer experience by:
Implementation Options:
Benefits:
Improved developer experience: Reduced boilerplate and automatic type generation will streamline development. Enhanced type safety: Auto-generated types will strengthen type safety and prevent potential runtime errors. Increased productivity: Developers can focus on application logic rather than manual type definitions. Alignment with Elysia's Goals:
This feature aligns with Elysia's focus on developer experience and end-to-end type safety. Auto-generated types will streamline development, promote type safety, and solidify Elysia's position as a developer-friendly framework.
Conclusion:
We believe that auto-generation of types for Eden will be a valuable addition to the Elysia framework. It will significantly improve developer experience, enhance type safety, and further differentiate Elysia from other frameworks.