-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
refactor(common): simplify closure-locale by removing imports #18926
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
You can preview a41365b at https://pr18926-a41365b.ngbuilds.io/. |
tools/gulp-tasks/cldr/closure.js
Outdated
const yargs = require('yargs').argv; | ||
const {I18N_FOLDER, I18N_DATA_FOLDER, RELATIVE_I18N_DATA_FOLDER, HEADER} = require('./extract'); | ||
const OUTPUT_NAME = `closure-locale.ts`; | ||
|
||
module.exports = (gulp, done) => { | ||
let GOOG_LOCALES; | ||
let GOOG_LOCALES = [ |
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.
explain what this table is. Should be const ?
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 a "let" because it can be overwritten by cli arguments
tools/gulp-tasks/cldr/closure.js
Outdated
'sk', 'sl', 'sq', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tl', | ||
'tr', 'uk', 'ur', 'uz', 'vi', 'zh', 'zh-CN', 'zh-HK', 'zh-TW', 'zu' | ||
]; | ||
const ALIASES = { |
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.
explain what this table is.
tools/gulp-tasks/cldr/closure.js
Outdated
|
||
l[0] = goog.LOCALE; |
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.
l might not be defined.
explain what you do with l[0] = goog.LOCALE
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.
also seems like goog.LOCALE is not normalized ? (ie - vs _)
tools/gulp-tasks/cldr/closure.js
Outdated
|
||
// to avoid duplicated "case" we regroup all locales in the same "case" | ||
// the simplest way to do that is to have alias aliases | ||
// e.g. 'no' --> 'nb', 'nb' --> 'no-NO' |
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.
don't see the loop that does that ?
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 only have one level of alias aliases, no need for a loop right now. We'll complicate the code later if necessary
a41365b
to
749dfbb
Compare
CLAs look good, thanks! |
You can preview 749dfbb at https://pr18926-749dfbb.ngbuilds.io/. |
749dfbb
to
456ecee
Compare
You can preview 456ecee at https://pr18926-456ecee.ngbuilds.io/. |
456ecee
to
1366e34
Compare
You can preview 1366e34 at https://pr18926-1366e34.ngbuilds.io/. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The current closure locale contains too many imports which slows the build for g3
What is the new behavior?
We inlined all of the locales in the closure-locale file, and closure will remove all the unnecessary data at the end of the build.
We also only used the locales that closure uses instead of all of the locales available.
Does this PR introduce a breaking change?
Other information
Do not merge this PR before #18907