mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-12 09:20:14 +08:00
Log bundle size.
Reviewed By: javache Differential Revision: D2564757 fb-gh-sync-id: c4429b735482ee6405b936e2dcdf610e9c6ad35f
This commit is contained in:
committed by
facebook-github-bot-6
parent
394dfae868
commit
8ad09987e5
@@ -13,6 +13,7 @@
|
||||
#import "RCTConvert.h"
|
||||
#import "RCTSourceCode.h"
|
||||
#import "RCTUtils.h"
|
||||
#import "RCTPerformanceLogger.h"
|
||||
|
||||
@implementation RCTJavaScriptLoader
|
||||
|
||||
@@ -39,6 +40,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
NSData *source = [NSData dataWithContentsOfFile:filePath
|
||||
options:NSDataReadingMappedIfSafe
|
||||
error:&error];
|
||||
RCTPerformanceLoggerSet(RCTPLBundleSize, source.length);
|
||||
onComplete(error, source);
|
||||
});
|
||||
return;
|
||||
@@ -73,7 +75,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
encoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle HTTP errors
|
||||
if ([response isKindOfClass:[NSHTTPURLResponse class]] && ((NSHTTPURLResponse *)response).statusCode != 200) {
|
||||
NSString *rawText = [[NSString alloc] initWithData:data encoding:encoding];
|
||||
@@ -103,6 +104,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
onComplete(error, nil);
|
||||
return;
|
||||
}
|
||||
RCTPerformanceLoggerSet(RCTPLBundleSize, data.length);
|
||||
onComplete(nil, data);
|
||||
}];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user