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

Remove number of dependencies in Main Process #431

Merged
merged 12 commits into from
Oct 10, 2022

Conversation

mukul-mehta
Copy link
Contributor

Description

Generate a dependency graph of the main process and reduce the number of modules imported. It can be done by the following:

  1. Remove extra imports and inline some definitions
  2. Move some things to a separate file (Types, helpers etc, so you don't import an entire file because of one function)
  3. Move some type imports to the new import type syntax.

Motivation and Context

Main process was depending on files it should not, this was causing an issue where it would re-render the entire app on making a change in what was supposed to be renderer but caused a change in main.

Screenshots (if appropriate):

We create a dependency graph starting with the file electron/main.ts.

On current main, the size:

Nodes: 514
Edges: 2178

Post this change:

Nodes: 68
Edges: 157

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Dependent PRs

  • [ ]

Checklist:

  • My code follows the code style of this project.

@mukul-mehta mukul-mehta force-pushed the circular-dependencies-main-process branch from f4e9abe to dff743f Compare October 3, 2022 13:43
@mukul-mehta mukul-mehta requested a review from xypnox October 3, 2022 13:52
@mukul-mehta mukul-mehta force-pushed the circular-dependencies-main-process branch from 4a7a59c to 69b2e55 Compare October 4, 2022 11:50
@mukul-mehta mukul-mehta requested review from rpPanda and xypnox October 4, 2022 11:50
@mukul-mehta mukul-mehta force-pushed the circular-dependencies-main-process branch from 69b2e55 to eec64da Compare October 10, 2022 10:48
@rpPanda rpPanda merged commit ef67d42 into main Oct 10, 2022
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.

5 participants