Commit Graph
341 Commits
Author SHA1 Message Date
Sandor Major 289e94885a Delete ThirdPartyCookieAccessWarning/Error exemption
The feature reporting these was not launched and got removed in
https://crrev.com/c/6170641

The deprecation configuration for them is deleted in
https://crrev.com/c/6180886

Bug: 355308337
Change-Id: Icda738559fa1dedae5df2106877e46f4a423e7f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6185607
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2025-01-20 23:21:08 -08:00
Nikolay Vitkov b4e8dc7ac2 Update EsLint v9
Bug: none
Change-Id: Iebcc53c0f70a51242f22e4df167cd588b08cefcd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6140633
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org>
2025-01-07 05:41:31 -08:00
Jayson Chen 2e999d1495 Add wicg scheduling API definition
window.scheduler.postTask and .yield are originally not available in the devtools-frontend codebase. This CL added the type definition so Typescript recognizes the API

Bug: 383240467
Change-Id: I4a395aca4e3956ceaa08053dcded5017f0ed10b1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6081857
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jayson Chen <jaysonchen@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2024-12-10 20:09:10 +00:00
Dirk Pranke a2674c024e Fix Python SyntaxWarning in //scripts/build/wasm-as.py.
In Python 3.12, unrecognized escape character sequences in a string
produce a "SyntaxWarning" log message when the file is parsed. The
fix is (usually) to change the string from a regular string to a raw
string, by putting an "r" in front of the leading quote.

Bug: 376746798
Change-Id: Ie888a8de6ae42c4daae6fa5028134722634d70c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5981155
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2024-11-13 17:20:36 +00:00
Simon Zünd abf0cd1847 [deps] Update rollup to 4.24.3 (and update plugins)
Since we have the major version jump, we needed to update quite
a few things to make this work:

  1. rollup4 ships with native binaries. We can't check them into
     our node_modules for all platforms. Luckily they also ship a
     a wasm version. This requires us to adjust the 'binary' path
     to `node_modules/@rollup/wasm-node/dist/bin/rollup` instead.

  2. rollup4 is more strict when it comes to ES modules vs
     CommonJS. We adjust this by renaming the rollup config files.

  3. Some plugins got deprecated so we had to replace them with
     the newer versions (source maps and terser).

Bug: None
Change-Id: If13d590c8185db6ad85b3992d0a869111909dc8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5999255
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2024-11-07 05:25:54 +00:00
Simon Zünd 235aa05d64 [build] Fix esbuild bundling on windows
R=kprokopenko@chromium.org

Bug: None
Change-Id: I19a809628072e94d96a35d04ec8615412b5b68ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5961818
Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2024-10-24 09:52:50 +00:00
Nikolay Vitkov 47310242ac [Cleanup] Enable EsLint quote-props
Enable a EsLint rule to enforce code-style

Bug: none
Change-Id: I4fa6d09a744999dc2967fe989a2339423bb78c86
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5833497
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
2024-09-04 11:57:11 +00:00
Jack Franklin 0560bc9af5 Remove clang-format line from generated CSS
A leftover from when we thought clang-format was incorrectly formatting
this file, which we now know to not be the case.

Bug: none
Change-Id: Ieefa6eea00c64f930727e1cc8dfd669f629dd6e9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5830499
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2024-09-03 11:16:05 +00:00
Jack Franklin 2f408ac801 Roll browser-protocol
This roll requires a manual review. See http://go/reviewed-rolls for guidance.

In case of failures or errors, reach out to someone from config/owner/COMMON_OWNERS.

Roll created at https://cr-buildbucket.appspot.com/build/8737908188620784401

R=devtools-waterfall-sheriff-onduty@rotations.google.com

This CL also updates ESLint to disable formatting the Generated CSS
properties file; this is causing issues on Windows PRESUBMIT where
ESLint formatting fails for currently unknown reasons. Whilst we
investigate this disabling of ESLint unblocks us landing
browser-protocol rolls.

