Enhancement
Dojo currently uses Globalize.js for the bulk of its internationalization/localization functionality, but at this point Intl is well-supported and robust enough that it can handle most use cases. For supported browsers that lack Intl support, there are shims available (Intl and Intl.RelativeFormat). With that in mind, we can remove Globalize.js, use MessageFormat internally for managing ICU message formatting, and recommend the native Intl for anything else.
This would be a breaking change, and applications that use functions like formatCurrency would need to update to their native equivalents like Intl.NumberFormat. Perhaps @dojo/cli-upgrade-app could help mitigate any manual updates
With regard to the build, conditional polyfill loading should help reduce the bundle size, but it would also be possible to pre-compile any messages and therefore eliminate most of the bulk from the MessageFormat library as well. However, doing so will be difficult without a standard means of differentiating message bundles from other files. Just as Dojo uses m.css to distinguish CSS module files from other CSS files, perhaps a similar approach could be used for localized message files. The build would then pre-compile the messages in these files and MessageFormat could be ignored entirely. More discussion is needed here.
Enhancement
Dojo currently uses Globalize.js for the bulk of its internationalization/localization functionality, but at this point
Intlis well-supported and robust enough that it can handle most use cases. For supported browsers that lackIntlsupport, there are shims available (IntlandIntl.RelativeFormat). With that in mind, we can remove Globalize.js, use MessageFormat internally for managing ICU message formatting, and recommend the nativeIntlfor anything else.This would be a breaking change, and applications that use functions like
formatCurrencywould need to update to their native equivalents likeIntl.NumberFormat. Perhaps@dojo/cli-upgrade-appcould help mitigate any manual updatesWith regard to the build, conditional polyfill loading should help reduce the bundle size, but it would also be possible to pre-compile any messages and therefore eliminate most of the bulk from the MessageFormat library as well. However, doing so will be difficult without a standard means of differentiating message bundles from other files. Just as Dojo uses
m.cssto distinguish CSS module files from other CSS files, perhaps a similar approach could be used for localized message files. The build would then pre-compile the messages in these files andMessageFormatcould be ignored entirely. More discussion is needed here.