juliangruber / just-launch

Launch any browser, on any OS, with a fresh session!
90 stars 6 forks source link

Install `electron-stream` or `electron` on demand #16

Closed fregante closed 4 years ago

fregante commented 4 years ago

Electron currently brings a just-launch install from 22M to 140M. Given that Firefox and Chrome available natively on Travis, GH Actions, and the user's computer, it would push more users to use them instead of electron.

Users who want electron can include it in their dependencies and it will be picked up automatically.

Alternatively, it could copy parcel-bundler's "install on use" behavior, if they published a module for this. But this might be an overkill for something that can be solved by suggesting:

npm install just-launch electron-stream

From what I understand, phantomjs-stream was set up this way since it doesn't list PhantomJS in its non-dev dependencies, it just expects to find it in $PATH.

electron-stream could behave the same way

juliangruber commented 4 years ago

This is a good idea! The only risk is then we don't control the electron version any more, and might get breaking changes..

fregante commented 4 years ago

electron-stream could specify electron as a peer-dependency with a range.

Also electron-stream‘s instructions could include

npm install electron-stream electron@5

Or maybe electron-stream should include electron but just-launch has it as a peer dependency.

juliangruber commented 4 years ago

I guess it doesn't matter too much which would be the peer dependency, using ranges as you mentioned we can make it save either way.

Thinking about this more, it's unfortunate we have to decide whether to bundle electron. With electron, browser-run and tape-run are a lot more accessible for local dev, and if you want to use these for local dev you would install electron too, which means you would have it in your dependency on CI as well.

Internet is getting faster and faster, and space is getting cheaper and cheaper.

Have you measured what affect installing actually has on CI runs? The most important dimension is time I guess.

fregante commented 4 years ago

My drive is not that big and having 10 unnecessary copies of electron adds up. Also who doesn’t want faster CI builds? 😁

If “less configuration” is worth it, it could also install on use like parcel does.

Also it would push more people to use real browsers instead of Electron

juliangruber commented 4 years ago

My drive is not that big and having 10 unnecessary copies of electron adds up. Also who doesn’t want faster CI builds? 😁

Have you measured how much faster this makes CI?

If “less configuration” is worth it, it could also install on use like parcel does.

There are advantages to installing electron eagerly, especially that once you run the project you don't have to expect any extra installation at runtime.

Also it would push more people to use real browsers instead of Electron

I don't agree that this is an advantage for this module, which is a general purpose browser launcher.

vweevers commented 4 years ago

Plus, in the case of Travis, its npm cache is enabled by default nowadays.