Skip to content

Conversation

greghuels
Copy link
Contributor


labels: mergeable

Fixes: FF-4133

Motivation and Context

There are a number of issues with the URL implementation in React Native's Heremes JavaScript engine:

Description

This PR bans usages of URL via eslint and removes the current usage so that it instead uses URLSearchParams.

How has this been tested?

Tested locally in React Native 0.72

@greghuels greghuels requested review from aarsilv and typotter March 14, 2025 15:55
Comment on lines -55 to -59
const urlWithNoTrailingSlash = (url: URL) => {
// Note: URL.pathname does not exist in some React Native JS runtime
// so we have to do string manipulation on the stringified URL
return url.toString().replace(/\/\?/, '?').replace(/\/$/, '');
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the trailing-slash band-aid fix. It worked for this situation, but doesn't account for future usages of URL.

@greghuels greghuels merged commit a077817 into main Mar 14, 2025
8 checks passed
@greghuels greghuels deleted the greg/FF-4133/ban-url branch March 14, 2025 16:07
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

Successfully merging this pull request may close these issues.

2 participants