Commit Graph
293 Commits
Author SHA1 Message Date
Jack Franklin c712a3e629 Move generate_css_js_files to use cssnano
Bug: 1399763
Change-Id: I96964df8eb6c8979d5f208aa442687c439acaa7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092364
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-12-09 12:57:29 +00:00
Jack Franklin 43f33bfab5 Add tests for generate_css_js_files script
No functional changes here - but we will be making changes in the future
to this script, so I think adding a few tests is a good idea.

The changes to the source code are purely to allow the relevant function
to be tested easily, and there are no actual output changes here.

Bug: 1399763
Change-Id: I7fec01f62ea2b034b175071aa1dd92a9d3df51b6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092303
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2022-12-09 10:58:02 +00:00
Jack Franklin df0e9312aa Add ESLint rule for commented out import statements
This is something I've been caught out with a few times when moving code
round, and thought it would be a good ESLint rule. I've enabled the rule
as part of this CL as we currently have few issues that need fixes.

Bug: none
Change-Id: I72c6aad3e4258fbda280e062f98823a068c6bfc8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4076326
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-05 11:24:51 +00:00
Simon Zünd 50dcea80fa [l10n] Use generated en-US.json/en-XL.json
This CL switches out the in-tree versions of en-US.json/en-XL.json
in favor of the versions generated at build time. They are identical.

The implementation is straight-forward. On the minification step, we
exclude the in-tree en-US.json/en-XL.json and instead add the
outputs of the "collect_strings" action (aka the generated en-US.json/
en-XL.json).

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I923fba50033305a7df6bedccf65c657ecc8e5235
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4043247
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-11-22 08:51:46 +00:00
Simon Zünd d481608a05 [l10n] Remove src directory parameter for minification script
Instead the input sources should specify their path completely.
This allows us to also include generated inputs.

Note that all sources will still be put into a single output
directory, namely $target_gen_dir/core/i18n/locales.

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I203f284f74cb468ebe44c22e5d594f1b6cb182e0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4042782
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-11-22 08:17:39 +00:00
Simon Zünd c6be86815b [l10n] Don't comma separate files passed to the minification script
Just a small refactoring to go with the standard way of passing
each file as a separate argument instead of doing a join + split.

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I5a292053e1138448e8a1e7a09162b248d6851a25
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4042209
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2022-11-21 12:14:02 +00:00
Jack Franklin 130d2ae03b Disable clang/eslint in front_end/generated
This CL disables formatting within the `generated` directory, which is
all code that is programatically generated. Previously we disabled
eslint for `protocol.ts`, but now we are being consistent and disabling
it (and clang) for all files.

I also re-generated the files in the generated folder, so we avoid any
confusion if/when the generated scripts get re-run and suddenly the
format drastically changes.

DISABLE_THIRD_PARTY_CHECK=changing generated files + config

Bug: none
Change-Id: I714ada8bf7d85020e3be71b35c9db98840bf3ef2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3755163
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-12 10:51:50 +00:00
Richard Wang efcbd38590 typescript: Fully replace devtools_use_rbe with devtools_use_remoteexec
BUG=chromium:1247781
DISABLE_THIRD_PARTY_CHECK=Update devtools_entrypoint simultaneously rather than making yet another CL

Change-Id: Id85a820f0ab30a46d0631c6e5581a88c206fa8f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3694875
Commit-Queue: Richard Wang <richardwa@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-10 12:01:23 +00:00
Philip Pfaffe 17a9f74a71 Don't build wasm module test inputs in the chromium tree
We currently don't check out emscripten in the chromium tree, so disable
inclusion of the modules that would call emscripten tools in that case.

Bug: none
Change-Id: I7e69d87da6af7a198f6a509a1d2a2b02d6d94341
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695365
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2022-06-10 09:55:03 +00:00
Philip Pfaffe e29b186fe5 Generate inputs to wasm tests from wasm text
This CL introduces support for writing inputs to wasm tests in wat
format. This will allow removing dependencies on opaque binary resources
that can't be regenerated without changing hardcoded offsets in all
tests. Referencing binary and/or source file offsets will now be
possible through special comments left in the wat source.

