-
Notifications
You must be signed in to change notification settings - Fork 220
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
Remove the dependency on window
#348
Comments
@patw0929 I was wondering if you had any thoughts on this. From what I saw, the original We could still pull the same data, but have pure JS business logic and a build process that bundles it nicely. It would certain make the whole thing more accessible ( |
I am experiencing segfaults in my CI/CD, probably because of this dynamic import as shown in nodejs/node#27492. |
@mcataford I tried to make it easier to use & maintain (and keeping the functionality) before, but no luck (and no time). Again, thank you for the continued contributions! 🙇 |
I quickly surveyed the landscape of |
Phone number validation happens via utilities that are asynchronously loaded into
window
bylibphonenumber-js-utils
. This has been shown to cause problems in certain test runners (#347) and is generally a practice that should be avoided because it puts critical business logic in a place that the library has very little control over (thewindow
global).This issue exists to track refactoring work around not having that asynchronous dependency.
Expected Behavior
The library should not rely on
window
for critical functionality and should not asynchronously import packages.Current Behavior
libphonenumber-js-utils
is imported asynchronously for its side-effects, and critical logic is held inwindow
.Possible Solution
Refactor both
react-intl-tel-input
andlibphonenumber-js-utils
so that there is a synchronous path to import and use those utilities without relying onwindow
as a communications channel.Environment
(Presumably) All.
(Presumably) All.
The text was updated successfully, but these errors were encountered: