mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
fix(android): support unstable_path query param in asset URLs (#55072)
Summary: Syncs `getAndroidResourceIdentifier` implementations between [`/community-cli-plugin/src/commands/bundle/assetPathUtils.js`](https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/bundle/assetPathUtils.js#L72-L79) and [`/assets/path-support.js`](https://github.com/facebook/react-native/blob/main/packages/assets/path-support.js#L77-L85). Ideally, the former should use `react-native/assets-registry` directly so we don't need to sync. ## Changelog: [ANDROID] [FIXED] - Handle `unstable_path` query param in asset URLs Pull Request resolved: https://github.com/facebook/react-native/pull/55072 Test Plan: n/a Reviewed By: javache Differential Revision: D90267467 Pulled By: Abbondanzo fbshipit-source-id: f4eb0053c6af02b67f3fb493ae76e290d6b354e5
This commit is contained in:
1 parent
0d27aedb73
commit
42986f27a0
1 file changed
+1
-1
@@ -75,7 +75,7 @@ function getResourceIdentifier(asset: PackagerAsset): string {
|
||||
.toLowerCase()
|
||||
.replace(/\//g, '_') // Encode folder structure in file name
|
||||
.replace(/([^a-z0-9_])/g, '') // Remove illegal chars
|
||||
.replace(/^assets_/, ''); // Remove "assets_" prefix
|
||||
.replace(/^(?:assets|assetsunstable_path)_/, ''); // Remove "assets_" or "assetsunstable_path_" prefix
|
||||
}
|
||||
|
||||
function getBasePath(asset: PackagerAsset): string {
|
||||
|
||||
Reference in new issue
Block a user