This new private API will allow settings-view to communicate
asynchronously with the main process to resolve proxies, instead of
using `remote` and blocking the renderer process during startup.
This is a refactoring that sets up the work for #13878 (docks).
Because items will be able to dictate their preferred locations, we
need to detangle the item creation from their placement.
The comment was actually no longer accurate since arrow functions
aren't newable. After doing an audit, @maxbrunsfeld determined that it
could just be removed.
Instead of using `localStorage` to store and retrieve the project
history, with this commit we will use `StateStore` so that we can
retrieve state asynchronously without blocking Atom during startup.
This will still notify render processes when such events are triggered
without, however, incurring the additional cost of synchronously
retrieving a `BrowserWindow` (and its properties) via `remote` during
startup.
This commit will register the `display-added` and `display-removed`
events only once in the main process in order to disable zoom (see
https://github.com/atom/atom/pull/11345) directly instead of
unnecessarily paying for I/O in the renderer process during startup.
When accessing objects in the main process via the `remote` module,
Electron returns proxy objects that are references to the original ones.
This means that trying to access a remote object's property or function
results in a synchronous message exchange with the main process.
In Atom core we frequently access the load settings coming from the main
process, especially during startup. This caused a lot of synchronous I/O
which was blocking the renderer process for several milliseconds.
With this commit, instead of exposing load settings as a JavaScript
object, we serialize them to JSON in the main process and parse them
back to a JavaScript object in the renderer processes. This allows us to
get a full copy of the object locally and pay for I/O just once when
retrieving load settings from the main process for the first time.