Skip to content

Commit

Permalink
Update loading pre-bundled message
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed Aug 7, 2019
1 parent 2e8ecab commit eb92f81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions React/Base/RCTDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
10 changes: 5 additions & 5 deletions React/DevSupport/RCTDevLoadingView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit eb92f81

Please sign in to comment.