Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve print pdf under electron #342

Merged

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Mar 8, 2024

This PR improves print pdf under electron


Basic changes:

  • Turn off ipc log transport between render and main process as unused, it prevents ipc transport error from electron-log lib like:
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:93682)
    at WebContents.send (node:electron/js2c/browser_init:2:79161)
    at /home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/electronApi.js:205:23
    at Array.forEach (<anonymous>)
    at sendIpcToRenderer (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/electronApi.js:203:42)
    at Object.sendIpc (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/electronApi.js:185:5)
    at transport (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/transports/ipc.js:40:17)
    at runTransport (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/log.js:44:5)
    at runTransports (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/log.js:27:7)
    at log (/home/vladimir/projects/bitfinex/bfx-report-electron/node_modules/electron-log/src/log.js:21:3)
  • Suppress err modal window if pdf gen failed. The idea here is to inform the user if something goes wrong using WS event for better UX instead of showing a modal window error as it is annoying in most cases
  • Improve pdf generation performance for big html templates, uses loadFile method of electron api instead of base64 encoding
  • Bump up electron minor version to have the last fixes

Depends on these PRs:

Copy link
Collaborator

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@ezewer ezewer merged commit ff7588f into bitfinexcom:staging Mar 11, 2024
@ZIMkaRU ZIMkaRU deleted the feature/improve-print-pdf-under-electron branch March 13, 2024 07:29
This was referenced Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants