Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/872 Move all the JS code related to desktop app to "desktop" subfolder. The structure of "desktop" folder: - `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins". - `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process - `pkg` - Flipper packaging lib and CLI tool - `doctor` - Flipper diagnostics lib and CLI tool - `scripts` - Build scripts for Flipper desktop app - `headless` - Headless version of Flipper app - `headless-tests` - Integration tests running agains Flipper headless version Reviewed By: passy Differential Revision: D20249304 fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
97 lines
2.2 KiB
HTML
97 lines
2.2 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="style.css">
|
|
<link rel="stylesheet" href="graphiql/graphiql.css">
|
|
<link rel="stylesheet" href="vis/vis.min.css">
|
|
<title>Flipper</title>
|
|
|
|
<style>
|
|
|
|
#loading {
|
|
-webkit-app-region: drag;
|
|
z-index: 999999;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
padding: 50px;
|
|
overflow: auto;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 20px;
|
|
color: #525252;
|
|
text-align: center;
|
|
}
|
|
|
|
.__infinity-dev-box-error {
|
|
background-color: #000;
|
|
font-family: monospace;
|
|
white-space: pre;
|
|
font-size: 16px;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="root">
|
|
<div id="loading">
|
|
Loading...
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="__infinity-dev-box __infinity-dev-box-error" hidden>
|
|
|
|
</div>
|
|
|
|
<script src="/socket.io/socket.io.js"></script>
|
|
<script>
|
|
(function() {
|
|
global.electronRequire = window.require;
|
|
|
|
let suppressErrors = false;
|
|
|
|
const socket = io(location.origin);
|
|
|
|
socket.on('refresh', () => {
|
|
location.reload();
|
|
});
|
|
|
|
socket.on('hasErrors', (html) => {
|
|
openError(html);
|
|
suppressErrors = true;
|
|
});
|
|
|
|
function openError(text) {
|
|
if (suppressErrors) {
|
|
return;
|
|
}
|
|
|
|
const box = document.querySelector('.__infinity-dev-box-error');
|
|
box.removeAttribute('hidden');
|
|
box.textContent = text;
|
|
}
|
|
|
|
function init() {
|
|
const script = document.createElement('script');
|
|
script.src = window.process.env.BUNDLE_URL;
|
|
|
|
script.onerror = () => {
|
|
openError('Script failure. Check Chrome console for more info.');
|
|
};
|
|
|
|
window.addEventListener('flipper-store-ready', () => global.Flipper.init());
|
|
|
|
document.body.appendChild(script);
|
|
}
|
|
init();
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|