-
Notifications
You must be signed in to change notification settings - Fork 87
feat(conditionalIntl): added env var for Itnl #1258
feat(conditionalIntl): added env var for Itnl #1258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also requires changes to one-app-ducks
to prevent loading intl polyfill locale packs when using native Intl https://github.com/americanexpress/one-app-ducks/blob/main/src/intl/index.js#L436
@timBarton96 one-app-ducks@4.5.0 has been released. Please include this upgrade in this PR! |
Head branch was pushed to by a user without write access
617ec89
808d2ec
to
a5a231b
Compare
@@ -236,6 +240,12 @@ export function getHead({ | |||
`; | |||
} | |||
|
|||
export function renderEnvironmentVariables(nonce) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a naming nitpick, renderEnvironmentVariables
indicates that its a standard practice to include, right now this is okay but could lead to issues in the future
Description
Added an environment variable to conditionally add the lean-intl polyfill.
Motivation and Context
The lean-intl polyfill is missing Intl fetres and this PR is for consumers of one-app that want to trade compatibility with older browsers for these Intl features. The environment variable defaults to enable lean-intl polyfill, so needs to be explicitly be disabled. By disalbing the polyfill, the Intl implementations of the browsers are used and for modern browsers, this means extended functionality.
How Has This Been Tested?
I served a test-module which uses Luxon which uses Intl for its timezones functionality. The timezones would not work without the env var, but when the env var is enabled and there is no lean-intl the timezones work.
Types of Changes
Checklist:
What is the Impact to Developers Using One App?
Developers will now have the option to opt out of using lean-intl.