Skip to content

Replace Moment.js with a lighter-weight alternative #1435

@outoftime

Description

@outoftime

Moment.js contributes a disproportionately large proportion of our bundle size given its limited actual use in the application. dayjs is an API-compatible replacement that is much smaller, though we would have to confirm it supports the browsers/versions we need. date-fns is another library that, while not API-compatible, has been much-touted recently as a good replacement for Moment.

To evaluate effectiveness at reducing bundle size, you can build a production-like environment with:

$ PROFILE_BUILD=true npm run preview

And then access:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions