-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replace country-regex with i18n-iso-countries #7366
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
base: master
Are you sure you want to change the base?
Conversation
thanks @dimitrov570 - I'll see if we can get this into the 3.1 release. |
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 for your contribution! I left a few comments. Could you please merge master and handle the merge conflicts?
@gvwilson there are 6 codes removed from the new package. Would this count as a breaking change? The countries don't exist anymore.
Code | Country |
---|---|
ANT | Netherlands Antilles |
CSK | Czechoslovakia |
DDR | German Democratic Republic |
EAZ | Zanzibar |
YMD | South Yemen |
YUG | Yugoslavia |
@@ -0,0 +1 @@ | |||
- Replace country-regex with i18n-iso-countries [[#7366](https://github.com/plotly/plotly.js/pull/7366)] |
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.
- Replace country-regex with i18n-iso-countries [[#7366](https://github.com/plotly/plotly.js/pull/7366)] | |
- Replace country-regex package with i18n-iso-countries [[#7366](https://github.com/plotly/plotly.js/pull/7366)] |
@@ -12,8 +11,8 @@ var isPlainObject = require('./is_plain_object'); | |||
var nestedProperty = require('./nested_property'); | |||
var polygon = require('./polygon'); | |||
|
|||
// make list of all country iso3 ids from at runtime | |||
var countryIds = Object.keys(countryRegex); | |||
const countries = require("i18n-iso-countries"); |
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.
Could you please move this require
statement above with the others?
I don't think the deleted countries counts as a breaking change. |
I clicked the wrong button. Let me know when you make changes and I'll review again. |
Resolves the issue discussed in #7026.
This implementation does not use regular expressions as before and does not contain countries that do not exist anymore, compared to the previous solution with
country-regex
. But on the other handi18n-iso-countries
seems to be updated frequently, so it will contain updated information on country codes.