Skip to content

Start using proper URL objects instead of string concatenation #4081

Closed
@chrisbobbe

Description

@chrisbobbe

EDIT: Blocked on #3781, the RN 0.61 upgrade, unfortunately; see my comments here, up until #4081 (comment), below. Looks like this is unblocked; see #4081 (comment) for a way to avoid depending on a file newly introduced in RN v0.61.


Arising especially from #3819 (comment), #3819 (comment), and #3567 (comment), which all deal with something going wrong with constructing URLs, here's an issue for using something more reliable and consistent than string concatenation and various regexes.

Issues like #4058 may benefit from this too?

#4082 is a workaround that has our first TODO pointing to the eventual resolution of this issue.

It looks like React Native has a polyfill for the URL Web API, but it's been cut down to reduce JS bundle size. https://github.com/charpeni/react-native-url-polyfill#why-do-we-need-this is a more complete polyfill (it says it would add 73.41 KB to the bundle), and it lists some bugs that people have run into with React Native core's polyfill.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions