Add prefetcher mercurial setup code

Summary:
Logic for installing an uninstalling a custom `post-update` mercurial hook, invoking the script introduced in the previous diff.

This is to gather some early data before rolling this integration out more broadly, i.e. through the mercurial distribution.

Reviewed By: jknoxville

Differential Revision: D16283081

fbshipit-source-id: e8610509e5f105a9b717a881aa327bb04f9a2f4f
This commit is contained in:
Pascal Hartig
2019-07-18 02:45:01 -07:00
committed by Facebook Github Bot
parent 4dbf51f28c
commit a6fb1a9d86
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
export default async function setupPrefetcher() {}

View File

@@ -13,6 +13,7 @@ import GK from './fb-stubs/GK.js';
import {init as initLogger} from './fb-stubs/Logger';
import App from './App.js';
import BugReporter from './fb-stubs/BugReporter.js';
import setupPrefetcher from './fb-stubs/Prefetcher.js';
import {createStore} from 'redux';
import {persistStore} from 'redux-persist';
import reducers from './reducers/index.js';
@@ -68,6 +69,10 @@ function init() {
initLauncherHooks(config(), store);
const sessionId = store.getState().application.sessionId;
initCrashReporter(sessionId || '');
requestIdleCallback(() => {
setupPrefetcher();
});
}
// rehydrate app state before exposing init