These patches had their target path updated. These files used to be under `third_party/`. Chromium change: https://chromium.googlesource.com/devtools/devtools-frontend/+/e20bdacd076c94ada0411697d8c2c36c8af86dc6 commit e20bdacd076c94ada0411697d8c2c36c8af86dc6 Author: Simon Zünd <szuend@chromium.org> Date: Tue Aug 27 09:35:53 2024 +0200 [deps] Move ts_library out of third_party ts_library.py and typescript.gni do not contain any third party code. They had the Chromium license headers from the beginning. The only "third-party"ness they have, is that they use the "typescript" npm package. R=alexrudenko@chromium.org Fixed: 362397305
1.7 KiB
DevTools Frontend Patching
Adding a New File
- Add your file in
//brave/third_party/devtools-frontend/src/front_end/{path to your file} - Create (if it doesn't exist)
sources.gniwith//brave/third_party/devtools-frontend/src/front_end/{path to your file} - Create a patch in the corresponding
BUILD.gnin//third_party/devtools-frontend/src - Add a reference to the compiled file in
//brave/third_party/devtools-frontend/src/config/gni/sources.gni
How It Works
When chromium_src/third_party/devtools-frontend/src/scripts/build/typescript/ts_library.py detects a file starting with //brave, it copies this file to the corresponding upstream directory. When the compilation of the corresponding target is done, ts_library.py removes the copied file to preserve the upstream sources in their original state.
Patching an Existing File
- Create a patch file in
//brave/chromium_src/third_party/devtools-frontend/src/front_end/{path to the file you want to patch}.ts - Apply the patch after
SomeClassdeclaration in the original file:import { PatchSomeClass } from './SomeFile.patch.js'; (SomeClass as any) = PatchSomeClass(SomeClass);
How It Works
When chromium_src/third_party/devtools-frontend/src/scripts/build/typescript/ts_library.py detects a chromium_src counterpart, it copies the file to the corresponding upstream directory (replacing .ts with .patch.ts). You don't need to add this file in sources.gni or BUILD.gn. Instead, you should import the {filename}.patch.js file (See step #2 above). chromium_src/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py will automatically add the .patch.js file into the resource bundle.