From eb92f8181f3119bbc69ff7cb5aff2e03d993b8b3 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 7 Aug 2019 09:24:42 -0700 Subject: [PATCH] Update loading pre-bundled message Summary: Updated the message from > Loading from pre-bundled file to > Connect to Metro to develop JavaScript I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro" Reviewed By: yungsters, cpojer Differential Revision: D16427501 fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7 --- React/Base/RCTDefines.h | 7 +++++++ React/DevSupport/RCTDevLoadingView.m | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/React/Base/RCTDefines.h b/React/Base/RCTDefines.h index dfc7203d902a5c..88de9d18a89e56 100644 --- a/React/Base/RCTDefines.h +++ b/React/Base/RCTDefines.h @@ -89,6 +89,13 @@ #endif #endif +/** + * Add the default packager name + */ +#ifndef RCT_PACKAGER_NAME +#define RCT_PACKAGER_NAME @"Metro" +#endif + /** * By default, only raise an NSAssertion in debug mode * (custom assert functions will still be called). diff --git a/React/DevSupport/RCTDevLoadingView.m b/React/DevSupport/RCTDevLoadingView.m index 6f7670b322e364..ec53d8a98d7618 100644 --- a/React/DevSupport/RCTDevLoadingView.m +++ b/React/DevSupport/RCTDevLoadingView.m @@ -130,22 +130,22 @@ - (void)showWithURL:(NSURL *)URL { UIColor *color; UIColor *backgroundColor; - NSString *source; + NSString *message; if (URL.fileURL) { // If dev mode is not enabled, we don't want to show this kind of notification #if !RCT_DEV return; #endif - color = [UIColor grayColor]; + color = [UIColor whiteColor]; backgroundColor = [UIColor blackColor]; - source = @"pre-bundled file"; + message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME]; } else { color = [UIColor whiteColor]; backgroundColor = [UIColor colorWithHue:1./3 saturation:1 brightness:.35 alpha:1]; - source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port]; + message = [NSString stringWithFormat:@"Loading from %@:%@...", URL.host, URL.port]; } - [self showMessage:[NSString stringWithFormat:@"Loading from %@...", source] + [self showMessage:message color:color backgroundColor:backgroundColor]; }