Skip to content

Commit eec2ee9

Browse files
committed
perf(electron): chromium flags and window config
1 parent 5766ce4 commit eec2ee9

6 files changed

Lines changed: 26 additions & 55 deletions

File tree

.github/scripts/telegram-notify.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fetch from 'node-fetch'
2-
import fs from 'fs'
1+
const fetch = require('node-fetch')
2+
const fs = require('fs')
33

44
const {
55
TELEGRAM_BOT_TOKEN,
@@ -25,7 +25,7 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) {
2525
const payload = JSON.parse(fs.readFileSync(GITHUB_EVENT_PATH, 'utf8'))
2626

2727
if (GITHUB_EVENT_NAME === 'push') {
28-
message += `\n*Push*\n`
28+
message += `\n*Push*\n\n`
2929
message += `Branch: ${GITHUB_REF?.replace('refs/heads/', '')}\n`
3030

3131
payload.commits?.slice(0, 3).forEach((c, i) => {
@@ -35,15 +35,15 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) {
3535

3636
if (GITHUB_EVENT_NAME === 'pull_request' || GITHUB_EVENT_NAME === 'pull_request_target') {
3737
const pr = payload.pull_request
38-
message += `\n*Pull Request*\n`
38+
message += `\n*Pull Request*\n\n`
3939
message += `Title: ${pr.title}\n`
4040
message += `Action: ${payload.action}\n`
4141
message += `URL: ${pr.html_url}\n`
4242
}
4343

4444
if (GITHUB_EVENT_NAME === 'issues') {
4545
const issue = payload.issue
46-
message += `\n*Issue*\n`
46+
message += `\n*Issue*\n\n`
4747
message += `Title: ${issue.title}\n`
4848
message += `Action: ${payload.action}\n`
4949
message += `URL: ${issue.html_url}\n`

.github/workflows/ci.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

apps/desktop/assets/entitlements.mac.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
33
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
44
<plist version="1.0">
55
<dict>

apps/desktop/main/app/window.manager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { BrowserWindow, ipcMain, Menu } from 'electron'
2-
import path from 'path'
32

43
import { DEV_SERVER_URL, isDev } from '../config/env'
54
import { getPreloadPath, getRendererIndex } from '../config/paths'
@@ -10,25 +9,26 @@ export function createMainWindow() {
109
const preloadPath = getPreloadPath(__dirname)
1110

1211
const win = new BrowserWindow({
12+
title: 'Datary',
1313
width: 1200,
1414
height: 800,
1515
show: false,
16-
title: 'Datary',
1716
webPreferences: {
1817
preload: preloadPath,
1918
contextIsolation: true,
2019
nodeIntegration: false,
21-
sandbox: false
20+
sandbox: false,
21+
devTools: isDev,
22+
enableBlinkFeatures: 'LayoutNG',
23+
spellcheck: false,
24+
backgroundThrottling: false
2225
}
2326
})
2427

2528
Menu.setApplicationMenu(null)
2629
mainWindow.set(win)
2730

2831
if (isDev && DEV_SERVER_URL) {
29-
win.webContents.closeDevTools()
30-
win.webContents.setVisualZoomLevelLimits(1, 1)
31-
3232
win.loadURL(DEV_SERVER_URL)
3333
} else {
3434
win.loadFile(getRendererIndex(__dirname))

apps/desktop/main/bootstrap.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ import { registerAppLifecycle } from './app/app.lifecycle'
44
import { createMainWindow } from './app/window.manager'
55
import { registerIpc } from './ipc/register.ipc'
66

7-
app.whenReady().then(async () => {
8-
await registerIpc()
7+
app.commandLine.appendSwitch('disable-background-timer-throttling')
8+
app.commandLine.appendSwitch('disable-renderer-backgrounding')
9+
app.commandLine.appendSwitch('disable-extensions')
10+
app.commandLine.appendSwitch('disable-breakpad')
11+
app.commandLine.appendSwitch(
12+
'disable-features',
13+
'OutOfBlinkCors,BackForwardCache,TranslateUI,BlinkGenPropertyTrees'
14+
)
15+
app.commandLine.appendSwitch('force-color-profile', 'srgb')
16+
17+
registerAppLifecycle()
918

19+
app.whenReady().then(async () => {
1020
createMainWindow()
11-
registerAppLifecycle()
21+
22+
await registerIpc()
1223
})

packages/core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * from './domain/query/query.entity'
88
export * from './domain/query/query.types'
99

1010
export * from './application/ports/db.adapter.port'
11-
export * from './application/ports/credential.port'
1211

1312
export * from './application/use-cases/connect-db.usecase'
1413
export * from './application/use-cases/execute-query.usecase'

0 commit comments

Comments
 (0)