fix the parsing error
Summary: The headless version used to use `JSON.stringify` to serialize the output of `serializeStore` which basically transformed the store to a specific format which is serializable. But we have written the custom serialize function which cateres to the non serializable object types. Headless didn't use it, so thats why it exported Flipper trace in an unrecognizable format for the flipper. I have also renamed `serializeStore` to `prepareToSerializeStore` so that the confusion doesn't occur in future. I have used an `exportStore` function in headless which exports the store to the `Promise<String>` Reviewed By: jknoxville Differential Revision: D14480096 fbshipit-source-id: f312d7637aa082d96c3bc1dfd00eefb19182e97f
This commit is contained in:
committed by
Facebook Github Bot
parent
2813b584f6
commit
e184af7f2a
@@ -13,7 +13,7 @@ import path from 'path';
|
||||
// $FlowFixMe this file exist, trust me, flow!
|
||||
import setup from '../static/setup.js';
|
||||
import yargs from 'yargs';
|
||||
import {serializeStore} from '../src/utils/exportData.js';
|
||||
import {exportStore} from '../src/utils/exportData.js';
|
||||
|
||||
yargs
|
||||
.usage('$0 [args]')
|
||||
@@ -98,7 +98,7 @@ function startFlipper({
|
||||
dispatcher(store, logger);
|
||||
|
||||
process.on('SIGINT', async () => {
|
||||
originalConsole.log(JSON.stringify(await serializeStore(store), null, 2));
|
||||
originalConsole.log(await exportStore(store));
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user