Advanced
Runtime compatibility
Messagevisor keeps evaluation behavior portable across SDKs while allowing each platform to use its native internationalization runtime.
Portable evaluation contract#
Conditions and segments intentionally avoid runtime-specific coercion:
- values are type-strict;
- condition and segment arrays are implicit
ANDgroups; notnegates the implicitANDof its direct children;- regular expressions support the portable flags
i,m,s, anduonly, withumapped to each platform's native Unicode-aware mode, while lookaround, advanced groups, backreferences, and possessive quantifiers are rejected; beforeandafterrequire timezone-qualified ISO date-time values, such as2026-07-17T12:00:00Z;- invalid expressions, invalid dates, missing segments, and type mismatches do not match.
These rules apply in both authoring lint and SDK runtime evaluation. They make a definition behave consistently in JavaScript, Java, Swift, and future SDKs.
Localization runtime differences#
SDKs use the platform's native Intl, ICU, or CLDR implementation. Exact punctuation, spacing, date order, and localized names can vary legitimately between runtime versions. Cross-platform tests should express such known differences explicitly instead of rewriting output inside an SDK.
Some JavaScript formatter families depend on optional browser APIs such as Intl.ListFormat and Intl.DisplayNames. When an API is unavailable, the SDK reports an unsupported_formatter diagnostic. Invalid options report invalid_format, while requesting an unknown named preset reports missing_format.
JavaScript baseline#
The Messagevisor CLI and Node.js tooling allow Node.js 20.19 or newer. Repository development and CI use the exact release pinned in .nvmrc, currently Node.js 24.16.0. Locale-sensitive output is verified only on that pinned release because Node.js releases can ship different ICU and CLDR data. Applications on an allowed lower Node.js release should review their own locale-sensitive output when upgrading or comparing environments.
The JavaScript SDK is published for browser and server use without relying on newly introduced collection or iterator helpers in its runtime path. Core evaluation relies on ordinary ES5-compatible output and standard primitives. Direct formatter helpers rely on the corresponding Intl family:
Intl.NumberFormat,Intl.DateTimeFormat, andIntl.PluralRulesare baseline formatter requirements;Intl.RelativeTimeFormat,Intl.ListFormat, andIntl.DisplayNamesare needed only when using those helpers;formatRangeandformatRangeToPartsavailability depends on the hostIntl.DateTimeFormatimplementation.
Applications targeting older browsers should provide the standard JavaScript and Intl polyfills required by their own support matrix. The repository smoke test executes the packed SDK in the latest available Chrome rather than promising output parity with historical browser ICU releases. Unsupported optional formatter families emit unsupported_formatter so an application can monitor gaps without changing condition or translation semantics.
The Java SDK requires Java 17 or newer and uses ICU4J. Exact localized formatter strings may differ from JavaScript when the installed ICU/CLDR data differs; the portable conformance contract deliberately excludes those presentation-level differences.
The Swift SDK supports the Apple platforms declared in its package and uses Foundation's native locale data. Reviewed differences remain explicit in project test expectations rather than being hardcoded into the SDK.
Datafile compatibility#
SDKs consume datafiles generated by the Messagevisor CLI. The datafile's schemaVersion describes its shape, while messagevisorVersion records the installed CLI version that generated it. Keep the CLI and SDK on compatible release lines when adopting breaking schema changes.
For cross-language SDK work, the JavaScript SDK is the behavioral source of truth and the repository's versioned portable conformance fixture defines the shared cases that every SDK should execute. Fixture revision 3 covers condition and segment semantics, the accepted regular expression subset, fallback order, override behavior, datafile merge and replacement, diagnostic envelopes, module cleanup, state-event ordering, and child-owned parent-datafile event snapshots. It does not guarantee byte-identical localized output across host ICU or CLDR versions.