You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emit JSC-safe URLs in HMR, //# sourceURL, Content-Location (#989)
Summary:
Pull Request resolved: #989
The remaining Metro part of the implementation of react-native-community/discussions-and-proposals#646, to fix (along with an RN change):
- facebook/react-native#36794 and
- expo/expo#22008
This ensures that Metro always and consistently emits "JSC-safe" (i.e., `//&` query-delimited) URLs where they are used as a "source URL" for evaluated JS. This includes:
- `sourceURL` within the JSON HMR payload (`HmrModule`)
- `//# sourceURL` comments within the body of a base or HMR bundle
- The new `Content-Location` header delivered in response to an HTTP bundle request.
Clients will be expected to use these as source URL arguments to JS engines, in preference to the URL on which they might have connected/requested the bundle originally.
```
* **[Fix]**: Emit source URLs in a format that will not be stripped by JavaScriptCore
```
Reviewed By: GijsWeterings
Differential Revision: D45983876
fbshipit-source-id: 3e7f0118091424b9c1b1d40e4eb7baeb5be1f48f
0 commit comments