Skip to content

Code Organization

Sven Efftinge edited this page Feb 25, 2017 · 8 revisions

Target Environments

The core of Code is fully implemented in TypeScript. Inside each layer the code is organized by the target runtime environment. This ensures that only the runtime specific APIs are used. In the code we distinguish between the following target environments:

  • common: Source code that only requires basic JavaScript APIs and run in all the other target environments
  • browser: Source code that requires the browser APIs like access to the DOM
    • may use code from: common
  • node: Source code that requires nodejs APIs
    • may use code from: common
  • electron-browser: Source code that requires the Electron renderer-process APIs
    • may use code from: common, browser, node
  • electron-main: Source code that requires the Electron main-process APIs
    • may use code from: common, node