question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove remote event callbacks once template is updated to Electron v14

See original GitHub issue

All of the app.on calls in main.js here are using deprecated calls - are these necessary anymore?

When I convert the main.js file to a .ts file instead, it allows us to pickup electron.d.ts where these calls are marked as deprecated:

    /**
     * Emitted when `remote.getGlobal()` is called in the renderer process of
     * `webContents`. Calling `event.preventDefault()` will prevent the global from
     * being returned. Custom value can be returned by setting `event.returnValue`.
     *
     * @deprecated
     */
    on(event: 'remote-get-global', listener: (event: Event,
                                              webContents: WebContents,
                                              globalName: string) => void): this;
    once(event: 'remote-get-global', listener: (event: Event,
                                              webContents: WebContents,
                                              globalName: string) => void): this;
    addListener(event: 'remote-get-global', listener: (event: Event,
                                              webContents: WebContents,
                                              globalName: string) => void): this;
    removeListener(event: 'remote-get-global', listener: (event: Event,
                                              webContents: WebContents,
                                              globalName: string) => void): this

Per this Github issue, the remote module has been removed. Should this code also be removed from main? Is it safe to remove this code?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
reZachcommented, Jun 29, 2022

@Turtus / @netpoetica the latest version of this template will fix this issue. Please re-open this issue if you encounter any problems.

1reaction
reZachcommented, Nov 30, 2021

@Turtus it looks like the upgrade is failing due to the additionalArguments I’m using for the store module within this template. I’ve opened an issue at the electron repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking Changes
The new-window event of WebContents has been removed. ... The remote module was deprecated in Electron 12, and will be removed in Electron...
Read more >
How to unregister events in electron?
Hi, i m new to electron, if it is the same EventEmitter as nodejs, once method can handle that easily. nodejs.org/api/events.html# ...
Read more >
Release Notes
Rock v14.0 Released October 12, 2022. Rock McKinley 14.0 fixes issues that were reported during the previous release(s) and introduces a variety of...
Read more >
Node.js v19.3.0 Documentation
The callbacks init() / before() / after() / destroy() are called for the respective asynchronous event during a resource's lifetime. All callbacks are...
Read more >
ServiceDesk Plus readme, release notes, and version history
SD-106483 : API doc tool is now updated with get, add and remove task ... Description field of a change template are not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found