You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem description
As an electron developer I like to keep my code bundled by where it runs. ex) main, renderer, both so I easily know what APIs are available and how to communicate with the other parts of my app.
On one of my projects we used on of the templates and all the code was in the /src folder... As the project grew to over 200 files, this became a real challenge to manage and understand where the code in a particular file would run.
Proposed solution
We ended up updating to the following filesystem layout
/src/common - types, classes, and functions used in both the main and renderers.
/src/main/* - code that runs on main.
/src/renderers/{renderer name}/* - code that runs in the renderer (preload, html, rendered js, css)
/src/renderers/common/* - code shared between multiple renderers (common preload imports, component library, etc)
This has really helped us navigating our codebase and helped new team members get familiar more quickly. I think it would be nice if the templates provided this structure for new projects so others building with electron won't have to go through the complex file moving and organizing we had to after their projects have organically grown into a mess.
Alternatives considered
I haven't considered other file system layouts, but would find any that organize things in a similar fashion in spirit an improvement.
Additional information
No response
The text was updated successfully, but these errors were encountered:
Pre-flight checklist
Problem description
As an electron developer I like to keep my code bundled by where it runs. ex) main, renderer, both so I easily know what APIs are available and how to communicate with the other parts of my app.
On one of my projects we used on of the templates and all the code was in the /src folder... As the project grew to over 200 files, this became a real challenge to manage and understand where the code in a particular file would run.
Proposed solution
We ended up updating to the following filesystem layout
/src/common - types, classes, and functions used in both the main and renderers.
/src/main/* - code that runs on main.
/src/renderers/{renderer name}/* - code that runs in the renderer (preload, html, rendered js, css)
/src/renderers/common/* - code shared between multiple renderers (common preload imports, component library, etc)
This has really helped us navigating our codebase and helped new team members get familiar more quickly. I think it would be nice if the templates provided this structure for new projects so others building with electron won't have to go through the complex file moving and organizing we had to after their projects have organically grown into a mess.
Alternatives considered
I haven't considered other file system layouts, but would find any that organize things in a similar fashion in spirit an improvement.
Additional information
No response
The text was updated successfully, but these errors were encountered: