-
Notifications
You must be signed in to change notification settings - Fork 37
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
Overly high JS baseline requirement, from using URL.canParse() #78
Comments
Hello, @erquhart We do not specifically support compatibility with React Native. If you can provides some details about what no longer works, we can better understand if its something we can address. |
@ibooker I don't see anything in the repo stating explicit support for any platform, browser etc., I'm just adding React Native to the list of environments for which this library no longer works. I don't have a separate issue to outline, just that the use of |
[URL.canParse][1] was only pretty recently created, and is not available in many environments. We can instead wrap a `URL` creation in a `try..catch`, as listed in MDN. Unfortunately, this is a bit slower, but at least it works almost everywhere. [1]: https://developer.mozilla.org/en-US/docs/Web/API/URL/canParse_static Fixes: braintree#78
This would have caught like braintree#78, as `URL.canParse()` was only added in Node.JS v18.17
Agree, 7.1.0 should have been released as 8.0.0; effectively dropping support for older Nodes, whether intentional or not, is a breaking change. |
Hello,
In here, the library has begun using URL.canParse():
https://github.com/braintree/sanitize-url/blame/cdd33eb72e9f56eff7b3c49f1c5ed133838b9956/src/index.ts#L24
This imposes a surprisingly strict requirement on browser versions (https://caniuse.com/?search=canParse):
As far as I can tell, it has as a result only been widely available since ~ December 2023.
I don't mind it necessarily, but it is a huge enough jump that I'd suggest making it in a major version update.
I'm not sure what the previous minimal browser version set was exactly, but at least up to iOS 14 worked, going by the browsers we had successfully tested on our own website.
The text was updated successfully, but these errors were encountered: