π₯ Migrating to Tempo v5.x β
Tempo v5.x focuses on modern ECMAScript standards alignment, streamlined API ergonomics, removal of deprecated getters, static enums, legacy format tokens, and first-class integration with TC39 Signals across the reactive plugin ecosystem.
π Deprecation Removals & Breaking Changes in v5.0.0 β
1. Static Enum Accessors (Tempo.enums.*) β
The top-level static enum accessors on Tempo have been removed in favor of the unified Tempo.enums namespace.
- Removed:
Tempo.ELEMENT,Tempo.FORMAT,Tempo.NUMBER,Tempo.ORDINAL,Tempo.TIMEZONE,Tempo.MONTH_DAY,Tempo.MODE,Tempo.CACHE,Tempo.LIMIT - Replacement: Use
Tempo.enums.<NAME>(for example,Tempo.enums.FORMAT,Tempo.enums.MODE,Tempo.enums.TIMEZONE,Tempo.enums.ELEMENT).
// β v4.x (Deprecated)
const formatEnum = Tempo.FORMAT;
// β
v5.0.0
const formatEnum = Tempo.enums.FORMAT;2. Static Extension Method (Tempo.use) β
The legacy static Tempo.extend(...) method has been removed.
- Removed:
Tempo.extend(...) - Replacement: Use
Tempo.use(...)(orsandbox.use(...)).
// β v4.x (Deprecated)
Tempo.extend(MyPlugin);
// β
v5.0.0
Tempo.use(MyPlugin);3. Instance Properties and Getters β
Several legacy and ambiguous instance getters have been removed in favor of canonical ISO / temporal properties:
| Removed Getter | Canonical Replacement | Description |
|---|---|---|
t.eraYear | t.eon | Year within era (eon / astronomical era calendar alignment). |
t.ww, t.wy | t.woy | Week of year (ISO 8601 week number 1..53). |
t.yw | t.yow | 4-digit ISO week-numbering year. |
t.day | t.dd | Day of the month (1β31 number). Use t.format('{dd}') when zero-padded text is needed. For day-of-week use t.dow, and for day-of-year use t.doy. |
t.nano | t.epoch.ns | High-precision nanoseconds since Unix epoch (bigint). |
t.terms | Tempo.terms / t.term.<scope>.keys | Registered term definitions and available range keys (keys on static Tempo.terms.<key> or instance t.term.<scope>). |
t.ranges | t.term.<key> | Active range key for a specific term evaluated lazily on demand. |
t.clone() | Tempo.from(t, t.config) | Canonical instance cloning constructor (preserves instance-local configuration). |
// β v4.x (Deprecated)
const week = t.ww; // or t.wy
const weekYear = t.yw;
const eraY = t.eraYear;
const dayVal = t.day;
const nanoVal = t.nano;
const copy = t.clone();
// β
v5.0.0
const week = t.woy;
const weekYear = t.yow;
const eraY = t.eon;
const dayVal = t.dd;
const nanoVal = t.epoch.ns;
const copy = Tempo.from(t, t.config);NOTE
Humanized t.era & t.eon on iso8601: In v5.0.0, t.era ('ce' / 'bce') and t.eon (positive era year) always resolve even on the iso8601 calendar instead of returning undefined. If you need the raw TC39 Temporal behavior where iso8601 omits eras, access t.zdt.era and t.zdt.eraYear.
4. Static Tempo.now() Transition to Instance Factory β
In v4.x, Tempo.now() returned a primitive timestamp (bigint nanoseconds by default, or number when passed a unit string). In v5.0.0, Tempo.now() is a full instance factory (matching modern standards like Luxon DateTime.now() and TC39 Temporal):
Tempo.now(options?)returns an immutableTempoinstance representing the current moment, supporting instance options like{ timeZone, locale }.- Primitive timestamps are now cleanly accessed via the static
Tempo.epochnamespace:Tempo.epoch.ns(bigint) β nanoseconds since Unix epochTempo.epoch.ms(number) β milliseconds since Unix epochTempo.epoch.us(number) β microseconds since Unix epochTempo.epoch.ss(number) β seconds since Unix epoch
- Native Temporal Instant is accessible via
Tempo.instant(Temporal.Instant).
// β v4.x
const nowNs: bigint = Tempo.now();
const nowMs: number = Tempo.now('ms');
// β
v5.0.0 β Instance creation & fluent chaining
const now: Tempo = Tempo.now();
const today = Tempo.now().format('{yyyy}-{mm}-{dd}');
const tokyo = Tempo.now({ timeZone: 'Asia/Tokyo' });
// β
v5.0.0 β Primitive timestamps via Tempo.epoch
const nowNs: bigint = Tempo.epoch.ns;
const nowMs: number = Tempo.epoch.ms;
const inst: Temporal.Instant = Tempo.instant;5. Format Tokens and Modifiers β
To reduce token ambiguity and eliminate redundant aliases, format tokens and modifier definitions have been rationalized:
- Timezone Token (
{tzd}β{tz}):- The legacy
{tzd}(timezone delimiter / descriptor) token has been removed. - Use the canonical
{tz}token instead.
- The legacy
- Composite Week-Year Tokens (
{yyww},{yywy},{yywoy}):- Composite week-and-year tokens have been removed in favor of composable standard tokens.
- Replace
{yywoy}or{yyww}with{yow}{woy}(or localized{yow:locale}{woy:locale}).
- Week & Week-Year Token Aliases (
{yw}β{yow},{wy}β{woy}):- The legacy shorthand aliases
{yw}(week-numbering year) and{wy}(week of year) have been removed. - Replace
{yw}with{yow}(and{yw:locale}with{yow:locale}), and replace{wy}with{woy}(and{wy:locale}with{woy:locale}).
- The legacy shorthand aliases
- Calendar Week, Week of Month & Century Tokens (
{ww},{wom},{cen}Removed):{ww}has been removed in favor of{woy}(for ISO 8601 / Locale Week of Year:{woy}/{woy:locale}) and{woy:cal}(for Calendar Week of Year starting on January 1st, matching OracleWW).{wom}has been removed in favor of{woy:month}(week of month1β5).{cen}/{century}have been removed; compute century directly viaString(Math.abs(Math.floor(t.yy / 100))).padStart(2, '0').{julian}and{h24}aliases have been removed; use canonical{jj}and{hh}instead.
- Year Modifier Aliases (
:yyand:year):- The
:yyand:yearsub-modifier aliases on year tokens have been removed. - Use the canonical
{yy}token (or{yyyy}for 4-digit years).
- The
- Legacy Offset Modifiers on
{tz}:- Legacy modifier cases (
offsetshort,offsetcompact,z,zz,zzz,zzzz,zzzzz) on{tz}have been removed from the core formatter. - Use canonical
{tz:offset}, composable{tz:offset:compact},{tz:short}, or{tz:long}in core ({tz:offset:compact}replaces legacy{tz:offsetcompact}and v4.7{tz:zzz}for unpunctuated offsets like+0530), or load@tempo-kit/plugin-dialectsif LDML / Moment-style pattern emulation is required.
- Legacy modifier cases (
- Removed Legacy Getter Tokens (
{day},{nano}):{day}(from removedt.day) and{nano}(from removedt.nano) have been removed.- Use
{dd}or{dd:raw}in place of{day}. For{nano}, use{ts}with{ timeStamp: 'ns' }(for example,format(zdt, '{ts}', { timeStamp: 'ns' }), which works for bothTempoand nativeTemporalvalues), or{epoch.ns}when formattingTempoinstances (standaloneformat(zdt, ...)on nativeTemporalvalues leaves{epoch.ns}literal).
// β v4.x (Deprecated)
t.format('{tzd}');
t.format('{yywoy}');
t.format('{year:yy}');
// β
v5.0.0
t.format('{tz}');
t.format('{yow}{woy}');
t.format('{yy}');6. Utility & Support Exports β
Enumexport removed: The legacyEnumclass export fromtempo-kithas been removed. Use native TypeScript enums,as constobject literals, or thetempo-kit/libraryenumerator utilities (enumify).hasOwnhelper removed: The internal re-exporthasOwnfrom support utils has been removed. Use standard ECMAScriptObject.hasOwn(target, property).
7. Static Sandbox Factory Transition (Tempo.extend) β
Note that the legacy v4 plugin-registration signature Tempo.extend(...) has been removed (see Section 2 aboveβuse Tempo.use(...) instead). To align with prototypical inheritance conventions across the monorepo (such as Enum.extend), the static sandbox factory method Tempo.create(...) has been transitioned to the reused Tempo.extend(...) name with a clean break:
- Removed:
Tempo.create(options?),Tempo.create(fn),Tempo.create(options, fn) - Replacement: Use
Tempo.extend(options?),Tempo.extend(fn),Tempo.extend(options, fn)
// β v4.x
const MyTempo = Tempo.create({ timeZone: 'UTC' });
const val = Tempo.create((sb) => sb.now());
// β
v5.0.0
const MyTempo = Tempo.extend({ timeZone: 'UTC' });
const val = Tempo.extend((sb) => sb.now());8. Term Architecture: Civic vs. Cultural Terms, Quarter Split & .span Encapsulation β
In v5.0.0, the Term system undergoes a breaking architectural refinement to align with international standards and provide clean, encapsulated range objects:
- Opt-in Requirement for Cultural & Astrological Terms:
TermsModulenow registers only standardCivicTerms(QuarterTerm,SeasonTerm,TimelineTerm) by default.- Cultural and astrological terms (
ZodiacTerm,EasternTerm) have been extracted into the standalone@tempo-kit/plugin-culturalpackage, while corporate fiscal quarters (FiscalTerm) are opt-in viatempo-kit/terms. - Code relying on automatic
t.term.zodiacort.term.shengxiaoregistration will evaluate toundefinedunless@tempo-kit/plugin-culturalis installed and registered.
QuarterTerm(qtr/quarter) strictly ISO 8601-2 aligned:- Calendar quarters strictly map to standard Gregorian calendar quarters (
Q1= Jan 1,Q2= Apr 1,Q3= Jul 1,Q4= Oct 1) globally, completely decoupled from geographic hemisphere (sphere). - The legacy
fiscalfield onQuarterTermscope has been removed.
- Calendar quarters strictly map to standard Gregorian calendar quarters (
- Dedicated
FiscalTerm(fqtr/fiscal) β Superseding@magmacomputing/tempo-plugin-finance:- Financial, corporate, and jurisdictional fiscal quarters have moved into the built-in
FiscalTermplugin (tempo-kit/terms), superseding the standalone@magmacomputing/tempo-plugin-financepackage. - Standard range keys are
'FQ1','FQ2','FQ3','FQ4'(replacing numerict.finance.fiscalQuarter1..4). - Provides a direct numeric
year: number(e.g.2026, replacingt.finance.taxYear). - Supports configurable options
{ startMonth?: number, startDay?: number, country?: string }with automated jurisdictional defaults (includingtimeZonecountry inference) and resolvedconfigmetadata ont.term.fiscal.config. - Year-start detection (
t.finance.isFiscalYearStart()) is replaced byf?.key === 'FQ1' && t.equals(f.span.start, 'day')using the newt.equals()/Tempo.equals()/Tempo.compare()APIs.
- Financial, corporate, and jurisdictional fiscal quarters have moved into the built-in
- Encapsulated Range Metrics (
.span):- Temporal boundaries (
start,end) and duration progress metrics (total,elapsed,remaining,progress) are now encapsulated withinspan: TermSpan. - The legacy root-level getters (
range.start,range.end) have been removed. - Leaked internal template schema matching units (
year,month,week,day,hour,minute, etc.) are stripped from resolved root range objects.
- Temporal boundaries (
SeasonTermEquatorial Support:SeasonTermnow supportssphere: 'equator', resolving tropical bimodalWetandDryseasons ('Long Wet','Long Dry','Short Wet','Short Dry').
// β v4.x (Quarter was hemisphere-dependent; cultural terms auto-loaded; root start/end leaked)
const t4 = new Tempo('2026-02-15', { sphere: 'south' });
t4.term.qtr; // 'Q3' (in v4 southern hemisphere)
t4.term.quarter.start; // Root getter
t4.term.quarter.fiscal; // Legacy fiscal year string/number
t4.term.quarter.month; // Leaked template matching schema key
t4.term.zdc; // 'Aquarius' (cultural terms were auto-registered)// β
v5.0.0 (Quarter is ISO 8601-2; boundaries and progress encapsulated in .span)
const t = new Tempo('2026-02-15', { sphere: 'south' });
t.term.qtr; // 'Q1' (strictly ISO 8601-2 calendar quarter everywhere)
t.term.quarter.span.start; // Frozen Tempo instance
t.term.quarter.span.end; // Frozen Tempo instance
t.term.quarter.span.progress; // Normalized float (0.0 .. 1.0)
// β
v5.0.0 (Cultural & Astrological terms live in @tempo-kit/plugin-cultural)
import { CulturalPlugin, ZodiacTerm, EasternTerm } from '@tempo-kit/plugin-cultural';
// Option A: Register individual terms
Tempo.use(ZodiacTerm);
Tempo.use(EasternTerm);
// Option B: Register the full cultural plugin
Tempo.use(CulturalPlugin);
const tAstro = new Tempo('2026-02-15');
tAstro.term.zdc; // 'Aquarius'
tAstro.term.shengxiao.animal; // 'Horse'
// β
v5.0.0 (Fiscal cycles use FiscalTerm)
import { FiscalTerm } from 'tempo-kit/terms';
Tempo.use(FiscalTerm);
const tFiscal = new Tempo('2026-02-15', { pluginOptions: { fiscal: { country: 'AU' } } });
tFiscal.term.fqtr; // 'FQ3'
tFiscal.term.fiscal?.year; // 2026
tFiscal.term.fiscal?.span.start; // Tempo('2026-01-01T00:00:00')β οΈ Migrating to Tempo v4.x β
Tempo v4.x introduces a standardized plugin & registry architecture, strict configuration namespaces, cascading configuration inheritance, and deterministic resource disposal while excising legacy v3.x deprecated interfaces.
β‘ Dynamic Functional Context (DFC) & Supplier Options β
In v4.0.0, core configuration options (timeZone, locale, calendar, sphere) accept lazy Evaluable<T> supplier functions (() => T) as well as static scalars. This enables dynamic, per-request context resolution (e.g. multi-tenant session headers, request-scoped localizations) without recreating Tempo options or rebuilding configuration objects.
// β
v4.0.0 - Dynamic per-request timezone resolution
import { Tempo } from 'tempo-kit';
import { getActiveTenantTimezone } from './session';
Tempo.init({
timeZone: () => getActiveTenantTimezone(), // Re-evaluated dynamically when context getters execute
locale: () => getCurrentUserLocale()
});π οΈ Plugin SDK Subpath (tempo-kit/plugin/sdk) β
In v4.0.0, all custom plugin, term, module, and namespace development is standardized on tempo-kit/plugin/sdk.
- Legacy Imports: Deprecated
plugin-api.index.tsand#tempo/licensesubpath imports have been removed. - SDK Import: Import
definePlugin,defineTerm,defineModule,defineNamespace,defineRange, and evaluation utilities directly fromtempo-kit/plugin/sdk.
// β v3.x (Deprecated)
import { definePlugin } from 'tempo-kit/plugin-api';
// β
v4.0.0
import { definePlugin } from 'tempo-kit/plugin/sdk';π Zero-await Synchronous JSONC Config Discovery β
Tempo v4.0.0 introduces resolveConfigSync() for zero-await synchronous configuration discovery when using .json or .jsonc configuration files.
.json/.jsoncfiles: Dynamically discovered and parsed synchronously during module initialization viaparseJSONC..ts/.mts/.mjs/.jsfiles: Asynchronously loaded viaresolveConfig().- Deprecated
.cjsconfig discovery files are no longer automatically scanned.
π 100% Open-Source Community Core β
Tempo v4.0.0 Community Core is 100% open-source without commercial license validation hooks or JWT scope checks.
- License keys (
licenseKey,TEMPO_LICENSE_KEY) are no longer required or checked in the Community Edition. Tempo.ready()returns'none'for community core compatibility.
π Tempo v4.1.0 Updates β
Tempo v4.1.0 introduces cascading configuration inheritance (extends), a dedicated pluginOptions configuration slot, and overloaded Tempo.create() with deterministic resource cleanup (TC39 using).
π Configuration Inheritance (extends), plugins, and pluginOptions β
In v4.1.0, configuration, plugin registration, and runtime options have been cleanly separated:
- Configuration Inheritance (
extends): Theextendsoption inTempo.init()ortempo.config.jsonis strictly reserved for cascading configuration inheritance via local file paths orfile://URLs (mirroringtsconfig.jsonand ESLint conventions):extends: './tempo-base.json'. - Plugin Registration (
plugins): Pass executable plugins, terms, and modules intoplugins: [TickerPlugin, CelestialPlugin]. - Plugin Configuration Slot (
pluginOptions): Pass runtime configuration defaults for plugins intopluginOptions: { ticker: { interval: 500 } }. The 'plugins' key as a JSON of plugin-configuration settings has been migrated topluginOptionsso as not to overload thepluginskey (which registers Plugin instances / Terms / Modules / Namespaces). - Imperative Registration (
Tempo.use): Use the standardTempo.use(Plugin)static method to register plugins, terms, or modules at runtime.Tempo.extend()is@deprecated Use Tempo.use(...) instead..
Example: β
// β
v4.1.0: Clean Separation
Tempo.init({
extends: './tempo-base.json', // Configuration inheritance
plugins: [TickerPlugin, CelestialPlugin], // Feature & Term registration
pluginOptions: { // Plugin runtime options
ticker: { interval: 500 }
}
});
// β
Imperative registration
Tempo.use(TickerPlugin);π Overloaded Tempo.create() & Scoped Disposal (using) β
In v4.1.0, Tempo.create() introduces deterministic resource cleanup via TC39 Explicit Resource Management:
- Scoped Callback Mode: Run isolated operations without leaking sandbox state to the global scope:typescript
const season = Tempo.create((sb) => { sb.use(CelestialPlugin); return sb('2026-06-21').term.astronomy.season; }); // sandbox automatically disposed upon completion - TC39 Explicit Resource Management (
using):typescript{ using sb = Tempo.create({ discovery: 'ephemeral' }); sb.use(MyPlugin); } // sb[Symbol.dispose]() called automatically
π Data Augmentation (registry: { ... }) β
All custom format definitions, locale mappings, modifiers, tokens, snippets, layouts, events, periods, ignores, and number-word definitions are consolidated under the registry namespace.
- Number-Word Mappings: Top-level
numbers: { ... }has been moved toregistry: { numbers: { ... } }. - Custom Formats: Top-level
formats: { ... }has been moved toregistry: { formats: { ... } }. - Global Discovery: Discovery objects (
Symbol.for('$Tempo')) useregistry: { numbers: { ... }, formats: { ... } }instead of top-leveldiscovery.numbersordiscovery.formats.
Example Migration: β
// β v3.x (Deprecated)
Tempo.init({
numbers: { un: 1, deux: 2 },
formats: { customDate: '{yyyy}-{mm}-{dd}' }
});
// β
v4.0.0
Tempo.init({
registry: {
numbers: { un: 1, deux: 2 },
formats: { customDate: '{yyyy}-{mm}-{dd}' }
}
});π§Ή Deprecated Type & API Cleanup β
Tempo.usevsTempo.uses: The legacy aliasTempo.useshas been excised. UseTempo.use().TempoInstanceType:TempoInstanceinterface alias has been removed in favor of standardTempoclass/instance types.Mutable<T>toMutableObject<T>: The utility typeMutable<T>has been renamed toMutableObject<T>to prevent naming collisions with the@Mutablemember decorator and clarify object-levelreadonlystripping.
π Tempo v4.7.0 Updates: Format Masks & Dialects Migration β
Tempo v4.7.0 formalizes date formatting ergonomics, introduces seamless interop with external library formatting standards via @tempo-kit/plugin-dialects, and guides developers when unbraced masks are detected.
π‘ The Braced Templating Model: "Template Strings for Dates" β
In Tempo, native formatting masks follow an intuitive template-literal paradigm ({token}):
- Zero-Escaping: Plain text requires no escaping. Only tokens enclosed in
{...}are replaced.typescript// In Tempo: no bracket or quote escaping needed around literal words! t.format('Meeting on {wkd}, {dd:ord} of {mon} at {h12}:{mi} {mer}'); // Output: "Meeting on Tuesday, 24th of October at 03:30 pm" - Composable with ES Template Strings: Because ECMAScript evaluates backtick template literals (
`...`) before passing arguments into.format(), you can seamlessly interpolate application variables alongside Tempo date tokens:typescriptconst user = 'Alice'; const role = 'Admin'; t.format(`Welcome ${user} (${role})! Your session expires on {wkd} at {h12}:{mi}{mer}`);
π Migrating from Day.js, Moment.js, and Luxon β
If your codebase relies on external format strings (YYYY-MM-DD, yyyy-MM-dd, or %Y-%m-%d), you do not need to rewrite your masks.
1. Install @tempo-kit/plugin-dialects β
npm install @tempo-kit/plugin-dialects2. Drop-in Replacement for Luxon (toFormat) β
import '@tempo-kit/plugin-dialects/install';
import { Tempo } from 'tempo-kit';
const t = new Tempo('2026-10-24');
console.log(t.toFormat('yyyy-MM-dd HH:mm')); // Luxon standard drop-in3. Automatic Unbraced Mask Routing & Migration Guard β
When @tempo-kit/plugin-dialects is registered, calling t.format('YYYY-MM-DD') automatically routes through the dialects compiler.
If an unbraced format mask is passed without the dialects plugin installed:
t.format('YYYY-MM-DD');
// β Throws: [Tempo] Formatting unbraced format mask 'YYYY-MM-DD' requires '@tempo-kit/plugin-dialects'.This safeguards developers from accidental silent formatting bugs and immediately guides them to the right solution.
β οΈ Migrating to Tempo v3.x β
Tempo v3.x finalizes the plugin ecosystem by extracting advanced features into standalone, licensed packages.
π Migrating to Tempo v3.x (Ticker Extraction) β
The TickerPlugin has been extracted from the core engine into a standalone open-source Community plugin (@tempo-kit/plugin-ticker).
Action Required:
- If you use
Tempo.ticker(), install@tempo-kit/plugin-tickeralongsidetempo-kit. - Import and register the plugin in your application initialization:javascript
import { Tempo } from 'tempo-kit'; import { TickerPlugin } from '@tempo-kit/plugin-ticker'; Tempo.init({ plugins: [TickerPlugin] });
β οΈ Migrating to Tempo v2.x β
Tempo v2.x introduces architectural improvements and a more modular engine. While we strive for backward compatibility, there are some key changes to consider when upgrading from v1.x.
π¦ Modular Architecture β
Tempo is now split into a core engine and optional modules.
If you use the full package: β
If you import from tempo-kit, everything (except Plugin extensions, like .ticker()) is included and works exactly like v1.x. No changes are required.
If you want a lean bundle: β
You can now import the core engine only:
import { Tempo } from 'tempo-kit/core';If you do this, you must manually import the features you need. Built-in features now self-register on import via side-effects.
π Feature Registration β
Features like mutation, duration, format, and the ticker are now modular.
v1.x (Automatic) β
In v1.x, all features were always present.
v2.x (Opt-in for Core) β
If using the Core engine, simply import the module to activate the feature:
import 'tempo-kit/duration';
import 'tempo-kit/ticker';ποΈ Term Logic Refactor β
The way Terms (Quarters, Seasons, Zodiacs, etc.) are handled has been unified.
- v1.x: Some Term properties were ad-hoc on the instance.
- v2.x: All Term logic is centralized under the
.termproperty or accessible via the#shorthand in.set()and.add().
Example of new syntax:
// Snap to start of quarter
t.set({ '#quarter': 'start' });
// Add two quarters while preserving day-of-quarter
t.add({ '#quarter': 2 });π Tempo v2.4.0: Standalone Utilities & Path Deprecation β
Tempo v2.4.0 introduces standalone utility entry points for parse and format.
π οΈ Standalone Imports β
You can now import lightweight, tree-shakable versions of our parsing and formatting engines without the Tempo class:
import { parse } from 'tempo-kit/parse';
import { format } from 'tempo-kit/format';β οΈ Reorganized Paths β
We have reorganized the package structure to support these standalone entry points more cleanly.
Action Required:
Use package subpath maps: Update your imports to use the official entry points:
- β
tempo-kit/module/parse - β
tempo-kit/module/format - β
tempo-kit/parse - β
tempo-kit/format
- β
Check your Import Maps: If you use browser-side import maps, ensure they point to package subpath locations rather than internal folder paths. A maintained
importmap.jsonis included in the package root (packages/tempo/importmap.json) as the sanctioned reference for each release.Note: The shipped
packages/tempo/importmap.jsonis the supported exception for version-locked internal mappings. Use it as-is for your installed Tempo version instead of hand-authoringdist/paths.Example:
{
"imports": {
"tempo-kit/parse": "./node_modules/tempo-kit/parse",
"tempo-kit/format": "./node_modules/tempo-kit/format"
}
}π Migrating from version 2.4 β
As Tempo grows, it has become much more efficient for our developers to logically re-group certain modules.
Action Required:
- Review your browser
importmapentries. - Replace any older internal paths with the current package subpath entries (for example,
tempo-kit/duration,tempo-kit/mutate,tempo-kit/parse, andtempo-kit/format). - Do not pin imports in your code directly to internal folder layouts in
dist/, since those paths may change as modules are reorganized. Instead rely wholly on your import maps.
π Migrating from version 2.6.0 β
Season Term scope output has been simplified.
Action Required:
- If you previously relied on the Chinese-specific object attached to
term.seasonscope output, remove that dependency. - Resolve Chinese season context by creating a dedicated
Tempoinstance with the appropriate ChinesetimeZonefor the interpretation you need.
π Migrating from version 2.7.0 (Grouped Options) β
Tempo has rationalized its configuration surface by grouping related options into nested objects. This improves discoverability and allows for easier additive merging across the prototype chain.
Month-Day (Regional Parsing) β
The individual mdyLocales and mdyLayouts options have been consolidated into a single monthDay object.
- v2.6.x:
new Tempo({ mdyLocales: ['en-US'] }) - v2.7.x:
new Tempo({ monthDay: { locales: ['en-US'] } }) - Shortcut:
new Tempo({ monthDay: true })(enables forced MDY parsing using default locales).
Relative Time β
The individual rtfFormat and rtfStyle options have been consolidated into a single relativeTimeFormat object.
- v2.6.x:
new Tempo({ rtfStyle: 'long' }) - v2.7.x:
new Tempo({ relativeTimeFormat: { style: 'long' } })
Action Required: β
Only the deprecated top-level keys rtfFormat and rtfStyle are still accepted as legacy fallbacks in the current release, handled specifically in the Tempo class constructor for backward compatibility.
In contrast, the old mdyLocales and mdyLayouts keys are not treated as aliases and will be ignored; these must be migrated to the new nested monthDay structure. Update your configuration to ensure compatibility with future versions and the optimization engine. Refer to the Tempo constructor for implementation details on legacy alias handling.
π Migrating to version 2.9.3 β
π BigInt Precision Resolution β
A breaking change was introduced to harmonize BigInt handling with numeric inputs.
- Pre-v2.9.3:
BigIntinputs were always treated as raw nanoseconds, regardless of thetimeStampconfiguration. - v2.9.3+:
BigIntinputs now respect the configuredunit(default'ms').
Example: β
// Before v2.9.3
new Tempo(1000n).ts; // 1000 (nanoseconds)
// After v2.9.3
new Tempo(1000n).ts; // 1000 (milliseconds)Action Required: β
If you previously relied on BigInt being treated as nanoseconds, you must now explicitly set the timeStamp unit to 'ns':
new Tempo(1000n, { timeStamp: 'ns' });π Removed Features (v3.0.0) β
Deprecated Boolean Debug Flag β
The debug configuration property no longer accepts boolean values. It has been strictly typed to accept numeric verbosity levels matching the internal LOG enum, or lowercase string labels (e.g. 'trace', 'info').
- Removed:
new Tempo({ debug: true }) - Recommended:
new Tempo({ debug: 4 }),new Tempo({ debug: 'debug' }), ornew Tempo({ debug: LOG.Debug })(for parsing verbosity).
Internationalization Naming β
To better align with ECMAScript standards (specifically Intl.RelativeTimeFormat), the relativeTime configuration option inside intl is no longer supported in v3.0.0.
- Removed:
new Tempo({ intl: { relativeTime: { style: 'long' } } }) - Recommended:
new Tempo({ intl: { relativeTimeFormat: { style: 'long' } } })
Please migrate your configurations from relativeTime to relativeTimeFormat.
π§ͺ Testing and Stability β
v2.x has been hardened with a 100% pass rate on our regression suite. If you were relying on undocumented "quirks" or bugs in v1.x parsing, you may find that v2.x is more strict and deterministic.