Huge bundle size with `@effect/schema` for Simple Schema Definitions and Parsing

Beginner question about @effect/schema. I'm using it for 2 very simple tasks: I define some schemas and the related TS types and I parse them. Nothing fancy, looks like this:

import * as S from '@effect/schema/Schema';
// snip
const Author = S.struct({
  firstName: S.string,
  lastName: S.string,
  image: Image,
});
export type Author = S.Schema.To<typeof Author>;
// snip...
export const parseArticle = S.decodeUnknownEither(Article);


The file has less than 90 lines of schema definitions. And in package.json I have "@effect/schema": "^0.63.0",

But for some reason this increases the bundle size a LOT compared to not having Schema at all. I use Vite 5.1.4. vite-bundle-visualizer shows two huge blobs:
- effect/dist/esm which has the size of whopping 306.75 kB rendered
- @effect/schema/dist/esm which is 61.42 kB rendered

Those are almost 100 kB gZipped (85 kB + 12.66 kB), especially the former is bigger than I expected. Any ideas what could I be doing wrong? Or is this expected behaviour? Thanks!
Was this page helpful?