mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +08:00
Get rid of jackson (mostly)
Reviewed By: astreet Differential Revision: D3041362 fb-gh-sync-id: a7027a08a63730b98dc766b86921820fa3624953 shipit-source-id: a7027a08a63730b98dc766b86921820fa3624953
This commit is contained in:
committed by
Facebook Github Bot 8
parent
14555063bb
commit
d329570ac8
@@ -31,9 +31,6 @@ import com.facebook.react.common.futures.SimpleSettableFuture;
|
||||
import com.facebook.systrace.Systrace;
|
||||
import com.facebook.systrace.TraceListener;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
|
||||
/**
|
||||
* This provides an implementation of the public CatalystInstance instance. It is public because
|
||||
* it is built by ReactInstanceManager which is in a different package.
|
||||
@@ -358,21 +355,24 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
private String buildModulesConfigJSONProperty(
|
||||
NativeModuleRegistry nativeModuleRegistry,
|
||||
JavaScriptModulesConfig jsModulesConfig) {
|
||||
JsonFactory jsonFactory = new JsonFactory();
|
||||
StringWriter writer = new StringWriter();
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
JsonWriter writer = new JsonWriter(stringWriter);
|
||||
try {
|
||||
JsonGenerator jg = jsonFactory.createGenerator(writer);
|
||||
jg.writeStartObject();
|
||||
jg.writeFieldName("remoteModuleConfig");
|
||||
nativeModuleRegistry.writeModuleDescriptions(jg);
|
||||
jg.writeFieldName("localModulesConfig");
|
||||
jsModulesConfig.writeModuleDescriptions(jg);
|
||||
jg.writeEndObject();
|
||||
jg.close();
|
||||
writer.beginObject();
|
||||
writer.name("remoteModuleConfig");
|
||||
nativeModuleRegistry.writeModuleDescriptions(writer);
|
||||
writer.name("localModulesConfig");
|
||||
jsModulesConfig.writeModuleDescriptions(writer);
|
||||
writer.endObject();
|
||||
return stringWriter.toString();
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException("Unable to serialize JavaScript module declaration", ioe);
|
||||
} finally {
|
||||
try {
|
||||
writer.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
return writer.getBuffer().toString();
|
||||
}
|
||||
|
||||
private void incrementPendingJSCalls() {
|
||||
|
||||
Reference in New Issue
Block a user