Every require() that we do before the users sees UI reduces startup
time.
I used the following code (added to index.js) to log every require()
call in the main process:
```js
var Module = require('module')
var required = {}
Module.prototype.require = function (orig) {
return function (id) {
if (!required[id]) {
required[id] = true
console.log(`${id} (from ${this.filename})`)
}
return orig.apply(this, arguments)
}
}(Module.prototype.require)
```
From this I was able to learn that lots of modules were being required
that aren't actually used until later.
I also sent this related PR to eliminate another few require()s:
https://github.com/LinusU/node-application-config/pull/4
This increases startup time by 50ms.
We'll probably realize much bigger gains by following this same
procedure for the renderer process.
* Open multi-file torrents as playlists
* Add `repeat` and `shuffle` options to the player
* Autoplay first file in torrent
* replaces `pickFileToPlay` feature
* when reopening player, restores the most recently viewed file
* Add playlist navigation buttons to Windows thumbar
* Remove `repeat` and `shuffle` options
This reverts commit 9284122461.
* Play files in order they appear in torrent
* Clean up playlists code
You can no longer open a whole stack of Prefs windows, or Create Torrent windows
Simplifies and fixes behavior when dropping files onto the app or the dock icon. Before, you could use drag-drop to create stacks of Create Torrent windows. Now, you can only create torrents from the home screen.
Fixes#665
Less code for us to maintain.
This also gives us free internationalization in a future Electron
version (they'll set the label dynamically based on the 'role')
One slight regression with this change, but it will be fixed in a
future Electron once this PR is merged:
https://github.com/electron/electron/pull/6600