-
Notifications
You must be signed in to change notification settings - Fork 107
feat: remove need to manually call monitorRenderer
#271
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
Conversation
README.md
Outdated
| devtron.install(); // call this function at the top of your file | ||
| ``` | ||
|
|
||
| or call `devtron.install()` inside the `app.whenReady()` callback like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, is there a reason why a consumer would prefer to call devtron.install() inside of app.whenReady()? Is there any functional difference between doing that and calling devtron.install() at the top of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no difference between the two, but it's probably better to call devtron.install() at the top of the file.
Should I remove the readme section about installing devtron inside app.whenReady() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, if there's no functional difference it's probably better to have only one section so it's more clear for users.
One advantage to installing it inside of app.whenReady() is that you can more easily dynamically import the module (which requires an await) if and only if your app isn't packaged, since most developers aren't going to want to ship with this package in production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it here - 92834ce
* feat: remove need to manually call `monitorRenderer` * docs: update install instructions * docs: correct devtron import to use `@electron/devtron` * docs: remove `app.whenReady()` install example from README
This PR:
monitorRendererin preload files of an Electron app. Devtron now injects a preload script usingses.registerPreloadScriptto track IPC events received byipcRenderer.sandbox: trueis set inwebPreferences.