-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Is it ok to Import libraries like SortableJs directly into Renderer? or should it be done through preload as well? #135
Comments
As a follow-up to this, I still do not understand why |
Hi @GitMurf. Thanks for being so patient, life has been very busy for me. Any library/dependency that interacts with the operating system (eg. files, sounds, permissions) should be handled in the main process. This is done in order that a bad client/actor can't manipulate the front-end of your app to maliciously affect the underlying computer running the Electron app. Any UI app or framework as you mention like Sortable is okay to be in the renderer as it's just a UI component and isn't directly (or shouldn't be) referencing or manipulating data directly from the underlying computer running the Electron app. |
As the title state, I have had this question for a long time and still haven't gotten a clear understanding of the "best practice" answer... is it ok to import third party libraries like SortableJS (https://github.com/SortableJS/Sortable) via
npm install
and thenImport
directly into my renderer (index.js)?Or instead should we be doing all the importing of third party libraries into the preload.js and then add to the context bridge API ways to grab the imported libraries (like Sortable in my case)?
The text was updated successfully, but these errors were encountered: