facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.22k stars 24.1k forks source link

Finish implementing URL accessors like host, hostname, username, password #45030

Open kross-italk opened 4 weeks ago

kross-italk commented 4 weeks ago

Description

The window.URL object is available in Hermes but is otherwise un-implemented. All of the accessors have todo Errors. https://github.com/facebook/react-native/blob/43d69ee26cbf4d4cc9b64aafbcdc32f3df0f27f9/packages/react-native/Libraries/Blob/URL.js#L140-L230

Steps to reproduce

const urlObj = new window.URL( validUrlString );
urlObj.hostname
// Error: URL.hostname is not implemented

React Native Version

0.73.6

Affected Platforms

Runtime - Android

Output of npx react-native info

Reproducible on all systems. The code has a baked-in Error and no implementation.

Stacktrace or Logs

This error is located at:
    in SecureContext (created by Connect(SecureContext))
    in Connect(SecureContext) (created by App)
    in RCTView (created by View)
    in View (created by App)
    in App (created by RenderApp)
    in Provider (created by RenderApp)
    in RenderApp
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in app(RootComponent), js engine: hermes

Reproducer

https://snack.expo.dev/O0xP_moxLBNEHK9bXAXKl It can't be reproduced in a browser folks. It can only be seen on hermes/Android so this is moot.

Screenshots and Videos

No response

github-actions[bot] commented 4 weeks ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
kross-italk commented 4 weeks ago

⚠️ Newer Version of React Native is Available! ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please [upgrade]

Here's the latest version of the code showing the features are still un-implemented. https://github.com/facebook/react-native/blob/4cee0a4c06deb3b49c31021ea50766a4d391de1e/packages/react-native/Libraries/Blob/URL.js#L169-L219

sossost commented 4 weeks ago

@cortinico Hi I'm sossost, a new contributor. Can I try to resolve this issue??

cortinico commented 4 weeks ago

Please do 👍

Shiva710211 commented 4 weeks ago

Hi I'm Shivanand, the new contributor. Can i try to resolve this issue? Please provide me with brief information about this issue