Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of enforcing Typebox, let the user choose #1015

Open
thelinuxlich opened this issue Jan 4, 2024 · 2 comments
Open

Instead of enforcing Typebox, let the user choose #1015

thelinuxlich opened this issue Jan 4, 2024 · 2 comments

Comments

@thelinuxlich
Copy link
Contributor

thelinuxlich commented Jan 4, 2024

Maybe build upon typeschema so feTS become validation-agnostic ?

@imjulianeral
Copy link

imjulianeral commented Jan 25, 2024

Idk if this package must be included in fets at all, it increases the bundle size by a lot!

https://bundlephobia.com/package/[email protected]

it feels weird that TRPC with the packages server and client combined gets only ~10kb minified and fets it's over 60kb.

Also typebox is only 10kb, so Idk what's hapening here:

https://bundlephobia.com/package/@sinclair/[email protected]

@ardatan
Copy link
Owner

ardatan commented Jun 11, 2024

feTS relies on JSON Schema not typebox actually. Technically you can use any library that supports JSON Schemas for validation. By default, the schemas created by typebox are detected but that doesn't mean you cannot use any other libraries that are compatible with JSON Schemas. This is one thing.

About the bundle size;
Bundle size results might not be accurate since it doesn't get the optional dependencies that are tree-shaken in most cases such as ponyfills etc.
However, entire feTS library is tree-shakable so if you don't use typebox, you won't have it in your bundle so it means -10kb :)
Same for ponyfills... If they are not used, they won't be added to the bundle.

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

No branches or pull requests

3 participants