ardatan/feTS

Instead of enforcing Typebox, let the user choose

thelinuxlich opened this issue · 2 comments

Maybe build upon typeschema so feTS become validation-agnostic ?

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

https://bundlephobia.com/package/fets@0.7.1

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/typebox@0.32.12

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.