Hyper: Document that plugins can require Electron

Created on 25 Jul 2016  路  8Comments  路  Source: vercel/hyper

This is needed in order to allow show/hide to have proper return of focus
https://github.com/electron/electron/issues/2640

Alternatively expose an API to do this

good first issue help wanted 馃摉 Documentation

Most helpful comment

Dude, i just came to realise something when i checked out the code in hyperterm-overlay

The package.json specifies [email protected], which isn't right, but the thing that's really cool (but a bit unexpected) is that electron always return internal module when requiring electron! 馃挜 ,

So no need for sending the electron over to plugins, just document that they can do
const electron = require('electron')
const { dialog, Menu } = require('electron')

All 8 comments

We do this? decorateMenu ?

@rauchg negative, at least as far as I can tell... we need to be able to Menu.sendActionToFirstResponder('hide:');

OH. I think it'd be cool to pass { electron } as the second parameter for all the browser hooks. What do you think ?

Kinda like we pass { React } to all the renderer ones

{ electron, app }

Seems to me that this should work for this and many other use-cases 馃槉

Dude, i just came to realise something when i checked out the code in hyperterm-overlay

The package.json specifies [email protected], which isn't right, but the thing that's really cool (but a bit unexpected) is that electron always return internal module when requiring electron! 馃挜 ,

So no need for sending the electron over to plugins, just document that they can do
const electron = require('electron')
const { dialog, Menu } = require('electron')

Yes, we need to document this, because as a plugin author I tried to not requiring electron because it is a big dependency. If I knew that...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConstantinChirila picture ConstantinChirila  路  3Comments

sarneeh picture sarneeh  路  3Comments

aem picture aem  路  3Comments

cooperpellaton picture cooperpellaton  路  3Comments

alejandrofloresm picture alejandrofloresm  路  3Comments