-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fixed missing encoding via URLSearchParams #29834
Conversation
Base commit: b5b4a70 |
Base commit: b5b4a70 |
I would highly recommend migrating over to Actually, I should deprecate React Native's |
@charpeni I'm not sure what you are saying. Nothing is hard-coded about the PR or implementation and this solves an immediate issue with have the implementation. Unless we can integrate a polyfill from react-native-url-polyfill that ships with React Native, I don't see the point of removing it. We'd be needlessly breaking a lot of code bases for no good reason. The feature is helpful it just has this 1 very important bug. |
Hey @scarlac. Sorry for the confusion here, your pull request is definitely the right implementation. The hard-coded things are coming from React Native itself which is trying to define its own implementation of I'm not against merging this PR, though. I think it's a safe™ and nice fix, just flagging the issue with those. What I'm advocating for, is to deprecate RN's Why we can't ship React Native with How does that sound? |
@charpeni Yeah it looks like it's ~40k extra. I don't like it but it's a reasonable trade-off. Agree with your approach then. Thanks for the thorough explanation. |
Closing this PR. As per @charpeni 's recommendation an app-installed polyfill is preferred and we should be removing the existing implementation. |
Fixes #28966
Summary
URLSearchParams was largely useless, as it did not encode the parameters at all. This PR simply encodes the parameters as per the standard.
Changelog
[General] [Fixed] - URLSearchParams now URL encodes passed values
Test Plan
Ran the new code using jsc (
/System/iOSSupport/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Helpers/jsc
)And compared it running similar code but with a browser-shipped URLSearchParams in the browser console of this page:
Comparing the two: