Fix importing large Flipper exports

Reviewed By: lblasa

Differential Revision: D38945105

fbshipit-source-id: ba78ccfc82b65013b79c6c962de7bdef5ae41a60
This commit is contained in:
Andrey Goncharov
2022-08-23 09:46:29 -07:00
committed by Facebook GitHub Bot
parent 9b58f5217e
commit 5515b27499

View File

@@ -75,7 +75,13 @@ async function getKeytarModule(staticPath: string): Promise<KeytarModule> {
async function getExternalServer(path: string) {
const options = {
WebSocket: WS,
WebSocket: class WSWithUnixDomainSocketSupport extends WS {
constructor(url: string, protocols: string | string[]) {
// Flipper exports could be large, and we snd them over the wire
// Setting this limit fairly high (1GB) to allow any reasonable Flipper export to be loaded
super(url, protocols, {maxPayload: 1024 * 1024 * 1024});
}
},
};
const socket = new ReconnectingWebSocket(`ws+unix://${path}`, [], options);
const server = await createFlipperServerWithSocket(