The source code of Electron is separated into a few parts, mostly following Chromium on the separation conventions.
You may need to become familiar with Chromium's multi-process architecture to understand the source code better.
The files in
/chromium_src tend to be pieces of Chromium that aren't part of
the content layer. For example to implement Pepper API, we need some wiring
similar to what official Chrome does. We could have built the relevant
sources as a part of libcc but most
often we don't require all the features (some tend to be proprietary,
analytics stuff) so we took parts of the code. These could have easily
been patches in libcc, but at the time when these were written the goal of
libcc was to maintain very minimal patches and chromium_src changes tend to be
big ones. Also, note that these patches can never be upstreamed unlike other
libcc patches we maintain now.
- script - Scripts used for development purpose like building, packaging, testing, etc.
- tools - Helper scripts used by GN files, unlike
script, scripts put here should never be invoked by users directly.
- vendor - Source code of third party dependencies, we didn't use
third_partyas name because it would confuse it with the same directory in Chromium's source code tree.
- node_modules - Third party node modules used for building.
- out - Temporary output directory of
- dist - Temporary directory created by
script/create-dist.pyscript when creating a distribution.
- external_binaries - Downloaded binaries of third-party frameworks which
do not support building with
The Electron repository has a few vendored dependencies, found in the
/vendor directory. Occasionally you might see a message like this
$ git status modified: vendor/depot_tools (new commits) modified: vendor/boto (new commits)
To update these vendored dependencies, run the following command:
git submodule update --init --recursive
If you find yourself running this command often, you can create an alias for it
[alias] su = submodule update --init --recursive