Uh oh!
There was an error while loading. Please reload this page.
Intl.NumberFormat: Add latest options, fix previous library discrepancies - #56902
Conversation
- move properties to correct spec versions - non-optional ResolvedNumberFormatOptions properties
Uh oh!
There was an error while loading. Please reload this page.
a433b81 to
0b137b9CompareAs per ECMA-402 v10 / 15.1.2 microsoft#22-28 Boolean(true), Boolean(false), String("true") and String("false") all have different behaviour, for reasons known unto God
Includes test for conditional useGrouping override in lib.es5.d.ts
Remove redundant/outdated esnext.bigint test CRLF
René (Renegade334)
commented
Jan 2, 2024
This should be ready for review. Context for some less-obvious changes:
I'd be grateful if someone could run top100/dt when convenient. |
TypeScript Bot (typescript-bot)
commented
Jan 2, 2024
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at 90b7d94. You can monitor the build here. Update: The results are in! |
Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 90b7d94. You can monitor the build here. |
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
TypeScript Bot (typescript-bot)
commented
Jan 4, 2024
Jake Bailey (@jakebailey) Here they are:CompilerComparison Report - baseline..pr
System info unknown Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Jan 4, 2024
Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Jan 4, 2024
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. |
TypeScript Bot (typescript-bot)
commented
Jan 4, 2024
Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing Everything looks good! |
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
I think this is good to go, although I'd like to wait until after the beta.
The only question I have is about any as the property type for registries. Everything else is notes for myself about the combined members of registries.
Uh oh!
There was an error while loading. Please reload this page.
| const PluralRules: PluralRulesConstructor; | ||
| // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here: | ||
| type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name"; |
There was a problem hiding this comment.
NumberFormatPartTypeRegistry
ES2018
- literal
- nan
- infinity
- percent
- integer
- group
- decimal
- fraction
- plusSign
- minusSign
- percentSign
- currency
ES2020
- compact
- exponentInteger
- exponentMinusSign
- exponentSeparator
- unit
- unknown
| declare namespace Intl { | ||
| interface NumberFormat { | ||
| format(value: number | bigint): string; | ||
| resolvedOptions(): ResolvedNumberFormatOptions; |
There was a problem hiding this comment.
duplicated with entry in es5, doesn't need to be here
| exceptZero: any; | ||
| } | ||
| type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry; |
There was a problem hiding this comment.
ES2020
- auto
- never
- always
- exceptZero
ES2023
- negative
| currency: any; | ||
| } | ||
| type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry; |
There was a problem hiding this comment.
ES5
- decimal
- percent
- currency
ES2020
- unit
| name: any; | ||
| } | ||
| type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry; |
There was a problem hiding this comment.
ES5
- code
- symbol
- name
ES2020
- narrowSymbol
| type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry; | ||
| interface NumberFormatOptionsUseGroupingRegistry {} |
There was a problem hiding this comment.
ES2023
- min2
- auto
- always
Updated the registry interfaces as discussed. I've also included one other minor change. The defined behaviour of the resolved options |
TypeScript Bot (@typescript-bot) test top200 |
Heya Nathan Shively-Sanders (@sandersn), I've started to run the parallelized Definitely Typed test suite on this PR at 254a8ce. You can monitor the build here. Update: The results are in! |
Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based user code test suite on this PR at 254a8ce. You can monitor the build here. Update: The results are in! |
Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based top-repos suite on this PR at 254a8ce. You can monitor the build here. Update: The results are in! |
TypeScript Bot (typescript-bot)
commented
Feb 16, 2024
Nathan Shively-Sanders (@sandersn) Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Feb 16, 2024
Hey Nathan Shively-Sanders (@sandersn), the results of running the DT tests are ready. |
TypeScript Bot (typescript-bot)
commented
Feb 17, 2024
Nathan Shively-Sanders (@sandersn) Here are the results of running the top-repos suite comparing Everything looks good! |
Felix Becker (felixfbecker)
commented
Mar 1, 2024
Can't wait for this to land! |
I forgot to check whether CI had run recently when I merged, and this PR adds a new section to every resolution trace baseline.
Fixes#56269
Fixes#52072
Fixes#43336
keyof <RegistryInterface>in order to make them extensible, as per precedent. This is technically breaking, and will likely need to be tested against high-exposure libraries for side-effects.useGroupingis a bit of a mess, as the property's primitive type was changed in version 10. The inclusion of"true"and"false"as acceptable values in the es2023 implementation is intentional, as per the specification.