You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WinterTC Minimum Common Web Platform API Alignment #10297
Is your feature request related to a problem? Please describe.
In addition to what the NativeScript runtimes provide, they should also provide all the common interfaces and global objects expected from any state of the art JavaScript runtime. WinterCG is a community group doing excellent work in this space to help runtime interoperability of APIs across runtimes.
@NathanWalker I've a question about the polyfills that will be eventually implemented. I see that in the list above there's no mention of Intl API. My main point of interest is the NumberFormat class, as currently to support number formatting via .toLocaleString(), or be to able to use formatToParts(), polyfills have to be used (such as format js polyfills).
Is this something out of scope for this update please?
@NathanWalker Interesting to note (if only for others searching issues like me) that Intl.NumberFormat() partially works in the NativeScript runtime currently, making it seem buggy.
I was attempting to use it to detect whether a dot or comma thousands separator should be used, but NativeScript always formats with a , thousands separator (for every locale I've tried), whereas the same code in Chrome on MacOS will use a dot thousands separator when appropriate for the locale.
// const locale = Device.language; // e.g. 'en-US'// const locale = 'pt-BR'; // should use dot as thousands separatorconstlocale='NL';// should use dot as thousands separator// Format a number and extract the thousand separatorconstnumberFormat=newIntl.NumberFormat(locale);constformattedNumber=numberFormat.format(1_000);constthousandSeparator=formattedNumber.charAt(1);console.log('locale',locale);console.log(`Formatted Number: ${formattedNumber}`);console.log(`Thousand Separator: ${thousandSeparator}`);
Activity
MrSnoozles commentedon Feb 24, 2024
@NathanWalker I needed
queueMicrotaskfor the latest Vue Apollo Client to work. I polyfilled it usingwhich works perfectly. The
queue-microtasklibrary is effectively 5 lines of code, so that could be added easily as well.dangrima90 commentedon Feb 26, 2024
@NathanWalker I've a question about the polyfills that will be eventually implemented. I see that in the list above there's no mention of
IntlAPI. My main point of interest is theNumberFormatclass, as currently to support number formatting via.toLocaleString(), or be to able to useformatToParts(), polyfills have to be used (such as format js polyfills).Is this something out of scope for this update please?
NathanWalker commentedon May 6, 2024
@dangrima90
Intlwill be an optional package you could include when your app needs it vs. being built into runtime by default.jasongitmail commentedon Jul 19, 2024
@NathanWalker Interesting to note (if only for others searching issues like me) that
Intl.NumberFormat()partially works in the NativeScript runtime currently, making it seem buggy.I was attempting to use it to detect whether a dot or comma thousands separator should be used, but NativeScript always formats with a
,thousands separator (for every locale I've tried), whereas the same code in Chrome on MacOS will use a dot thousands separator when appropriate for the locale.Expected result (Chrome MacOS)
[-]WinterCG Minimum Common Web Platform API Alignment[/-][+]WinterTC Minimum Common Web Platform API Alignment[/+]