mmntjs
Compatibility-first migration bridge away from moment.js

Package Size

Package size is not one number.

Measure raw, minified, compressed, bundled, and runtime costs separately. `mmntjs` default is compatibility-heavy, so the raw core is not the main selling point. The more important property is that locale data and timezone data are kept separate, which gives tree-shaking and entry-point choice real leverage.

What To Understand

Main point

The default mmntjs entry is not trying to win the smallest-core contest.

What it does win

Locales and timezone data are separate, so apps do not pay for them unless they import them.

Lite entry

mmntjs/lite exists for browser-sensitive paths that want a smaller base and explicit add-backs.

Timezone surprise

The packaged IANA timezone data is smaller than many readers expect once compressed and packed.

Entry Sizes

Compare each entry against the moment.js shape it replaces.

Entry Raw size Compare against Reading Why it matters
mmntjs 148 KB moment (62.1 KB raw) core is smaller on the moment side Default compatibility-oriented core.
mmntjs/lite 43 KB moment (62.1 KB raw) smaller base than moment and default mmntjs Browser-sensitive base entry with explicit add-backs.
dist/locale/ja.js 4.8 KB moment + locale/ja (64.5 KB raw bundled) single locale stays separate Single locale remains a tiny extra module instead of pushing toward all-locales builds.
mmntjs-timezone 316 KB raw dist moment-timezone (773.1 KB raw bundled) compare as separate package Timezone data stays outside core and should be judged on its own.

Why This Helps

  • Moment's common browser story often drifts toward larger all-locales or timezone-heavy builds.
  • mmntjs keeps the compatibility-heavy core separate from locale data and timezone data. As a follow-up to that design, it is also easier to tree-shake: `sideEffects: false` is declared and locale modules are pure data exports.
  • That means the practical size question is usually: what does this app actually import, not what is the smallest theoretical core in isolation?

How To Read It

  • Use mmntjs when you want the broadest moment-compatible surface and can accept a heavier core.
  • Use mmntjs/lite when browser size matters and you are willing to add parsing, locale, or other extras explicitly.
  • Read locale size separately from core size. A single locale module is cheap; an all-locales browser build is where moment tends to bloat.
  • Read timezone size separately from core size. Apps that do not need named IANA zones should not pay for timezone data at all.

Timezone Data

The IANA package is separate, and its compressed size is fairly modest.

Methodology

The interesting part is not only how the numbers were measured, but how the timezone package was made smaller in the first place.

Name dictionary encoding

Replace long zone names like America/New_York with short base-60 IDs, then materialize them at runtime.

More details

Permutation-group index codec

Compress DST transition index patterns using run forms such as pair-repeat and increment. This is the most 'modern math' part of the timezone size work.

More details

Delta frequency dictionary

Turn repeated timezone deltas into global dictionary IDs so frequent transition values collapse to short tokens.

More details