Commit Graph
505 Commits
Author SHA1 Message Date
Mathias Bynens d63cf4f023 De-obfuscate X-Client-Data header values in Network tab
Screenshot: https://i.imgur.com/LJHFIp9.png
Note that the screenshot shows this as a response header instead of a
request header, since that was easier to test. In real-world scenarios
it would be a request header instead, but the UI looks the same.

CL preparing the ClientVariationsParser for use in the DevTools UI:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065

Bug: chromium:1103854
Change-Id: Ifb63c011df2ea7af8aeb47dd615e2b20863a02c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-24 09:04:39 +00:00
Mathias Bynens 718ac79a11 Integrate client variations parser
This patch configures the Closure typings and makes it possible to use
ClientVariationsParser.js in DevTools UI code.

These changes have already been reviewed [1], but they are now split
into a separate CL.

[1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062

TBR=alexrudenko@chromium.org,changhaohan@chromium.org

Bug: chromium:1103854
Change-Id: Ic94d9c93727f3b6251d684bf3960e3a9de8f1392
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316071
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-23 16:41:08 +00:00
Jack Franklin 15a98cd148 Use local tsc for cross-referencing script.
So that we don't depend on people having TypeScript installed globally.

Change-Id: Iaaf0a5c1c28fe5775bc58a67289906df4391db84
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316069
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-23 15:55:18 +00:00
Mathias Bynens 4e81261c93 Revert "Integrate client variations parser"
This reverts commit 4efee5ce8a.

Reason for revert: causes build warning

Original change's description:
> Integrate client variations parser
> 
> This patch configures the Closure typings and makes it possible to use
> ClientVariationsParser.js in DevTools UI code.
> 
> These changes have already been reviewed [1], but they are now split
> into a separate CL.
> 
> [1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
> 
> TBR=alexrudenko@chromium.org,changhaohan@chromium.org
> 
> Bug: chromium:1103854
> Change-Id: Ia6533cbed8e33627109f244af67c122c2b2d2b2f
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Commit-Queue: Mathias Bynens <mathias@chromium.org>

TBR=isherman@chromium.org,mathias@chromium.org,changhaohan@chromium.org,alexrudenko@chromium.org

Change-Id: Ife1a02ac07edc9fefb4fcf0f43a3a032300cf2b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1103854
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316067
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-23 15:24:59 +00:00
Mathias Bynens 4efee5ce8a Integrate client variations parser
This patch configures the Closure typings and makes it possible to use
ClientVariationsParser.js in DevTools UI code.

These changes have already been reviewed [1], but they are now split
into a separate CL.

[1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062

TBR=alexrudenko@chromium.org,changhaohan@chromium.org

Bug: chromium:1103854
Change-Id: Ia6533cbed8e33627109f244af67c122c2b2d2b2f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-23 15:05:08 +00:00
Paul Lewis 2f7079da66 Adds more cases for TS/GN cross-reference
TBR=jacktfranklin@chromium.org

Change-Id: Ib80f21e3410179e305b8fe7433658738144a03af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316064
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-23 13:46:58 +00:00
Paul Lewis a1448c2f77 Adds cross reference script
It is possible for TypeScript to import a file that is not included in
the corresponding devtools_entrypoint as a dependency. In many cases
this would likely cause the build to fail, but it's also possible that a
dependency might have been provided as a dep of another entrypoint.
Given that ninja parallelizes builds this results in a race condition
where on some builds the dependency that wasn't declared is there, and
on some builds it is not. This is further complicated if build artifacts
from previous builds are kept around.

This CL introduces a script that can be run manually that cross
references the files that GN knows about, and the files that TypeScript
expects to be able to import. Any files expected by the TypeScript
compiler that are not declared in the BUILD.gn (even indirectly as a
dep of a dep etc) will be flagged.

Change-Id: Ieb95600f11bfc20e0e71d8792a7f344b13a0fb8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316063
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-23 13:15:28 +00:00
Simon Zünd 94beb690c0 Use 'forward_variables_from' in 'devtools_module'
This CL changes 'devtools_module' to use the standard way of
copying properties from the invoker. Not all devtools_module will
provide 'deps'. The current code assumes its always there, so modules
have to provide an empty deps list, otherwise we get build errors.

R=jacktfranklin@chromium.org

Change-Id: I49fd82ab1e54816c02fb99eccb70287d845b8233
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2310457
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-07-22 13:23:30 +00:00
Johan Bay 9dd9a4b882 Roll Puppeteer from v4.0.0 to v5.2.1
DISABLE_THIRD_PARTY_CHECK=updating node_modules deps

Change-Id: Ic6a2b99314bc3cd05f6283e261d8aa952bc56984
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2310451
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-22 06:54:36 +00:00
Brandon Goddard 55b591c650 Revert "Copy sourcemaps over in is_debug mode"
This reverts commit 9702c2c5dc.

Reason for revert: On Windows, this is failing to gn gen with is_debug = true with the following error: https://imgur.com/g3g4ADu

I bet the issue could be the source maps being copied over with fwd slash instead of os specific path separators


Original change's description:
> Copy sourcemaps over in is_debug mode
>
> DISABLE_THIRD_PARTY_CHECK=typescript library change
>
> Change-Id: I993b8a3c742cc7feea1ae1dee250aad7469eb22b
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302069
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=sigurds@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org

Change-Id: I0e4c1b308beee837f6be1b2e642350656fb284d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2310810
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-07-21 19:03:55 +00:00
Jack Franklin 9702c2c5dc Copy sourcemaps over in is_debug mode
DISABLE_THIRD_PARTY_CHECK=typescript library change

Change-Id: I993b8a3c742cc7feea1ae1dee250aad7469eb22b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302069
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-21 15:12:12 +00:00
Paul Lewis 1434e6f967 Changes ninja hardlink copy for file copy
The internal ninja copy action is, for Linux and Mac, the creation of a
hardlink. In the case of an is_debug = false build, we copy the
devtools_entrypoint file with ninja to the gen folder. However, should
the file then change in the gen folder, those changes will be reflected
back in the original source file since the two are hardlinked. This does
happen when the JavaScript file moves to being managed by the TypeScript
compiler, for example, because tsc often changes blank lines and adds
sourcemap information to the file. If the gen folder is empty and no
hardlink exists prior to build, there are no issues. If, on the other
hand, the hardlink exists, and the TypeScript compiler runs, the file
written in the gen folder will update, and then so will its original
source.

The ways to resolve this reflection back to the source folder is either
by deleting the gen folder before rebuilding (where one anticipates
changes being reflected in source), or, instead of using the ninja copy,
using an action to call out to a script that will ensure that a new file
is created and not hardlinked.

This CL chooses the latter path.

Change-Id: Id2cc8acdc240eb73ac736ddaf6f1eabdd08f8359
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308534
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-21 14:34:02 +00:00
Paul Lewis 839037fe83 [TypeScript] disallow explicit any
This CL explicitly disallows use of the `any` keyword via eslint. This
is to make sure we don't accidentally miss typing info. This CL also
adds eslint-ignore statements for existing uses of any (mostly in tests)
as well as fixing a few cases where the types were simple enough to add
quickly.

R=jacktfranklin@chromium.org

Change-Id: Ia913a30d63c1ae3d969785af332a8dde512cc275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308544
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-21 14:31:32 +00:00
Jack Franklin 12ba06cc91 Update component_docs README
Some of the steps have changed since this was written.

Change-Id: I0ac49ab852a28109b335ff19c7c2f43d4329f7ca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2306157
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
2020-07-20 11:35:27 +00:00
Paul Lewis 559e6e50d2 Moves generated scripts to devtools_module
Bug: 1101738
Change-Id: I8457d73aa10e8559a37375c247eab6718b48714b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302070
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-20 08:34:07 +00:00
Simon Zünd 868adc06e7 Don't add sourceURL comments to HTML and Markdown files
Served resources automatically have a 'sourceURL' comment appended
to their content. This CL omits the sourceURL comment for HTML and
Markdown files and keeps Runtime.js in sync with a build script.

R=tvanderlippe@chromium.org

Bug: chromium:1099162
Change-Id: Iee11fd8f620bf736dcd7c4d1bf60e0c1ee49ea4a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302594
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-17 12:22:14 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Tim van der Lippe 139b08025f Remove checks for generated files from devtools_entrypoint
Since we have now implemented these checks in the build system itself,
we can remove the checks from `check_gn.js`.

R=aerotwist@chromium.org

Fixed: 1105861
Change-Id: If0d01ba6b16fecbcaf9e894265564ae1b409b5df
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302590
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-16 16:05:21 +00:00
Paul Lewis 1213aa4256 Asserts that all devtools_module files are listed in all_typescript_modules
Bug: 1105861
Change-Id: I1e23ec3912ce4e8c591033d3f5223ec52e5c430c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302075
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 15:41:41 +00:00
Paul Lewis cb26e04da6 Asserts that each entrypoint is listed in devtools_module_entrypoints
Bug: 1105861
Change-Id: Ie62b2d5ac043baeff0f4e885508b23e201efcb4d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302074
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 15:36:21 +00:00
Tim van der Lippe ced0044c7c Make devtools_module only visible to same-file targets
This prevents other targets to depend on a `devtools_module` where
they should have depended on the `devtools_entrypoint` instead.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Change-Id: Id92b1871a805c30ed9b45a448ce3181adf7f7da9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302073
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-16 15:08:01 +00:00
Tim van der Lippe fade2847b8 Add documentation for the usage of devtools_{entrypoint,module,pre_built}
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Id20494d6524c5fc108dee8da26991a7458fab736
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300113
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 12:31:51 +00:00
Jack Franklin 187489319e Reland "Ship new ElementsBreadcrumbs to production"
This reverts commit 8794ac6b44.

Reason for revert: Fixed issue with missing file that caused browser tests to fail.

Original change's description:
> Revert "Ship new ElementsBreadcrumbs to production"
>
> This reverts commit d8d96d5f0a.
>
> Reason for revert: Breaks browser_tests: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8874686472852976032/+/steps/browser_tests/0/logs/Deterministic_failure:_SitePerProcessDevToolsSanityTest.InspectElement__status_FAILURE_/0
>
> Confirmed locally on a Linux Debug build that this is the offending CL.
>
> Original change's description:
> > Ship new ElementsBreadcrumbs to production
> >
> > This CL ships the new elements breadcrumbs component to production,
> > replacing the old legacy breadcrumbs with the new custom element that
> > we've built to replace it.
> >
> > Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
> > keep the diff on this CL clear and easy to follow. I plan to follow this up
> > with another CL that does the renaming.
> >
> > Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY
> >
> > Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
> > Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
>
> TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: I62be4e9e3bd1fc328733ded3fff377ffd50e2d81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300491
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

TBR=aerotwist@chromium.org,szuend@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org


Change-Id: Iae6aa0ce84a57312a29d79344059f887f337c5bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300494
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 10:21:51 +00:00
Simon Zünd 8794ac6b44 Revert "Ship new ElementsBreadcrumbs to production"
This reverts commit d8d96d5f0a.

Reason for revert: Breaks browser_tests: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8874686472852976032/+/steps/browser_tests/0/logs/Deterministic_failure:_SitePerProcessDevToolsSanityTest.InspectElement__status_FAILURE_/0

Confirmed locally on a Linux Debug build that this is the offending CL.

Original change's description:
> Ship new ElementsBreadcrumbs to production
> 
> This CL ships the new elements breadcrumbs component to production,
> replacing the old legacy breadcrumbs with the new custom element that
> we've built to replace it.
> 
> Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
> keep the diff on this CL clear and easy to follow. I plan to follow this up
> with another CL that does the renaming.
> 
> Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY
> 
> Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org

Change-Id: I62be4e9e3bd1fc328733ded3fff377ffd50e2d81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300491
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-07-16 07:14:53 +00:00
Jack Franklin d8d96d5f0a Ship new ElementsBreadcrumbs to production
This CL ships the new elements breadcrumbs component to production,
replacing the old legacy breadcrumbs with the new custom element that
we've built to replace it.

Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
keep the diff on this CL clear and easy to follow. I plan to follow this up
with another CL that does the renaming.

Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY

Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-15 15:15:15 +00:00
Tim van der Lippe 91128ac2ba Move embedder-scripts to front_end/BUILD.gn
These files are part of `front_end/` and therefore should be built
in that directory.

R=aerotwist@chromium.org

Change-Id: I295a34eafd39f87a64b930dd11738c83db3d4f9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300102
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-15 14:29:45 +00:00
Tim van der Lippe bb7978bb9e Update several @types packages
These @types packages were outdated. Additionally, make sure to
includes these files in the `typescript.gni`, to cause TSC to
rerun whenever they change.

DISABLE_THIRD_PARTY_CHECK=NPM updates
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Change-Id: Idce2ec5d48e280c56b496599b56d5cc4c30df404
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297397
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-15 10:01:04 +00:00
Jack Franklin 264237a972 Upgrade TypeScript ESLint dependencies.
DISABLE_THIRD_PARTY_CHECK=node_modules update

This was an attempt to fix https://crbug.com/1102821 however the issue still
appears. I expect it will until TS4.0 is out of beta and the ecosystem catches
up.

We were however on a much older version so I took the opportunity to update us
to the current latest version.

Change-Id: I8332409e9de50d60f6284eef5098b55a7f9535c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2299995
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-15 09:29:44 +00:00
Tim van der Lippe 6ec6dea4ea Fix elements buildgn
This allows us to cleanup the check_gn.js script as well, as we
can now always use `skip_rollup` as leading example, rather than
custom exempted folders.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: I5dca1a79a188857e3ee2e0640dc19b46d337be70
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297392
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-14 15:03:46 +00:00
Jack Franklin 40c0f70668 Fix bridges generation bugs
* Missing the import statement to pull in the actual component itself.

* It was including lifecycle methods in the output, which it does not
  need to do as no user code would ever directly call them, so the
  bridges do not have to include them.

Change-Id: I98d698b90eb7608df95baaa94f980eab8ee0e604
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287518
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-14 14:46:26 +00:00
Tim van der Lippe 4258d72939 Migrate all front_end/third_party packages to devtools_pre_built
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I477a015ef25761fe59e7299c38de541a8d3848a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297421
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-14 14:12:06 +00:00
Tim van der Lippe a0b0ab6899 Migrate common/ to devtools_entrypoint
R=aerotwist@chromium.org

Bug: 1101738
Change-Id: I012e40f3a2bcfae91af1bd3ef38a567c7ab96822
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297419
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-14 14:01:06 +00:00
Tim van der Lippe 312069a404 Introduce devtools_pre_built
This template makes sure that the sources are copied both to gen
and the resources/inspector folder

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Ic6b9c52845abafad45cacf76565c7c3721ec3935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297479
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-14 13:37:56 +00:00
Tim van der Lippe 2957dc8af0 Move data_deps to front_end
Since `devtools_{entrypoint,module}` now properly use the data_deps
to move data over to isolates on CQ, we can move these back into
the proper location of `front_end/BUILD.gn`

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: I858d863471df549e6b19b23ab41b1ff4d189e40c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2295861
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-14 13:07:26 +00:00
Tim van der Lippe 52c8c76899 TypeCheck formatter_worker/FormatterWorker.js with TypeScript
Required changes:
- Add CodeMirror types as globals
- Add support for `is_web_worker` in `ts_library` and
`devtools_module`, as the FormatterWorker is a worker. This
also moves the `lib` specification out of `tsconfig.base.json`,
as we now need to dynamically generate it
- Fix (seemingly unrelated) issues with untyped events in other
files. I don't understand why TSC suddenly started to complain
about these.

DISABLE_THIRD_PARTY_CHECK=TypeScript fixes
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1098730
Change-Id: I7d33c22983f2fe5e793c20fa5d56411d996ec999
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2294985
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-14 10:07:30 +00:00
Tim van der Lippe f377647886 Fix data_deps for devtools_{module,entrypoint}
This moves `front_end/formatter_worker:bundle` out of the `data_deps`
of `devtools_all_files`. Instead, it uses `data_deps` of the eventual
`devtools_entrypoint` definition, which is a `copy_gen_to_resources`
action.

Change-Id: Ic0252c22928f7d574be753e7fba57c6f7d34ef6f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2292283
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-14 09:56:20 +00:00
Tim van der Lippe 8b21270f6e Add @types/codemirror
They are used in the formatter_worker files

DISABLE_THIRD_PARTY_CHECK=Add node package
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1098730
Change-Id: I3c236386dfccd2c12b6379f8bbb5bc9232061734
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2294984
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>
2020-07-13 15:34:39 +00:00
Tim van der Lippe 334be38e4a Move devtools_module_entrypoints to separate gni file
DISABLE_THIRD_PARTY_CHECK=Add owner access to new file
R=yangguo@chromium.org

Bug: 1097043
Change-Id: I93f65c9bdd1f0e4418738a3bc27ba6b4fdad1e42
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2256984
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-07-13 14:50:59 +00:00
Tim van der Lippe 85f1494179 Move all_devtools_files to separate gni file
DISABLE_THIRD_PARTY_CHECK=Add owner access to new file
R=yangguo@chromium.org

Bug: 1097043
Change-Id: I577f317ab5371b73bf135aa501594ed7ef6ced3b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2256983
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-07-13 14:27:29 +00:00
Tim van der Lippe 5822c1a2fc Move all_devtools_modules to separate gni file
This allows us to give COMMON_OWNERS edit access, while all other
build scripts remain INFRA_OWNERS access. Moreover, this should
make reading and traversing /BUILD.gn easier.

DISABLE_THIRD_PARTY_CHECK=Add owner access to new file

Bug: 1097043
Change-Id: Ic2d9cfa89bc6f24b7b89817d1118f5b5ffb2d188
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2256982
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-07-13 14:17:39 +00:00
Jack Franklin 4bf640308b Create {copy_sources,copy_gen}_to_resources gni helpers
Sometimes in devtools we want to take a file directly from sources into
the `resources/inspector` folder, and other times we want to move files
from `out/Default/gen` into `resources/inspector`. Rather than have one
command for both of these and do nasty path wrangling to put the files
in exactly the right place, we instead split them into two templates.

This is nasty but our hope is we can hide this complexity behind other
templates that most people will use; this shouldn't be used directly by
people very often.

Change-Id: I3e7acbbed0c6d1bb8ad69a62cbe7341ad856d98b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287517
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-13 09:01:49 +00:00
Tim van der Lippe 3c9765775e Migrate front_end/sdk/ to devtools_{module,entrypoint}
This also adds support to devtools_entrypoint for specifying a
legacy `ts_library` that is running on a `JavaScript` file. The
field `is_legacy_javascript_entrypoint` must be assigned an
array of strings that are references to CRBugs that fix them.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: If0935e9446a71de30c27521e9b2b6da1cfdd4469
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284841
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-10 12:46:49 +00:00
Tim van der Lippe c33de4fd55 Add support for skip_rollup in module.json
For folders that already have a `devtools_entrypoint` target, we
should skip Rollup as part of `build_release_applications.py`. To
remove the hardcoded list of skipped folders and enable
parallelization of a fixit to migrate all folders, we have to put
the information in the `module.json` instead.

Once all folders are migrated to `devtools_entrypoint`, we can remove
the field and the Rollup logic in `build_release_applications.py`.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: Ibadab13e87cf28622c40896a56f6ed18cc34bea2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284838
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-10 08:49:48 +00:00
Peter Marshall d74ef01edb tests: Request a free port for the hosted mode server
Rather than hardcode the port to use, use port 0 which
requests any free port from the OS. We report the port
we end up using to the caller over IPC, if an IPC
channel was opened by the caller.

We wait for the port to get reported before starting
the chrome instance.

Previously we started the hosted mode server and then
started chrome without waiting for it to start. This is
probably fine in most situations because chrome takes a
while to start and we need to do extra setup there, so
we have a long time before the server needs to respond.

For parallel test mode, we need to make sure we start
the server on a free port. This also makes the mocha
runner more robust to failures e.g. if we accidentally
leave the server running and the port is taken.

This doesn't slow down the startup time of the e2e
test runner at all, according to timing of local runs.

Bug: 1101784
Change-Id: Ibb14d5a177ba5f9e257743824770bff3d5ccb033
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2285124
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-08 14:51:06 +00:00
Simon Zünd a9f48fb117 Introduce thin wrapper module for third_party package 'marked'
This CL adds the //front_end/marked module as a thin wrapper for the
third_party package. Please note that //front_end/marked is currently
only usable from Closure land. Support for TypeScript-land is planned
but currently blocked on infra changes.

R=aerotwist@chromium.org

Change-Id: I91d0ce2772271ce09d608113ecb6fe13b48e1af2
Bug: chromium:1099162
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287511
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-07-08 12:01:16 +00:00
Jack Franklin 6aa02364f0 Fix component _bridges generation for TypeScript 4
This CL fixes a number of bugs that we discovered in the bridges
generation. Some come as a result of breaking AST changes in TypeScript
4, and others are a result of using TS features in the components code
that we haven't used before and therefore the generator code needs
updating accordingly.

The list of changes are:

* Dealing with `Readonly<X>` and `ReadonlyArray<X>`, discarding the
  wrapper type and parsing the inner type.
* An update to the null checking code as TS4.0 changed how `null`
  literals are represented in the AST.
* Update the generator tree walker to avoid trying to parse `import * as
  ...`.
* Error nicely if we detect an interface being referenced as `Foo.Bar`.
  We only support referencing interfaces directly.

Change-Id: I2faf314d28281863b2ad9e1695cde8ff60014ead
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284825
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-07 14:13:35 +00:00
Eric Leese 66342552ce Add helpers for debugging and snippet tests
Changes include:
 - Test server handles URLs with escaping better.
 - Logging from DevTools frontend now logged by the test.
 - Helper to turn on CDP logging - for debugging only.
 - click helper improved to allow specifying maximum distance from
   left, for when an element extends far beyond its containing
   element.
 - New pressKey helper that makes keyboard shortcuts easy.
 - Helpers to modify and save a source pane and to get the text of
   the line of code where we are stopped.

Bug: 1094436
Change-Id: I389eaa680bb0771a45104f470647f67b4fa5d1d9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282811
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
2020-07-07 13:45:42 +00:00
Jack Franklin 77038d2910 Fix test_helpers on Python 3
The `print` statement with no wrapping parens causes a syntax error in
Python 3.

Fixes: 1102315
Change-Id: I08f1908f2af998d775c0723caafa5d68973e9d0c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282510
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jecelyn Yeen‎ <jec@chromium.org>
2020-07-07 13:31:22 +00:00
Paul Lewis 8bf8ca6dc7 Fix tsconfig generation paths
The logic for generation of tsconfig files in devtools_entrypoint made
some assumptions about the locations of other targets. This CL updates
the logic to be more robust with respect to paths.

R=tvanderlippe@chromium.org

Bug: 1011811
Change-Id: I211d607df61d35a2e025e9ca4b049b316b37a364
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282818
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-07 10:29:32 +00:00
Tim van der Lippe 98a014f2e1 Migrate IdentityFormatter to TypeScript
This introduces the first TypeScript-authored file that also makes
use of TypeScript features. To do so, we have to perform several steps:

1. Move the `formatter_worker` typescript files into a new template called
`devtools_module`. This template takes care of running TypeScript and
copying the files it generates to `resources/inspector`. (The latter can
be removed when we are in a position to do so)
2. Move the files out of `all_devtools_modules` into (yet another) GN variable.
We should clean this up by using the `grd_file_group`, which is possible
with an integration with `devtools_module`. However, for simplicity's sake
I decided to fix that in a follow-up. The integration of `devtools_module`
with the GRD action script would then finally allow us to remove the duplication
of all of these file strings in multiple places.
3. To make sure that the buildgraph remains intact, we have to perform
the copy-step after the typescript-step. However, this means we need to use
a different name than `target_name` for the typescript compilation. We run
into issues there, as the project references assume that the names are the
full folder names (e.g. `../formatter_worker`). If we would then use a different
name for the `ts_library` action, then we generate a `tsconfig.json` with
the wrong name. To counteract that, introduce a (temporary)
`typescript_config_name` where we can explicitly set the name of the `tsconfig.json`
that we generate. This is not ideal and I am still thinking of a better
alternative, but haven't figured out a solution yet.

DISABLE_THIRD_PARTY_CHECK=Typescript fixes
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1098730
Change-Id: I1457067845cdedbc7d4ce6a80c12d7943b67087c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282809
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 10:28:17 +00:00