Bug: 1328729
Change-Id: I6369c86ca57860fd9803b894797f63c36c65d554
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3666419
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-09 17:12:02 +00:00
Liviu Rau 3da5d4a22e Run build scripts with vpython3
Bug: 1292013
Change-Id: Idf2e5de0b6ca3a296e5efd7952911783d6005e30
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484196
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-02-25 10:12:14 +00:00
Alex Rudenko 4c118bf7b6 Fix typo in scripts/build/assert_third_party_readmes.py
Bug: none
Change-Id: Ife8f1a210db1c501f7c1bb3674aee3f1a558a055
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3480035
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-22 13:58:47 +00:00
Tim van der Lippe 7961ea6fa9 Update build system guidance
Remove references to the legacy closure compiler files and add
more guidance with respect to output locations and timestamps in
GN templates.

R=yangguo@chromium.org

Bug: none
Change-Id: I672d196c7f2ceebf6e057c60c4b1630ae2887d90
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3477111
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-02-21 16:22:08 +00:00
Takuto Ikuta d0e51ea796 add test for esbuild plugin
Fixed: 1293772
Change-Id: I0c12c27c66fcab491fac6869f282b3059e16ee9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439239
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-08 13:52:42 +00:00
Tim van der Lippe 800d875627 Add build script tests
You can run these tests with `npm run build-test`, while we also run
them as part of our PRESUBMIT if we make any changes to the build
folder.

R=yangguo@chromium.org
CC=tikuta@chromium.org

Bug: 1293772
Change-Id: Id3b02c83398d2346a4ec5a06f3b938d33070d4f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439987
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-04 13:25:10 +00:00
Takuto Ikuta 4d1f2028c3 esbuild: do not relativize node's built-in modules
This is followup of https://crrev.com/c/3430082.

This fixes error like
https://logs.chromium.org/logs/devtools-frontend/buildbucket/cr-buildbucket/8823327185154097217/+/u/compile__with_patch_/raw_io.output_text_failure_summary_

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: Ibdb456f32a3ffa1a24998e2ee58190cb396945cc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3435628
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-02-03 10:57:51 +00:00
Takuto Ikuta 6621f46716 devtools_plugin: mark non-relative import as external
This is to prevent error like
https://ci.chromium.org/ui/p/devtools-frontend/builders/try/devtools_frontend_linux_blink_light_rel_fastbuild/95/overview

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: I51ee2b52b88b9b52edf47edfd94c4a771540fd89
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3430082
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-02 13:21:01 +00:00
Simon Zünd 957496f839 Minify locale JSON files at build time
This CL adds a new build rule "minify_json" that takes a list of JSON
files, minifies them, and puts the result into then "gen/" directory.

The i18n module uses the new rule to minify the locale JSON, reducing
the raw size per locale file 10-15%.

R=tvanderlippe@chromium.org

Fixed: 1293324
Change-Id: I0aabc5cdea7957334dfe21304e117dc23a563606
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431345
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-02 13:19:01 +00:00
Takuto Ikuta 7f5fd554eb fix build errors
This fixes build error when we disable typescript and when we build
puppeteer.

Bug: 1293019
Change-Id: Ia927344166f543846e6fc3351f1621cd03593a49
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3430599
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-02 10:45:11 +00:00
Takuto Ikuta 4aef68ea32 enable fast bundle when skip typecheck
Use fast bundler if typecheck is skipped, assuming builders/developers
want to get result faster in such build config.

This will also remove the necessity of having devtools_fast_bundle
config from chromium CQ/CI's build.

This is step 6 of http://go/devtools-fast-bundle

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: I516b0af30c8c76c9382dfa09763d4efb8d1bdae7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3429380
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
2022-02-01 13:03:00 +00:00
Takuto Ikuta 2548a6cd6c introduce devtools_fast_bundle build config
Proposal: http://go/devtools-fast-bundle

This CL introduces build flag switching bundler from rollup.js to
esbuild by
* adding esbuild to npm without downloading binary packages
* making devtools_plugin for rollup.js re-usable to esbuild

On 24C/48T Z840 Linux machine, this shows following performance
difference by using
```
devtools_skip_typecheck = true
is_debug = false
```
as base build config.

esbuild (devtools_fast_bundle = true)
$ time ninja -C out/Default/
...
real    0m21.174s
user    2m47.513s
sys     0m38.549s

rollup.js (devtools_fast_bundle = false)
$ time ninja -C out/Default/
...
real    1m28.286s
user    30m19.220s
sys     5m36.392s


So esbuild is 3.2x faster and use only 9.6% of machine resouce
(user + sys) compared to rollup.js.

refs:
* https://esbuild.github.io/plugins/#on-resolve
* https://rollupjs.org/guide/en/#resolveid

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: If6b2e774f48091b0fe9c959e7ed1ed9bc2b0847c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3401984
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-02-01 12:49:12 +00:00
Takuto Ikuta cfcea4217a rename rollup to bundle
rollup target will support esbuild, so I rename that to bundle.

Bug: 1278663
DISABLE_THIRD_PARTY_CHECK=parent CL has change for npm
Change-Id: I823f425e9ac5d599a3ddc3fd1fcd7e47cd18e3bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3419385
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-27 10:46:25 +00:00
Takuto Ikuta 9b3b13af90 extract devtools_plugin from rollup.config.js
This is extracted from https://crrev.com/c/3401984/30

I'll use this from esbuild too.

Bug: 1278663
DISABLE_THIRD_PARTY_CHECK=parent CL has change for npm
Change-Id: Ia5f3410a2cb59e349e7a76250fbe35b354462a4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3419384
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-27 10:44:05 +00:00
Takuto Ikuta 95a359d10c typescript: introduce devtools_skip_typecheck build flag
This is experimental flag introducing esbuild for typescript transpiler.

I needed to modify some test code to pass tests with esbuild.

Bug: chromium:1278663
DISABLE_THIRD_PARTY_CHECK=need to add esbuild DEPS too
Change-Id: I661951fc4fd8f5e6a2a599e531638ab294f887f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3330076
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-24 02:19:51 +00:00
Tim van der Lippe f2adc90457 Add Puppeteer to chrome://credits
R=alexrudenko@chromium.org

Bug: 1282407
Change-Id: I489c47413bc22b4b44cf88a8225c9d908bf7e563
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3404101
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-01-20 14:16:01 +00:00
Tim van der Lippe dcc95c9681 Fix licenses for about:credits
This adds an additional_readme_paths.json file that specifies all
directories of third_party packages that we include in the DevTools
bundle. The file is used as part of Chromiums about:credits machinery to
list all licenses of all third_party software (accessible via
chrome://credits).

It also updates the names of the packages to use the full name, which is
used as header of the license.

To ensure that this file remains up-to-date, we also include a GN action
that verifies all third_party directories listed in our GRD are included
in the .json file.

Lastly, add the missing license for Puppeteer.

R=yangguo@chromium.org

Bug: 1282407
Change-Id: Ia3142ab5bbc79804c56bc754934b9aaf1d186d7f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3386943
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2022-01-17 12:49:00 +00:00
Tim van der Lippe 28af9fbe78 Reland "Do not overwrite generated files when contents remains the same"
This reverts commit aaae6b021a.

Reason for revert: always check if tsconfig.json needs to be updated

Original change's description:
> Revert "Do not overwrite generated files when contents remains the same"
>
> This reverts commit c1e414725a.
>
> Reason for revert: Seems to be the cause for CQ compilation errors:
> https://ci.chromium.org/ui/p/devtools-frontend/builders/try/devtools_frontend_linux_blink_light_rel/19852/overview
>
> Original change's description:
> > Do not overwrite generated files when contents remains the same
> >
> > To ensure that build timestamps don't unnecessarily cause full rebuilds,
> > make sure that we only write the generated contents to a file (if it
> > exists already) if it would be the same. This ensures that the file
> > timestamps remain the same, which will lead GN to conclude that the
> > build action is a noop (which it is).
> >
> > On a new year, the file contents would actually be different, so it
> > would cause a proper rebuild. However, in all months between when the
> > timestamp changes, it won't cause is unnecessarily to rebuild all these
> > files, even though the year hasn't changed (but the timestamp it was
> > based on did).
> >
> > R=​jacktfranklin@chromium.org
> >
> > Bug: 1283883
> > Change-Id: I2bdc3a79de710236c1501b21fa505692336cfa82
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3377942
> > Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> > Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
>
> Bug: 1283883
> Change-Id: I938cfe20a7ecf6df6c7becc9fa73a3dcfebe457c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3380583
> Auto-Submit: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Bug: 1283883
Change-Id: Iae23d721bdeb4c8af227903a38255ee9fc1bc49d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3386675
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2022-01-13 15:20:09 +00:00
Simon Zünd aaae6b021a Revert "Do not overwrite generated files when contents remains the same"
This reverts commit c1e414725a.

Reason for revert: Seems to be the cause for CQ compilation errors:
https://ci.chromium.org/ui/p/devtools-frontend/builders/try/devtools_frontend_linux_blink_light_rel/19852/overview

Original change's description:
> Do not overwrite generated files when contents remains the same
>
> To ensure that build timestamps don't unnecessarily cause full rebuilds,
> make sure that we only write the generated contents to a file (if it
> exists already) if it would be the same. This ensures that the file
> timestamps remain the same, which will lead GN to conclude that the
> build action is a noop (which it is).
>
> On a new year, the file contents would actually be different, so it
> would cause a proper rebuild. However, in all months between when the
> timestamp changes, it won't cause is unnecessarily to rebuild all these
> files, even though the year hasn't changed (but the timestamp it was
> based on did).
>
> R=​jacktfranklin@chromium.org
>
> Bug: 1283883
> Change-Id: I2bdc3a79de710236c1501b21fa505692336cfa82
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3377942
> Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>

Bug: 1283883
Change-Id: I938cfe20a7ecf6df6c7becc9fa73a3dcfebe457c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3380583
Auto-Submit: Simon Zünd <szuend@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-01-11 09:29:14 +00:00
Tim van der Lippe c1e414725a Do not overwrite generated files when contents remains the same
To ensure that build timestamps don't unnecessarily cause full rebuilds,
make sure that we only write the generated contents to a file (if it
exists already) if it would be the same. This ensures that the file
timestamps remain the same, which will lead GN to conclude that the
build action is a noop (which it is).

On a new year, the file contents would actually be different, so it
would cause a proper rebuild. However, in all months between when the
timestamp changes, it won't cause is unnecessarily to rebuild all these
files, even though the year hasn't changed (but the timestamp it was
based on did).

R=jacktfranklin@chromium.org

Bug: 1283883
Change-Id: I2bdc3a79de710236c1501b21fa505692336cfa82
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3377942
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-10 15:54:45 +00:00
Tim van der Lippe 08285ab74f Use GN build timestamps for copyright year
To avoid non-determinism on January 1st of a new year, we have
to use the build timestamp from GN to compute the current year.
The build timestamp will be the same for all bots, which ensures
that all files are built with the same year in the copyright header.

R=jacktfranklin@chromium.org

Fixed: 1283883
Change-Id: Ifbe581ddb65095ca6ef555625be11a370cb8f238
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372924
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-01-07 12:09:00 +00:00
Tim van der Lippe 74e7b89b20 Remove unused scripts
None of these are used anymore or are obsolete (for example, because
we removed the module.json files).

R=jacktfranklin@chromium.org

Bug: none
Change-Id: I5f538d38ed6e1156e9ef6cf023daebe90999fb4f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3344910
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-12-16 12:13:20 +00:00
Nico Weber 5027efee97 Make devtools-frontend gn files not write absoute paths to generated ninja files
Reduces `diff out/gn{1,2}/toolchain.ninja | wc -l` from 464 to 8
on my linux box.

No intended behavior change.

Bug: chromium:1278777
Change-Id: Ib9e711f67646e848fdfb95393ad75519f789ccf1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3330417
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2021-12-10 15:32:59 +00:00
Tim van der Lippe 4775ec11d6 Remove rjsmin again
Chrome OS now uses the appropriate third_party version:
https://crrev.com/c/3311066

R=jacktfranklin@chromium.org

Bug: none
Change-Id: I43470c3d1b761e9ef17aadd90491ddeffdc119aa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3318036
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-12-07 10:57:32 +00:00
Tim van der Lippe d36fbdeda7 Temporarily add back rjsmin.py for Chrome OS
Chrome OS is accidentally relying on DevTools build scripts:
https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/resources/chromeos/accessibility/common/run_jsbundler.gni;l=16;drc=e86ab6e79b3cef0b3a37f691d8ec38d25fa0ca9e
We should clean that up, but for now let's add back the rjsmin.py script
back to unblock the DevTools autoroller.

R=kprokopenko@chromium.org

Bug: none
Change-Id: Icf51ffb5b468809bd623b3252d2f5c994409ff2f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3313066
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-12-02 15:08:18 +00:00
Tim van der Lippe 2ec9790ec5 Remove build_release_applications and friends
This script is now unused and fully replaced by GN. As such, this
concludes the full `module.json` migration and related scripts, which
means we can consider crbug.com/1127902 fixed.

R=jacktfranklin@chromium.org

Fixed: 1127902
Change-Id: I0fde9c4fede0cdc8649e5e455e025a70ed4d2a09
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310869
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-12-02 12:08:02 +00:00
Tim van der Lippe 1b5567f78a Remove resources from perf_ui
To remove the module.json file in perf_ui, we need to migrate the
resources to the new `generate_css` template. However, perf_ui is a bit
special, in that it doesn't properly use the widget structure. As such,
it sometimes injects CSS in places where there is no clear shadowRoot
available. Therefore, it is not possible to migrate to CSSStyleSheet in
combination with adoptedStylesheets.

As a workaround (to unblock the module.json removal), we augment
`generate_css` to add legacy file generation. All remaining resources in
DevTools will migrate to these `.css.legacy.js` files. That's because
these resources either are special (perf_ui) or are used in the
`device_mode_emulation_frame` which can't use `CSSStyleSheet` itself.

The files export an object, rather than a plain string. That's because
we need to be able to distinguish what string is referencing a CSS file
path and which strings contain the actual CSS styles. By using an
object, we can remain using the `typeof` check for string in the legacy
CSS infrastructure and otherwise destructure the object.

After this, we can remove perf_ui from the module.json structure and
properly bundle+minify the CSS resources.

R=jacktfranklin@chromium.org

Bug: 1190991, 1127902
Change-Id: I7523333e8025ae5fe5ed74b99b4e45907ff9ad97
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3275787
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-11-12 15:25:03 +00:00
Andres Olivares 8388f33735 Use case sensitive look up in build scripts to copy file contents.
These scripts check if a file exists and whether its content is
different from a source file before copying it. However the file look up
done with fs.existsSync() could be case-insensitive depending on the
underlying file system.

This CL implements the a case-sensitive file look up to compare against
the exact path name of the file being copied.

Bug: none
Change-Id: I0dc175c2292b3caea541a585562e8e25db637340
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3256666
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2021-11-02 15:57:40 +00:00
Mathias Bynens 4c6e92b7b8 Avoid collapsing inline tag whitespace
This patch ensures we collapse spaces between DOM nodes
into a single space rather than removing the space entirely.
This prevents issues with missing spaces in UI text, and
generally makes the HTML minification step more safe.

Bug: chromium:1264791
Change-Id: Ib8dfaa58e973ee8682a1f43226db9f9483d9606b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3252958
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2021-10-29 12:24:12 +00:00
Tim van der Lippe b1953da009 Do not include generated CSS files in code coverage report
These are auto-generated and we don't need to know the code coverage for
these files.

R=jacktfranklin@chromium.org

Bug: none
Change-Id: Ieaaed88a3752a755e4f5e30495e38434330c7263
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3222663
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-10-14 10:46:49 +00:00
Tim van der Lippe 59f68132b1 Make lighthouse_worker a proper entrypoint
This entrypoint was still being copied over, due to techdebt we
had before. The techdebt has since been removed, so we can now
properly use `devtools_{module,entrypoint}` to process these files.

R=jacktfranklin@chromium.org

Fixed: 1248392
Change-Id: I8c7394c62c21b9b73e259fd9206510c92203ad0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3158384
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-10-04 16:25:42 +00:00
Jack Franklin fc6226b017 Update Rollup and terser
This pulls in the bugfix for mangling private class fields
reported in https://github.com/terser/terser/issues/1067

DISABLE_THIRD_PARTY_CHECK=Fix rollup config
R=jacktfranklin@chromium.org

