Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Dawn Internal State Life Cycle

Kevin Ma edited this page Jan 29, 2018 · 1 revision

Background

Due to Electron's roots in Chromium, it runs with the standard browser process model: a main process, to handle windows, and renderer processes, to actual handle display. For Dawn, the main process handles program start and networking; the single renderer handles everything else. A consequence of this two-process system is that which process running a particular file does matter, with complications if both deal with the same file (i.e. Constants.js).

Dawn likes to keep state within each React component to minimize overhead; state involving multiple components/files is handled by Redux.

Main to Renderer

See Electron's webContents module, Redux-Saga

The reduxDispatch function in RendererBridge.js allows the main process to send Redux messages to the renderer process (Specifically to Redux-Saga's ansibleSaga function).

Renderer to Main

See Electron's ipcMain, ipcRenderer, remote, and webContents modules

Generally, this means using ipcRenderer.send(<channel> [, info]) and ipcMain.on(<channel>, (event, arg) => ...), where channel (for here) is the name of what you want to send (e.g. 'studentCodeStatus').

Guidelines for Contributing

Release Procedures

Projects

Dawn

Runtime

DevOps

Hibike

Field Control Software

Clone this wiki locally