Skip to content

Replace moment.js in Forms with a modern, smaller library #675

Open
@bramdoppen

Description

@bramdoppen

Today, when running a pagespeed test on a website that uses Umbraco Forms, pagespeed insights reported some warnings about the large filesize of moment-with-locales.min.js which is used by Umbraco Forms.

Total filesize of the minified version (moment-with-locales) is 322kb. I inspected the JavaScript really quickly and I saw the usage of moment just a few times. The filesize seems pretty huge to me to include in a plugin like Umbraco Forms.

Suggestion: Replace moment.js with some other and modern library like dayjs (https://day.js.org/) which uses the same syntax, is modular/tree-shakeable, and only 2kb in size.

Happy to hear your thoughts about it!

I posted this issue also on https://our.umbraco.com/forum/using-umbraco-and-getting-started/107693-replace-momentjs-in-forms-with-a-modern-smaller-library but it was suggested to move it over here. Issue on our.umbraco is closed.

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