Speed up start time

This commit is contained in:
Thomas Nordquist
2019-01-23 21:35:52 +01:00
parent 8091323623
commit 672d5e8109
5 changed files with 18 additions and 9 deletions

View File

@@ -10,6 +10,7 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@keyframes example { @keyframes example {
0% {background-color: none;} 0% {background-color: none;}
25% {background-color: #3f51b5;} 25% {background-color: #3f51b5;}
@@ -48,7 +49,7 @@
margin: 37vh auto 0 auto; margin: 37vh auto 0 auto;
height: 25vh; height: 25vh;
width: 25vh; width: 25vh;
background-image:url('../rings.svg'); /* background-image:url('../rings.svg'); */
background-size: cover; background-size: cover;
} }
#splash2 { #splash2 {
@@ -124,9 +125,10 @@
document.addEventListener('DOMContentLoaded', onLoad(), false); document.addEventListener('DOMContentLoaded', onLoad(), false);
function onLoad() { function onLoad() {
<% _.forEach(htmlWebpackPlugin.files.js, function(file) { %>loadScript("<%- file %>");<% }); %> // <% _.forEach(htmlWebpackPlugin.files.js, function(file) { %>loadScript("<%- file %>");<% }); %>
// loadScript("<%= JSON.stringify(htmlWebpackPlugin) %>") // loadScript("<%= JSON.stringify(htmlWebpackPlugin) %>")
} }
</script> </script>
<% _.forEach(htmlWebpackPlugin.files.js, function(file) { %><script src="<%- file %>"></script><% }); %>
</body> </body>
</html> </html>

View File

@@ -14,7 +14,6 @@ declare var window: any
interface Props { interface Props {
autoExpandLimit: number autoExpandLimit: number
didSelectNode?: (node: q.TreeNode) => void
connectionId?: string connectionId?: string
tree?: q.Tree tree?: q.Tree
filter: string filter: string

View File

@@ -30,11 +30,13 @@ const theme = createMuiTheme({
typography: { useNextVariants: true }, typography: { useNextVariants: true },
}) })
setTimeout(() => {
const splash = document.getElementById('splash') const splash = document.getElementById('splash')
if (splash) { if (splash) {
splash.style.animation = 'unsplash 1s ease-out 0s 1 normal forwards' splash.style.animation = 'unsplash 0.5s ease-in 0s 1 normal forwards'
setTimeout(() => splash.remove(), 1100) setTimeout(() => splash.remove(), 600)
} }
}, 300)
ReactDOM.render( ReactDOM.render(
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>

View File

@@ -28,6 +28,7 @@ function createWindow() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1024, width: 1024,
height: 700, height: 700,
show: false,
webPreferences: { webPreferences: {
nodeIntegration: true, nodeIntegration: true,
devTools: true, devTools: true,
@@ -35,6 +36,10 @@ function createWindow() {
icon: iconPath, icon: iconPath,
}) })
mainWindow.once('ready-to-show', () => {
mainWindow && mainWindow.show()
})
console.log('icon path', iconPath) console.log('icon path', iconPath)
// and load the index.html of the app. // and load the index.html of the app.
mainWindow.loadFile('app/build/index.html') mainWindow.loadFile('app/build/index.html')

View File

@@ -5,7 +5,8 @@
"strictNullChecks": true, "strictNullChecks": true,
"outDir": "./dist", "outDir": "./dist",
"strict": true, "strict": true,
"module": "esnext", "module": "commonjs",
"moduleResolution": "node",
"sourceRoot": "src/", "sourceRoot": "src/",
"lib": ["es2017", "dom"], "lib": ["es2017", "dom"],
"sourceMap": true "sourceMap": true