Bug: none
Change-Id: I79c0166add6d8f0748df54e979e76ce32db04e51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5829947
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2024-09-03 04:32:34 +00:00
Simon Zünd e20bdacd07 [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
Change-Id: I33a2ee2817c940e365f810e897de5907bf586093
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5816329
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2024-08-27 10:47:27 +00:00
Philip Pfaffe 0d6c0fcf8d Remove shorthands from the all list
Bug: 329821774
Change-Id: I485b006a333cc7e0b3259bd51eac663992d6fcaf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5793100
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2024-08-19 10:12:24 +00:00
Philip Pfaffe a7a01da4e1 Correctly declare all as a shorthand
Fixed: 329821774
Change-Id: Ic880b097fcf6519cb11c23989223ef0019006173
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5783740
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2024-08-14 14:10:46 +00:00
Philip Pfaffe 2e879471bc [build] add source urls to legacy CSS files
This makes debugging devtools styles much easier.

Fixed: 353448941
Change-Id: Iaea08580f9ad563b40f99a7f34da23055b4c8551
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5712990
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2024-07-17 07:43:20 +00:00
Alex Rudenko 4c70dd1644 Remove TypeScript globals
It looks like they all are part of TypeScript types now.

Bug: none
Change-Id: I517703732cf0ad88891981f7b9e402563dc6e47e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5643075
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2024-06-20 04:27:06 +00:00
Alex Rudenko 19c832a558 Fix tooling to pick up transitive dependencies
Bug: none
Change-Id: Ifc98fc5a9e40c2090f497e856bf978d76f93fb53
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5349136
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2024-03-06 13:05:13 +00:00
Benedikt Meurer 98daa89b1c [cleanup] Remove Platform.DCHECK.
This was originally introduced with https://crrev.com/c/2894390 but we
never started using it consistently. It also comes with the downside
that unlike in Chromium, for DevTools debug builds aren't used as
extensively and frequently, so it's better to stick to either throwing
an Error or console.assert() for the few cases where we used the
DCHECK() function in the past, and thereby ensure that we are notified
of the problems early on.

Bug: none
Change-Id: I90bd465d088be5530530027ea1dbd0ec2b74b12b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5319500
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2024-02-23 11:28:03 +00:00
Ergun Erdogmus 90810655c6 [Watch] Add legacy CSS support, update Chokidar config; log messages
We weren't doing anything for legacy CSS files, this updates to:
* Generate the correct output for them
* Log a message to the console to say that it won't be hot reloaded

Drive by:
* Log when there is a TS compilation error.
* Update Chokidar options to not use polling but use fsEvents.

Bug: none
Change-Id: Ib7edb62201447917bb7bfb5ba40cf137092c1009
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5125718
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2024-01-16 14:11:16 +00:00
Philip Pfaffe 9f9b531a71 Revert "Update esbuild"
This reverts commit 556d230a0e.

Reason for revert: Breaks the build on windows.

Original change's description:
> Update esbuild
>
> DISABLE_THIRD_PARTY_CHECK=DEPS needs to be updated together
>
> Bug: none
> Change-Id: I6af5660c313d5d998b320f688a36a1f3de5beb03
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5025093
> Commit-Queue: Randolf Jung <jrandolf@chromium.org>
> Reviewed-by: Danil Somsikov <dsv@chromium.org>

Bug: none
Change-Id: I331613611d0b8bd56a96a5eff50e452213f6f14b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5033272
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2023-11-16 07:34:14 +00:00
Junji Watanabe 8ec29f4349 [build] Fix devtools_module to propagate outputs to dependents
Similar to https://crrev.com/c/5028815,
`devtools_module` target also doesn't propagate the outputs of
`ts_library` to dependents due to having multiple targets.

This CL addresses this issue by setting `data` and `metadata`
in ts_library target.

DISABLE_THIRD_PARTY_CHECK=only build config change.
Bug: chromium:1501810
Change-Id: Id49410194c92455382942cbf3166ff793964991f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5028958
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-11-16 04:52:23 +00:00
Randolf Jung 556d230a0e Update esbuild
DISABLE_THIRD_PARTY_CHECK=DEPS needs to be updated together

Bug: none
Change-Id: I6af5660c313d5d998b320f688a36a1f3de5beb03
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5025093
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
2023-11-15 15:27:58 +00:00
Junji Watanabe a6d3696757 [build] Fix devtools_pre_built to propagate outputs to dependents
"devtools_pre_built" template has 2 targets: copy_to_gen and group.
This prevents propagating the outputs of copy_to_gen to dependents.

This CL merged the two targets to one custom node_action with
copy-files.js script.

Bug: chromium:1501810
Change-Id: Id9eabb443d6306a8ffcb966c9246c57180825673
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5028815
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Junji Watanabe <jwata@google.com>
2023-11-15 06:24:16 +00:00
Sandor Major ea1adcfc46 Create code-gen exemptions for 3P cookie deprecations
Bug: b:299640963
Change-Id: I3f88acb209115c06b1513c3acb568918323d4a9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4975830
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@google.com>
2023-10-26 15:02:12 +00:00
Alex Rudenko 67e3886186 Roll puppeteer-core
This roll requires a manual review. See http://go/reviewed-rolls for guidance.

In case of failures or errors, reach out to someone from config/owner/RECORDER_OWNERS.

Roll created at https://cr-buildbucket.appspot.com/build/8766374352283153121

R=devtools-waterfall-sheriff-onduty@grotations.appspotmail.com

Bug: none
Change-Id: Ib753eb31a685c2588a7b539dacf69fdc894311ce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4968502
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2023-10-24 08:46:40 +00:00
Ergun Erdogmus 19ffe7f0bc Enable replacing CSS stylesheets on the fly after file change for watch script
This CL updates `generate_css_files` script and `watch` script to enable us to get CSS file changes instantly applied for non-legacy CSS files.

Drive by:
* Added an initial build step before starting to watch changes(1)
* Improved logs to include the time of the change.
* Updated `watch` listener to only get activated on `change` events.

(1) was something I was always missing starting this script.

You can try the behavior by:
* Running `npm run watch` and starting the watch mode.
* Opening the DevTools.
* Updating a non-legacy CSS file and expect to see the CSS change instantly on the opened DevTools.

Bug: none for now
Change-Id: I2aa3ed1b36584d1ef011119d5092d12271fb3017
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4922476
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
2023-10-13 08:47:29 +00:00
Philip Pfaffe 468ab362b6 Shorten filename embedded by code_generator_frontend.py
The code generator embeds the last n entries of its own filename into
the generated InspectorBackendCommands. It used to be n=4, which
happens to create a different filename depending on whether the
script is run from a chromium or a standalone devtools-frontend
checkout. So set n=3.

DISABLE_THIRD_PARTY_CHECK=Updating code genrator

Bug: none
Change-Id: I09fad6d43377c8558709cbe41dba106f9c813caf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4852085
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2023-09-11 13:29:02 +00:00
Hadrien Jaubert 4c4ae29024 [Protocol Monitor] Add support for enums not defined via $ref
In some cases, the enums parameters are not referenced with $ref and there is just an array of all accepted values inside browser_protocol.json
This CL adds a typeRef inside the registerCommand for those cases.
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1474336
Change-Id: I6239a90e225a54c3e884c59b3fbaea9f45eea92a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4793639
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-08-22 09:29:32 +00:00
Jack Franklin 9e787a5d89 Expand DevTools build system documentation
Updating the existing documentation and trying to make some of it a bit
more beginner friendly for those new to the codebase. Plenty more to
add, but this is hopefully a good start :)

Bug: none
Change-Id: I56a8651c7b774a6c8d46d1a2949970fb7272cc64
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4783322
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2023-08-17 11:10:38 +00:00
Alex Rudenko 6e435700ad Fix rollup plugin for DevTools
devtools-plugin for rollup should not treat code inside
Puppeteer folders as DevTools entrypoints. Only the `frontend/third_party/puppeteer/puppeteer.js` and `frontend/third_party/puppeteer-replay/puppeteer-replay.js` should be treated as entry points.

Fixed: 1470202
Change-Id: Ic9c6344f163bc23f5b1d04c936c0446bb07c4d0e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4765265
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-08-09 10:26:55 +00:00
Simon Zünd 7d525b4cc3 [build] Remove 'minify-html-template-literals' plugin from rollup config
R=alexrudenko@chromium.org

Bug: 1471374,1213034
Change-Id: Ia6ee0be69248904129b9e950f1e16f82013ec9b5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4765264
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-08-09 08:45:32 +00:00
Hadrien Jaubert e3454dba71 [Protocol Monitor] Change type of description inside registerCommand to string
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1464499
Change-Id: Ib5ddda1635bb603fbcbc04a9c9d9ea6e53e364f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4678758
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Nancy Li <nancyly@chromium.org>
2023-07-13 12:29:41 +00:00
Hadrien Jaubert d32b2acf8a [Protocol Monitor] Change type of description inside registerCommand to string
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1464499
Change-Id: I1e376bafb5179e24d431e8a1118d24c642d89348
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4683137
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Nancy Li <nancyly@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2023-07-13 10:34:34 +00:00
Hadrien Jaubert a511470fd6 [Protocol Monitor] Change python script to access the description of commands and parameters
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1463211
Change-Id: I506bdd07805a0b481cd73ca0c31baf1dff7977e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4675888
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-07-11 13:17:30 +00:00
Hadrien Jaubert 04f758225d [Protocol Monitor] Add typeRef for strings in array parameters
We need access to the typeRef for array parameters. At the moment string type was not supported.
Moreover, the registerType only contains types relating to objects. This CL adds support as well for types directly relating to arrays.

DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1462270
Change-Id: I0375228a9315e35819c93e7deeb149121765f52b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4665825
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-07-06 08:09:06 +00:00
Hadrien Jaubert 17d2240ee2 Add registerType command for array parameters
The protocol Monitor needs to know the type of array parameters. To do this, the CL will add type reference to registerType inside the InspectorBackendCommands.js file. It is then possible to know what type of parameters array parameters accept.

DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1462096
Change-Id: I623ef4fef1f49f7618f2a874490a515ce22ce1cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4660370
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-07-04 11:09:52 +00:00
Hadrien Jaubert 158c1fc712 [Protocol Monitor] Change python script to create registerType
This CL adds the ability to have access to a map enabling the user to have access to all the keys of object parameters. To do that, this CL modifies code_generator_frontend.py to generate a new command called RegisterType.

DISABLE_THIRD_PARTY_CHECK=make build work

Bug: 1458788
Change-Id: I28bf0baf3841cf3120d103e40925698d3c8114b2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4650362
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-06-29 10:17:47 +00:00
Simon Zünd 6947220e25 [build] Extend devtools_release_sourcemaps to ESBuild bundles
DevTools has two ways to build release builds:
  * tsc + rollup + terser
  * and esbuild.

THe GN arg "devtools_skip_typecheck" decides which of the two
toolchains is used, as the esbuild one is much faster and enough
for the average Chromium developer.

Until now, the "devtools_release_sourcemaps" only works with the
rollup toolchain. This CL implements sourcemaps also for esbuild.

This means that "devtools_release_sourcemaps" now works
independently of "devtools_skip_typecheck".

This is convinient for dogfooding our own source map support in
DevTools: Now we can test against both rollup and esbuild with
DevTools-on-DevTools.

R=jacktfranklin@chromium.org

Bug: 1430396
Change-Id: I54849764a26f3fb539535eccdde7a79f9fd00d5f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4654605
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-06-29 08:48:01 +00:00
Hadrien Jaubert cafa2786f7 [Protocol Monitor] Add support for array parameters
This CL adds the ability to edit array parameters in the Protocol Monitor. To do that, this CL modifies code_generator_frontend.py to  report the array as a parameter type. Runtime type checks in InspectorBackendCommands.js are modified to account for the new parameter type.

DISABLE_THIRD_PARTY_CHECK=needed to build correctly

Screenshot : https://bugs.chromium.org/p/chromium/issues/detail?id=1457512

Bug: 1457512
Change-Id: I368c0146975d95fa024d59f4fb3e7d4ab590722d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4640225
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Nancy Li <nancyly@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-06-27 13:13:08 +00:00
Alex Rudenko 6a4b64d675 Remove special treatment for puppeteer by rollup
And by accident the special treatment for puppeteer-replay.

Fixed: 1455094
Change-Id: Ia80fbd62e5389133e7c38717365d772a94fb5585
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4637784
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-06-23 04:32:02 +00:00
Ari Chivukula 9303e842f5 [Deprecations] Keep metadata after usage period has passed {devtools}
We need to retain the metadata for deprecations past the point where
they are no longer dispatched on stable. This provides a way to turn
codegen off at the same time as we note the milestone when the metadata
can be safely removed.

Bug: 1451772
Change-Id: I9fb9ef4b8fbecaa2fb8d14ad65016102387bf722
DISABLE_THIRD_PARTY_CHECK=Testing codegen changes
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4594037
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-06-07 08:31:19 +00:00
Mathias Bynens 12708639c7 Remove custom escaping logic in favor of json.dumps
As of ES2019, JSON ⊂ ECMAScript [1], meaning we can use JSON
serialization to embed string literals into JavaScript programs.
This eliminates the need for any custom string escaping logic,
since we can simply use `json.dumps` now.

[1]: https://v8.dev/features/subsume-json

DISABLE_THIRD_PARTY_CHECK=added missing escaping to *.json5 file https://crrev.com/c/4401593

