Skip to content

Commit eb92f81

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
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
1 parent 2e8ecab commit eb92f81

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

React/Base/RCTDefines.h

+7
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@
8989
#endif
9090
#endif
9191

92+
/**
93+
* Add the default packager name
94+
*/
95+
#ifndef RCT_PACKAGER_NAME
96+
#define RCT_PACKAGER_NAME @"Metro"
97+
#endif
98+
9299
/**
93100
* By default, only raise an NSAssertion in debug mode
94101
* (custom assert functions will still be called).

React/DevSupport/RCTDevLoadingView.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,22 @@ - (void)showWithURL:(NSURL *)URL
130130
{
131131
UIColor *color;
132132
UIColor *backgroundColor;
133-
NSString *source;
133+
NSString *message;
134134
if (URL.fileURL) {
135135
// If dev mode is not enabled, we don't want to show this kind of notification
136136
#if !RCT_DEV
137137
return;
138138
#endif
139-
color = [UIColor grayColor];
139+
color = [UIColor whiteColor];
140140
backgroundColor = [UIColor blackColor];
141-
source = @"pre-bundled file";
141+
message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
142142
} else {
143143
color = [UIColor whiteColor];
144144
backgroundColor = [UIColor colorWithHue:1./3 saturation:1 brightness:.35 alpha:1];
145-
source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port];
145+
message = [NSString stringWithFormat:@"Loading from %@:%@...", URL.host, URL.port];
146146
}
147147

148-
[self showMessage:[NSString stringWithFormat:@"Loading from %@...", source]
148+
[self showMessage:message
149149
color:color
150150
backgroundColor:backgroundColor];
151151
}

0 commit comments

Comments
 (0)