Skip to content

Commit ac3f05b

Browse files
committed
Update bundle size info in comparison guide
1 parent 33f79c3 commit ac3f05b

File tree

1 file changed

+3
-3
lines changed
  • website/src/routes/guides/(get-started)/comparison

1 file changed

+3
-3
lines changed

website/src/routes/guides/(get-started)/comparison/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This can make a big difference, especially for client-side validation, as it red
2525

2626
{/* prettier-ignore */}
2727
```ts
28-
import * as v from 'valibot'; // 1.19 kB
28+
import * as v from 'valibot'; // 1.37 kB
2929

3030
const LoginSchema = v.object({
3131
email: v.pipe(
@@ -43,11 +43,11 @@ const LoginSchema = v.object({
4343

4444
### Comparison with Zod
4545

46-
For example, to validate a simple login form, [Zod](https://zod.dev/) requires [12.9 kB](https://bundlejs.com/?q=zod&treeshake=%5B%7B+object%2Cstring+%7D%5D) whereas Valibot require only [1.19 kB](https://bundlejs.com/?q=valibot&treeshake=%5B%7B+email%2CminLength%2CnonEmpty%2Cobject%2Cstring%2Cpipe+%7D%5D). That's a 92 % reduction in bundle size. This is due to the fact that Zod's functions have several methods with additional functionalities, that cannot be easily removed by current bundlers when they are not executed in your source code.
46+
For example, to validate a simple login form, [Zod](https://zod.dev/) requires [13.5 kB](https://bundlejs.com/?q=zod&treeshake=%5B%7B+object%2Cstring+%7D%5D) whereas Valibot require only [1.37 kB](https://bundlejs.com/?q=valibot&treeshake=%5B%7B+email%2CminLength%2CnonEmpty%2Cobject%2Cstring%2Cpipe+%7D%5D). That's a 90 % reduction in bundle size. This is due to the fact that Zod's functions have several methods with additional functionalities, that cannot be easily removed by current bundlers when they are not executed in your source code.
4747

4848
{/* prettier-ignore */}
4949
```ts
50-
import { object, string } from 'zod'; // 12.9 kB
50+
import { object, string } from 'zod'; // 13.5 kB
5151

5252
const LoginSchema = object({
5353
email: string()

0 commit comments

Comments
 (0)