Electron
Table of contents
Version Nodes
22.x the last version supports windows 7/8, as it denpends Chromium 109
Check specific branch
Note that the –unmanaged option makes it so that you can change the remote (repo) and/or branch & gclient won’t do anything about it. (If I understand correctly.)
from gclient config –help:
–unmanaged overrides the default behavior to make it possible to have the main solution untouched by gclient (gclient will check out unmanaged dependencies but will never sync them)
Consequently, you can enter the src/electron folder and checkout any branch you like. Below is a script that I made for this, based on the official build instructions (YMMV).
#!/bin/bash
GN_DIR=${HOME}/tmp/electron-gn
SRC_DIR=$GN_DIR/src
ELECTRON_REPO_URL=https://github.com/user/electron
ELECTRON_REPO_BRANCH=some_branch
# mkdir -p $HOME/tmp
# cd $HOME/tmp
# git clone https://chromium.googlesource.com/chromium/tools/depot_tools
DEPOT_TOOLS_DIR=${HOME}/tmp/depot_tools
# Add depot_tools to PATH if not already there (need gclient, gn, ninja, cipd, etc.)
[[ ":$PATH:" != *":${DEPOT_TOOLS_DIR}:"* ]] && export PATH="${PATH}:${DEPOT_TOOLS_DIR}"
export GIT_CACHE_PATH="${HOME}/.git_cache"
export SCCACHE_BUCKET="electronjs-sccache-ci"
export SCCACHE_TWO_TIER=true
export CHROMIUM_BUILDTOOLS_PATH=$SRC_DIR/buildtools
export GN_EXTRA_ARGS="${GN_EXTRA_ARGS} cc_wrapper=\"${SRC_DIR}/electron/external_binaries/sccache\""
echo "Configuring environment with gclient"
cd $GN_DIR
gclient config --name "src/electron" --unmanaged $ELECTRON_REPO_URL
gclient sync --with_branch_heads --with_tags
echo "Making sure electron repo is tracking with $ELECTRON_REPO_URL"
cd src/electron
git checkout $ELECTRON_REPO_BRANCH
#git branch --set-upstream-to=origin/$ELECTRON_REPO_BRANCH
git pull
cd -
echo "Making sure electron repo is up to date"
cd src/electron
git pull
gclient sync -f
cd -
cd $SRC_DIR
echo "Generating config"
gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\") $GN_EXTRA_ARGS"
echo "Building"
ninja -C out/Debug electron
Update react-biolerplate
- Add alias “@” and “I18N”
- Add ELECTRONCLIENT macro
- sass-resource-load
- For DVA module, let react@16.14, react-dom
- Electron ployfill