Remove SourceCode.getScriptText

Summary:
After cleaning up JS SourceMap code, these native methods are not needed anymore.

On iOS it saves another 30+ Mb during development.

Reviewed By: javache, astreet

Differential Revision: D3348975

fbshipit-source-id: a68ae9b00b4dbaa374b421029ae676fc69ae5a75
This commit is contained in:
Alex Kotliarskyi
2016-06-07 11:07:53 -07:00
committed by Facebook Github Bot 2
parent a7404713a4
commit f3fab5184e
5 changed files with 2 additions and 32 deletions

View File

@@ -455,7 +455,6 @@ RCT_EXTERN NSArray<Class> *RCTGetModuleClasses(void);
RCTSourceCode *sourceCodeModule = [self moduleForClass:[RCTSourceCode class]];
sourceCodeModule.scriptURL = self.bundleURL;
sourceCodeModule.scriptData = sourceCode;
[self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:^(NSError *loadError) {
if (!_valid) {

View File

@@ -13,7 +13,6 @@
@interface RCTSourceCode : NSObject <RCTBridgeModule>
@property (nonatomic, copy) NSData *scriptData;
@property (nonatomic, copy) NSURL *scriptURL;
@end

View File

@@ -20,23 +20,6 @@ RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
#if !RCT_DEV
- (void)setScriptText:(NSString *)scriptText {}
#endif
NSString *const RCTErrorUnavailable = @"E_SOURCE_CODE_UNAVAILABLE";
RCT_EXPORT_METHOD(getScriptText:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject)
{
if (RCT_DEV && self.scriptData && self.scriptURL) {
NSString *scriptText = [[NSString alloc] initWithData:self.scriptData encoding:NSUTF8StringEncoding];
resolve(@{@"text": RCTNullIfNil(scriptText), @"url": self.scriptURL.absoluteString});
} else {
reject(RCTErrorUnavailable, nil, RCTErrorWithMessage(@"Source code is not available"));
}
}
- (NSDictionary<NSString *, id> *)constantsToExport
{
NSString *URL = self.bridge.bundleURL.absoluteString ?: @"";