From ca28d230ff91f74e5bb1d7e7670329afc5732744 Mon Sep 17 00:00:00 2001 From: trickypr Date: Thu, 14 Jul 2022 13:27:33 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Compile=20against=20es2020=20for?= =?UTF-8?q?=20cleaner=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/content/getting-started/windows.md | 79 ------------------------- docs/content/guides/windows.md | 49 +++++++++++++++ tsconfig.json | 8 ++- 3 files changed, 54 insertions(+), 82 deletions(-) delete mode 100644 docs/content/getting-started/windows.md create mode 100644 docs/content/guides/windows.md diff --git a/docs/content/getting-started/windows.md b/docs/content/getting-started/windows.md deleted file mode 100644 index 64a2959..0000000 --- a/docs/content/getting-started/windows.md +++ /dev/null @@ -1,79 +0,0 @@ -+++ -title = "Windows" -weight = 10 -+++ - -# Working with windows - -Building Firefox Forks are nowhere near as easy on Windows as it is on Linux or Macos. This guide will walk you through the basics of setting up on Windows. - -There are some important notes for before you get started. Firstly, it is recommenced that you have at least 4GB of ram, preferably more than 8GB. You will need more than 40GB of space on your storage device and Windows 10 and 11 are the only two [tier-1](https://firefox-source-docs.mozilla.org/build/buildsystem/supported-configurations.html#build-hosts) windows hosts. - -## Installing Dependencies - -The first thing you will need to do is install Microsoft's c++ build tools. You will need to download [Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022). The following will need to be need installed: - -- **In the _Workloads_ tab** - - Desktop development with C++ -- **In the _Individual components_ tab** - - Windows 10 SDK (at least 10.0.19041.0). - - C++ ATL for v143 build tools (x86 and x64). - -You will need to install [MozillaBuild](https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe). This provides a number of unix tools including a terminal similar to bash which can be initialized by `C:\mozilla-build\start-shell.bat`. - -Next, [install Git](https://git-scm.com/download/win). You will need to set the following specific options on install to ensure high performance: - -- Configuring the line ending conversions must be: Checkout as-is, commit as-is -- Enable experimental built-in file system monitor - -Install [NodeJS](https://nodejs.org/en/download/current/) on your system. This should also install chocolatey. If it does not, install it manually. To install the final two dependancies, run: - -```sh -npm install --global yarn -choco install make -``` - -## Setting up an existing repo - -Next, you should clone down your repo. From here, install all of the necessary dependencies with yarn. - -```sh -yarn -``` - -Next, download the firefox source code for Firefox to engine. Note that on windows this can take between 20 - 30 minutes, most of the time being spent with initialize. - -```sh -gluon download -``` - -From here, you will need to use mach to bootstrap your system. - -```batch -cd engine -.\mach boostrap -``` - -Now you are ready to import, build and run your browser. - -```batch -gluon import -gluon build -gluon run -``` - -Exporting changes will work as per usual. - -## Additional packages required for releasing - -If you are creating binaries to target windows, you will need nsis (which mach calls `makensisu` for some reason, even though the binary is `makensis`): - -```powershell -choco install nsis -``` - -Note that you will also have to provide a path to nsis on your system. For mine it is: - -```sh -export MAKENSISU="C:\\Program Files (x86)\\NSIS\\Bin\\makensis.exe" -``` diff --git a/docs/content/guides/windows.md b/docs/content/guides/windows.md new file mode 100644 index 0000000..d658a25 --- /dev/null +++ b/docs/content/guides/windows.md @@ -0,0 +1,49 @@ ++++ +title = "Preparing Windows" +weight = 0 ++++ + +# Preparing Windows + +Building on windows is significantly more complex than building on macos or linux. This guide will walk you through preparing your Windows machine for building a Firefox fork. Before building, you should be aware that [only Windows 10 or 11 are officially supported](https://firefox-source-docs.mozilla.org/build/buildsystem/supported-configurations.html#build-hosts), but you might be able to get other versions to work. + +## Installing Dependencies + +The first thing you will need to do is install Microsoft's c++ build tools. You will need to download [Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022). The following will need to be need installed: + +- **In the _Workloads_ tab** + - Desktop development with C++ +- **In the _Individual components_ tab** + - Windows 10 SDK (at least 10.0.19041.0). + - C++ ATL for v143 build tools (x86 and x64). + +> **Note:** +> If this guide ever gets out of date, you can get the latest build requirements from [Mozilla's docs](https://firefox-source-docs.mozilla.org/setup/windows_build.html#system-preparation) + +You will need to install [MozillaBuild](https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe). Next, [install Git](https://git-scm.com/download/win). You will need to set the following specific options on install to ensure high performance: + +- Configuring the line ending conversions must be: Checkout as-is, commit as-is +- Enable experimental built-in file system monitor + +Install [NodeJS](https://nodejs.org/en/download/current/) on your system. This should also install chocolatey. If it does not, [install it manually](https://docs.chocolatey.org/en-us/choco/setup). To install the final two dependencies, run: + +```sh +npm install --global yarn +choco install make +``` + +You should be good to return back to the main [Getting Started docs](/getting-started/overview) + +## Additional packages required for releasing + +If you are creating binaries to target windows, you will need nsis (which mach calls `makensisu` for some reason, even though the binary is `makensis`): + +```powershell +choco install nsis +``` + +Note that you will also have to provide a path to nsis on your system. For mine it is: + +```sh +export MAKENSISU="C:\\Program Files (x86)\\NSIS\\Bin\\makensis.exe" +``` diff --git a/tsconfig.json b/tsconfig.json index f4e3880..58f6bf5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,12 @@ "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "incremental": true /* Enable incremental compilation */, + "target": "es2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - // "lib": [], /* Specify library files to be included in the compilation. */ + "lib": [ + "es2020" + ] /* Specify library files to be included in the compilation. */, // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */