Skip to content

Replace moment with dayjs#2715

Merged
johnsimons merged 2 commits intomasterfrom
john/replace_moment
Nov 26, 2025
Merged

Replace moment with dayjs#2715
johnsimons merged 2 commits intomasterfrom
john/replace_moment

Conversation

@johnsimons
Copy link
Member

Summary

Migrated from moment.js (2.30.1) to Day.js for date/time handling, reducing bundle size by ~68KB gzipped (~94% reduction) with zero breaking changes to functionality.

Motivation

This should save ~286KB gzipped
const { config: edit_and_retry_config } = storeToRefs(editRetryStore);
const { configuration } = storeToRefs(configStore);
const error_retention_period = computed(() => moment.duration(configuration.value?.data_retention?.error_retention_period).asHours());
const error_retention_period = computed(() => dayjs.duration(configuration.value?.data_retention?.error_retention_period ?? "PT0S").asHours());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not obvious what the fallback default means

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is documented in the api docs. Do you think that is enough?
I didn't want to add a comment for something that is in the docs.

@johnsimons johnsimons merged commit 6af58b4 into master Nov 26, 2025
5 checks passed
@johnsimons johnsimons deleted the john/replace_moment branch November 26, 2025 03:27
@johnsimons johnsimons added this to the 2.4.0 milestone Dec 9, 2025
@johnsimons johnsimons added Type: Refactoring Type: Refactoring Type: Tech Debt Type: Tech Debt Type: Feature Type: Feature and removed Type: Refactoring Type: Refactoring Type: Tech Debt Type: Tech Debt Type: Feature Type: Feature labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactoring Type: Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants