Giter VIP home page Giter VIP logo

foundation-game-configurator's People

Contributors

kendallroth avatar

Watchers

 avatar

foundation-game-configurator's Issues

Move profile loading to main process

Electron does not work well with async file system (fs) methods in renderer processes, often hanging and never returning. The current approach uses a "hack" by manually setting app.allowRendererProcessReuse to false, but this will be removed in Electron 11 (and removes performance benefits).

NOTE: This hack still requires a manual reload of the app before it will work...cannot release before fixing!

Instead, the profile loading should be moved to the main process and use ipcMain.invoke to asynchronously request the loaded profiles. Additionally, anything in background.ts that deals with receiving/passing information with the renderers should be moved to a dedicated renderer.ts file (or something) required from the main process.

// src/services/profile.service.ts

// TODO: Must fix this at some point before upgrading to Electron 11!
//       There is a bug causing issues with using native Node modules (ie. "fs")
//         in renderer processes, meaning it is necessary to either only use sync
//         "fs" methods OR perform all "fs" operations in main thread and communicate.
//       This should likely be updated to perform these operations in the main thread (security)
//         and abstract away behind an API of some sort (ie. Background utils, etc)
//       Issue: https://github.com/electron/electron/issues/22119
// TODO: Fix related issue where a reload is required before "fs" works properly!
//       Issue: https://github.com/electron/electron/issues/19554
app.allowRendererProcessReuse = false;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.