-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 213 Number: Integer and fraction digits format #209
Conversation
"cldr", | ||
"../globalize" | ||
], factory ); | ||
} else if ( typeof module === "object" && typeof module.exports === "object" ) { |
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.
What UMD version is this based on? Neither current returnExports nor commonjsStrict use this check.
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.
Related discussion: qunitjs/qunit#540
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.
It's based on https://github.com/jquery/jquery/blob/6de1d973a436282af7dfe3072924016c3cdc1984/src/intro.js, but skipping their window concerns. But, to be honest I didn't investigate why Core is following this approach instead of any of the UMDs you pointed out above.
On qunitjs/qunit#540, where can I find more info regarding "From previous chats with @jdalton, I believe there are a few more variations necessary to thoroughly export for all CommonJS environments, none of which require a nodeType check AFAIR"?
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.
The gist is
if (checkForAMDFirst) {
// amd define stuff
}
else if (freeExports && freeModule) {
if (moduleExports) {
// the reason you bolt `myFunc` onto `myFunc` is for
// consistent use in environments without `module.exports`
(freeModule.exports = myFunc).myFunc = ,myFunc;
}
else {
freeExports.myFunc = myFunc;
}
}
else {
// in a browser
root.myFunc = myFunc;
}
The detection and assignment of checkForAMDFirst
, freeExports
, freeModule
, moduleExports
will vary.
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.
Thanks @jdalton.
@jzaefferer, which UMD wrapper do you think we should use?
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.
We need something that we can test. There's some progress in that regard in here, though its still far from done: https://github.com/jquery/qunit/pull/540/files
I think for now our best bet is to stick with an appropriate UMD wrapper and let them figure out the compatibility issues.
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.
I agree. So, I'm picking the returnExports flavor, and I've opened issue #221 to keep track of this change.
Took me a while to figure out that I have to both |
@jzaefferer, I agree that triggering |
The bowercopy command wouldn't be part of the build. It'd be a standalone command that you would run manually. |
What's the gain then by replacing |
On UI we use that to update the files in I don't know how useful that will be here though, it was a suggestion, not a requirement. |
Ok. Thanks. |
Implement integer and fraction digits format Allow Globalize.format() to override locale for the following options: - Minimum integer digits `minimumIntegerDigits`; - Minimum fraction digits `minimumFractionDigits`; - Maximum fraction digits `maximumFractionDigits`; Number format setup is performed by numberFormatProperties(). Number format execution is performed by numberFormat(). This arrangement allows subsequent setup caching for improved performance. Yet this implementation doesn't follow ECMA-402, it's been based on Intl.NumberFormat instance properties. It accepts the following `round` options: - "ceil"; - "floor"; - "round" (default); - "truncate"; Ref gh-200 Closes gh-209, gh-213
Number format setup is performed by numberFormatProperties(). Number format execution is performed by numberFormat(). This arrangement allows subsequent setup caching for improved performance. Yet this implementation doesn't follow ECMA-402, it's been based on Intl.NumberFormat instance properties. Implement integer and fraction digits format Allow the following integer and fraction override options: - Minimum integer digits `minimumIntegerDigits`; - Minimum fraction digits `minimumFractionDigits`; - Maximum fraction digits `maximumFractionDigits`; It accepts the following `round` options: - "ceil"; - "floor"; - "round" (default); - "truncate"; Ref gh-200 Closes gh-209, gh-213
Number format setup is performed by numberFormatProperties(). Number format execution is performed by numberFormat(). This arrangement allows subsequent setup caching for improved performance. Yet this implementation doesn't follow ECMA-402, it's been based on Intl.NumberFormat instance properties. Implement integer and fraction digits format. Allow the following integer and fraction override options: - Minimum integer digits `minimumIntegerDigits`; - Minimum fraction digits `minimumFractionDigits`; - Maximum fraction digits `maximumFractionDigits`; It accepts the following `round` options: - "ceil"; - "floor"; - "round" (default); - "truncate"; Ref gh-200 Closes gh-209, gh-213
Create initial number module. Number format setup is performed by numberFormatProperties(). Number format execution is performed by numberFormat(). This arrangement allows subsequent setup caching for improved performance. Yet this implementation doesn't follow ECMA-402, it's been based on Intl.NumberFormat instance properties. Implement integer and fraction digits format. Allow the following integer and fraction override options: - Minimum integer digits `minimumIntegerDigits`; - Minimum fraction digits `minimumFractionDigits`; - Maximum fraction digits `maximumFractionDigits`; It accepts the following `round` options: - "ceil"; - "floor"; - "round" (default); - "truncate"; Ref gh-200 Closes gh-209, gh-213
Implements #213