Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/metro-config/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
'/node_modules/react-refresh/.+\\.js$',
'/node_modules/scheduler/.+\\.js$',
'^\\[native code\\]$',
].join('|'),
]
// Make patterns work with both Windows and POSIX paths.
.map(pathPattern => pathPattern.replaceAll('/', '[/\\\\]'))
.join('|'),
);

export {mergeConfig} from 'metro-config';
Expand Down
8 changes: 8 additions & 0 deletions packages/react-native/React/Base/RCTBundleURLProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#import "RCTDefines.h"
#import "RCTLog.h"

#import <jsinspector-modern/InspectorFlags.h>

NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProviderUpdatedNotification";

const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;
Expand Down Expand Up @@ -281,6 +283,12 @@ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
[[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
[[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
];
auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance();
if (inspectorFlags.getEnableModernCDPRegistry()) {
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"excludeSource" value:@"true"]];
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"sourcePaths"
value:@"url-server"]];
}

NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
if (bundleID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,20 @@ private String createBundleURL(
String mainModuleID, BundleType type, String host, boolean modulesOnly, boolean runModule) {
boolean dev = getDevMode();
return String.format(
Locale.US,
"http://%s/%s.%s?platform=android&dev=%s&lazy=%s&minify=%s&app=%s&modulesOnly=%s&runModule=%s",
host,
mainModuleID,
type.typeID(),
dev, // dev
dev, // lazy
getJSMinifyMode(),
mPackageName,
modulesOnly ? "true" : "false",
runModule ? "true" : "false");
Locale.US,
"http://%s/%s.%s?platform=android&dev=%s&lazy=%s&minify=%s&app=%s&modulesOnly=%s&runModule=%s",
host,
mainModuleID,
type.typeID(),
dev, // dev
dev, // lazy
getJSMinifyMode(),
mPackageName,
modulesOnly ? "true" : "false",
runModule ? "true" : "false")
+ (InspectorFlags.getEnableModernCDPRegistry()
? "&excludeSource=true&sourcePaths=url-server"
: "");
}

private String createBundleURL(String mainModuleID, BundleType type) {
Expand Down