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:
committed by
Facebook Github Bot
parent
4dbf51f28c
commit
a6fb1a9d86
8
src/fb-stubs/Prefetcher.js
Normal file
8
src/fb-stubs/Prefetcher.js
Normal 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() {}
|
||||||
@@ -13,6 +13,7 @@ import GK from './fb-stubs/GK.js';
|
|||||||
import {init as initLogger} from './fb-stubs/Logger';
|
import {init as initLogger} from './fb-stubs/Logger';
|
||||||
import App from './App.js';
|
import App from './App.js';
|
||||||
import BugReporter from './fb-stubs/BugReporter.js';
|
import BugReporter from './fb-stubs/BugReporter.js';
|
||||||
|
import setupPrefetcher from './fb-stubs/Prefetcher.js';
|
||||||
import {createStore} from 'redux';
|
import {createStore} from 'redux';
|
||||||
import {persistStore} from 'redux-persist';
|
import {persistStore} from 'redux-persist';
|
||||||
import reducers from './reducers/index.js';
|
import reducers from './reducers/index.js';
|
||||||
@@ -68,6 +69,10 @@ function init() {
|
|||||||
initLauncherHooks(config(), store);
|
initLauncherHooks(config(), store);
|
||||||
const sessionId = store.getState().application.sessionId;
|
const sessionId = store.getState().application.sessionId;
|
||||||
initCrashReporter(sessionId || '');
|
initCrashReporter(sessionId || '');
|
||||||
|
|
||||||
|
requestIdleCallback(() => {
|
||||||
|
setupPrefetcher();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// rehydrate app state before exposing init
|
// rehydrate app state before exposing init
|
||||||
|
|||||||
Reference in New Issue
Block a user