Bug: chromium:1411444
Change-Id: I9f0c5b2dfa218951bcb0d31432c9484666307f7d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4402896
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
2023-04-05 13:42:58 +00:00
Simon Zünd 3a67337d3a [build] Add source maps for release builds
This CL adds a new GN flag "devtools_release_sourcemaps" (off by
default.. When set, we'll instruct rollup to generate source maps for
the bundles. This means that every entrypoint, e.g. 'common.js', now
has a corresponding source map ('common.js.map').

We also use 'rollup-plugin-sourcemap'. It is responsible for consuming
the source maps generated by the TypeScript compiler and merge them
with the source map produced by rollup. This allows us to still
debug on the level of TypeScript files even for minified release
builds.

R=jacktfranklin@chromium.org

Fixed: 1430396
Change-Id: I3a0f94dc722f19d066725aef3544652c6a19c95a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4402891
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-04-05 08:02:45 +00:00
Ari Chivukula 52c774ad47 [Deprecations] Fix devtools string escaping
I noticed that in c++ I had to manually add an extra backslash to escape
the message in codegen, so I checked and saw that in:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/generated/Deprecation.ts;drc=6b47192b2e719a562ef1a88e19bc7572e6a187ab;l=16
CanRequestURLHTTPContainingNewline had `\(n|r|t)` as part of the
message, but that once the string was extracted in:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/third_party/lighthouse/locales/en-US.json;drc=de6c4e5973980ad98d7d1699faa4e1059f102c4d;l=2120
it became `(n|r|t)` because \( isn't a valid javascript escape.

I added the same fix I did in c++ and replaced \ with \\ in the codegen
to preserve the intended escape that's lost in the python string decode.

Bug: 1411444
Change-Id: Iead1a2909a63eba3ea39c5f0524c63fb532534de
DISABLE_THIRD_PARTY_CHECK=Fixing codegen
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4240938
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
2023-02-10 20:17:24 +00:00
Ari Chivukula 6b47192b2e [Deprecations] (5) Replace browser_protocol.pdl enum {DEVTOOLS}
This is a reaction to the change from
https://chromium-review.googlesource.com/c/chromium/src/+/4226621

If you want to wait for
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4227697
To go in and have me rebase that's fine.

This CL is part of a series:
(1) Add deprecation.json5 file
(2) Add existing deprecations to deprecation.json5
(3) Copy deprecation.json5 into devtools_frontend via update flow
(4) Update README to reflect devtools codegen
(5) Replace browser_protocol.pdl enum
(6) Codegen c++ code

Bug: 1411444
Change-Id: Ia38af483be2ec52cd5a709deb69313271c1c9464
DISABLE_THIRD_PARTY_CHECK=The protocol changes force codegen changes
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4231800
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
2023-02-08 18:15:29 +00:00
Simon Zünd 2ce6754100 Auto-generate deprecation info from rolled blink file
We now roll a "deprecation.json5" file from blink into DevTools that
serves as the canonical source for deprecations: It contains the
english message + note for translators as well as additional
metadata such as milestone and chrome feature number.

To use the .json5 in a somewhat type-safe way, we generate
TypeScript that is type-checked against the DeprecationIssueType
from CDP.

Note that we also generate a standard UIStrings structure that
we'll import in "DeprecationIssue.ts". An alternative would be to
collect to strings directly from the .json5 but that would
complicate "npm run collect-strings" as we'd have to teach those
scripts how to parse the .json5.

DISABLE_THIRD_PARTY_CHECK=Add newly generated file
R=alexrudenko@chromium.org

Bug: 1411444
Change-Id: Ifcfd4291ebfc3a70c100ba4a5fbefc485d4a5493
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4227691
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-02-07 11:06:16 +00:00
Alex Rudenko 71be973357 Use correct autoninja filename on Windows
See https://docs.python.org/3/library/os.html#os.name

Fixed: 1411728
Change-Id: I57498dace944d655cfd6cc1f4423dfc8cfd415e3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4217072
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-02-02 11:00:16 +00:00
Jack Franklin a682d93584 Re-enable cssnano with "lite" preset
We had to disable CSSNano because it was causing broken fonts in release
builds (exact reason TBC). This CL installs the `cssnano-preset-lite`
package which applies only the following optimisations:

1. remove whitespace
2. remove empty rules (e.g. `div{}`).
3. remove comments

This should be far less risky and unlikely to cause unexpected
breakages.

DISABLE_THIRD_PARTY_CHECK=installed & used cssnano-preset-lite in the
same CL.

Bug: 1399763
Change-Id: I7fdd8b70b02a2c1a5e1c71a87c7ba145114e6e4b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4111923
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-16 12:38:30 +00:00
Alex Rudenko e477438529 Disable CSS minification
The new minifier seems to break CSS in the subtle way (different font is used in release builds) and it prevents the roll [1]. changhaohan@ bisected the failure to css-nano rollout. I think a potentially increased binary size is better than a broken roll or bugs, so I suggest we disable CSS min for now.

[1]: https://chromium-review.googlesource.com/c/chromium/src/+/4105761

Bug: none
Change-Id: Ie663f4d3b048b9e1e5e6f84bce296e169a5a3203
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4104382
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-12-14 11:33:47 +00:00
Jack Franklin 5e0a670680 Fix generate_css Ninja input
Now we are using CSSNano, not clean-css, this input needs to be updated
before we remove clean-css from the build.

Bug: 1399763
Change-Id: I2adc192d9f79bc99df7dd1a178e4bdb3c5e3feeb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092736
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-12-09 15:17:11 +00:00
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