Large bundle size for Branded types in the frontend

Hi, I'm using Next JS 15 and recently added branded types also to our frontend, but the bundle size got increased by almost 100KB (Gzip).

This is the code:
import * as Brand from "effect/Brand"

export type UserId = string & Brand.Brand<"UserId">
export const UserId = Brand.nominal<UserId>()

export type UserSessionId = string & Brand.Brand<"UserSessionId">
export const UserSessionId = Brand.nominal<UserSessionId>()

export type UserPasskeyId = string & Brand.Brand<"UserPasskeyId">
export const UserPasskeyId = Brand.nominal<UserPasskeyId>()

// and a lot more...


I don't know if I did something wrong, messed up the import or if the NextJS compiler has a bug? 100kb extra for just branded type doesn't seems normal
image.png
Was this page helpful?