Skip to content
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

Libphonenumber.js file from google is outdated. #216

Closed
superhit0 opened this issue Jun 12, 2018 · 8 comments
Closed

Libphonenumber.js file from google is outdated. #216

superhit0 opened this issue Jun 12, 2018 · 8 comments

Comments

@superhit0
Copy link
Collaborator

It does not include the new phone number series and shows them as invalid.

For example, Mobile numbers starting from 6 like 6xxxxxxxxx are considered invalid for India, but they are actually valid and if you try to validate from googlei18n/libphonenumber directly, it says as valid.

Also, can you also share the process for building the libphonenumber file in the repository, it is not same as the demo.js from the google's repository.

If possible, I would like to raise a PR for this.

@patw0929
Copy link
Owner

Actually the libphonenumber.js is copied from intl-tel-input's compiled utils.js. The original source is compile from src/js/utils.js, but unfortunately the content is not compatible with current react-intl-tel-input.

It will be great If you or someone can help to figure the correct way to compile the newest utils.js and make it compatible. Thanks!

@superhit0
Copy link
Collaborator Author

@patw0929 Can you please look at this PR #220?

Upgrading the version to 8.9.9.

This solves the current issue.

@patw0929
Copy link
Owner

Cool. I'm curious about the difference of intl-tel-input's compiled version? If we need to update next version next time, what should we do?

@superhit0
Copy link
Collaborator Author

superhit0 commented Jun 30, 2018

@patw0929
If you want to upgrade the complied version, you have to compile it manually and add it to the repository.
As you have to use closure-complier , to compile this file.

@patw0929
Copy link
Owner

Oh, thanks, I knew this part.

What I am curious about is the difference between #220 and the compiled utils.js in intl-tel-input's reoo.
I've tried to copy the intl-tel-input's compiled version long time ago, but seems some function is not exist then causing some issues.

However it seems no problem now :P
Will check and merge the PR later if everything is ok.

@superhit0
Copy link
Collaborator Author

superhit0 commented Jun 30, 2018

@patw0929 Since, libphonenumber@8.7.0 present currently in the repo, the libphonenumber in #220 has updated metadata. By metadata, I mean the phone numbers regex and other stuffs.

One use case difference is in funtionality is -
Mobile numbers starting from 6 like 6xxxxxxxxx are considered invalid for India according to libphonenumber@8.7.0, but they are actually valid and if you try to validate from libphonenumber@8.9.9, it says as valid. Which is correct as Mobile numbers of pattern 6xxxxxxxxx were recently added by government in last few months & google has updated them in latest version of libphonenumber@8.9.9

@patw0929
Copy link
Owner

Thank you for the contribution!
Merged & published as v5.0.7.

@superhit0
Copy link
Collaborator Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants