Commit Graph
12 Commits
Author SHA1 Message Date
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 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
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
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
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
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
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
Kriti Sapra 15269c4cf5 Created script to create .css.js files for CSS files
Bug: 1106746
Change-Id: I7612419d19815ce5ad67c842215f65f93ca90769
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2960177
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-06-18 11:18:54 +00:00