Skip to content

RFC: Support customFormatter with locale specific modules #402

@cdaringe

Description

@cdaringe

Problem

The current custom formatter API does not allow me to import my runtime module with locale awareness.

Current:

export const phone: CustomFormatter = {
  // ...snip
  module: '@messageformat/phone'
};

Desired:

export const phone: CustomFormatter = {
  // ...snip
  module: (localeCode) => `@messageformat/phone/${localeCode}` // e.g. "@messageformat/phone/mx"
};

Discussion

In this respect, the generated ESM javascript can use much smaller implementations for the compilation of interest!

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