Bug: 1222126
Change-Id: I77a1ddc3697498829e595cead728479e81e7889c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3158385
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-09-21 12:28:03 +00:00
Kriti Sapra afc5528f54 Added line in css generating script to say the file is auto generated
Bug: 1106746
Change-Id: I7452b10640b0f0efaf273f1c950190d6b2a45008
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3164343
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kriti Sapra <kritisapra@google.com>
2021-09-17 07:39:56 +00:00
Tim van der Lippe 58df6650e1 Update timestamps for devtools_modules only
The previous attempt was wrong, as it wasn't correctly rebuilding
dependents if a breaking TypeScript API change was made. The root
cause for that is the split of `devtools_entrypoint` and
`devtools_module`, which we need for bundling. Unfortunately, we
also can't introduce granular GN targets for only `.d.ts` files,
since TypeScript generates all outputs in 1 go. Therefore, it is not
possible to split that up into multiple scripts, which is required
if we want to introduce targets with outputs for only `.d.ts`.

Instead, we should still reset timestamps for `devtools_module`,
but then we always rebuild `devtools_entrypoint`. By doing that,
a breaking API change in a `devtools_module` would trigger its
corresponding `devtools_entrypoint` to change, which will ensure
that all its dependents also change. However, the next layer of
`devtools_module` will then detect that it doesn't change, hence
introducing the performance improvement.

So while we are still doing a bit too much work in theory, in practice
this change already removes a whole bunch of unnecessary work. I
think that is a step in the right direction and this should result
in deterministic builds as well.

DISABLE_THIRD_PARTY_CHECK=Update TypeScript infrastructure
R=jacktfranklin@chromium.org
CC=marijnh@gmail.com

Bug: 1237438
Change-Id: Ib8ea10ee8df263f0dddf0918bc1732fd696f1105
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3107130
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-19 15:04:34 +00:00
Kriti Sapra 2d85f889eb [CSS]: panels/network
Bug: 1106746
Change-Id: Ia9a56e2a4e30308e474c323f473b3f63a68a993f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3097671
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-18 10:01:01 +00:00
Tim van der Lippe 438d3834df Fix filename in generated tsconfig
The generated JavaScript file ends with `.js` and therefore we
should list the full name in our tsconfig as well. We ran into
compilation issues on https://crrev.com/c/3073941 and they required
the full extension to be listed. It's not clear to me why we
didn't run into this before, but it doesn't seem to break
any of the existing CSS file inclusions either.

R=jacktfranklin@chromium.org
CC=alexrudenko@chromium.org,kritisapra@google.com

Bug: 1106746
Change-Id: I45d593f4aee56b783349c82ea91cbde9b2db7d66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075188
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-05 15:59:39 +00:00
Sigurd Schneider b509ae7393 Avoid generating a double newline in code_generator_frontend.py
Bug: chromium:1106746
Change-Id: If9a4074466c1df88c2810ac188dac00390e5fcea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3074605
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-08-05 11:40:19 +00:00
Kriti Sapra 897c8aa904 [CSS] panels/lighthouse and generate_css_js now escapes ` characters
Since we put the contents of the CSS file in ``, we need to escape any
characters that may appear in comments in the CSS file before adding
it to the .css.js file.

Bug: 1106746
Change-Id: I5e304fac9c254699f64ebe1a8f99d0b13f7307ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3059610
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-07-29 13:00:17 +00:00
Tim van der Lippe 2b21feb560 Use devtools.gni for devtools_location
The Chromium build configuration now defines where DevTools lives.

This requires https://crrev.com/c/3043613 to roll into /build first.

R=alexrudenko@chromium.org

Fixed: 1231495
Change-Id: I2b6721a9541d191492429e9a0027523f7c9bd013
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3043614
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-07-22 13:27:33 +00:00
Tim van der Lippe e4dfc5e76a Fix devtools_location specification
By moving the declaration into default_args, we make sure that we don't
accidentally override any definition in the GN args of an engineers.
This allows us to gradually cleanup devtools_location in Chromium.

R=alexrudenko@chromium.org

Bug: 1231495
Change-Id: I52947737907fa4c536e784eb3e993805623b0489
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3043612
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-07-21 13:34:32 +00:00
Kriti Sapra bc43679a32 Added clean-css to minify CSS on release build
Bug: 1106746
Change-Id: I4165bb4fa30564dc3b8eff942f6cb341a6e31ffb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3037550
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-20 12:22:02 +00:00