Commit Graph
523 Commits
Author SHA1 Message Date
Philip Pfaffe 7d128bd540 [eslint] Ensure that linting doesn't crash on a custom it.skip
Change-Id: I3fc841a4c0e34b1c29686157ba3089e620036f51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332230
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-31 13:35:59 +00:00
Peter Marshall a29e76f622 tests: Use source maps for better error output for e2e tests
Explicitly depend on the source-map-support package. Other packages
already used this indirectly so the files already exist in node_modules.

Add source-map-support/register to the require list for mocha which
means every e2e test will have source mapped error stacks by default.

Bug: 1104096
Change-Id: Id185ee76e82c100f1f763195673759f3f2319090
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332222
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-07-31 12:45:19 +00:00
Jack Franklin 425100947a Fix errors with Object type in component bridges
The component bridge code would think `Object` is a type that it needs
to define as a Closure typedef but in fact it doesn't, it's built-in to
TS and maps to Closure's Object type. So if we find any, don't try to
define them to be converted, and instead output it directly as an
`Object` in Closure.

Change-Id: Ied707d131b95a8f595832f6e2080722f49522efb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2329778
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-07-30 16:20:30 +00:00
Jack Franklin 4e556fa817 Copy sourcemaps into resources/inspector in is_debug mode.
This introduces the change that was reverted in https://crrev.com/c/2310810,
with the fix for the revert issue.

DISABLE_THIRD_PARTY_CHECK=ts library change

Change-Id: Ibf4e6e6167b8fce56c83afa7319389fa5520db38
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2325215
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-29 15:36:14 +00:00
Jan Scheffler f3277b2ec7 Add _sources suffix to ensure sorting in .gni files
This cl adds a _sources suffix to make sure files are sorted in
all_devtools_modules.gni and devtools_module_entrypoints.gni
[see: https://gn.googlesource.com/gn/+/master/src/gn/command_format.cc#386]


Change-Id: I21962895f7b72f1052c89b30cefdc843f7b36624
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318263
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-07-28 11:53:11 +00:00
Jack Franklin db4aae28e7 Include nested interfaces when extending types
This CL fixes a bug in the bridges generation where nested types would
not correctly be added to the bridge when they were referenced via an
extended type.

For example, consider this code:

```
interface Detail {
  id: number;
}

type NamedThing = {
  name: string;
}

type Person = NamedThing & { details: Detail[] };
```

The bridges generator will correctly recognise that it needs to define a
`Person` typedef that includes all the members of `NamedThing` and also
the `details` field. But without this CL it will not realise that the
`Detail` interface is also referenced and therefore needs to be added to
the bridge.

This CL ensures when we extend types that we check their members for any
interfaces that are also required.

Change-Id: I5cf0de3ebc63dd56e71af8284ba6fe9fc10b396e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2320836
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-07-28 11:37:51 +00:00
Jack Franklin 7a25be0377 Make cross-reference script show errors
I had a bad gn file and running the cross-reference script didn't show
that but instead treated it as if gn knew of no dependencies and
therefore gave me a huge output of JS files that were not declared as gn
deps.

If the script gets an error, it should bail and log that error rather
than treat it as if there were no gn deps found.

Change-Id: I5672e97581659836adbf2fc1aa4fc5f837b78835
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317308
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-28 08:54:01 +00:00
Mathias Bynens 4a0d19365c Reland “De-obfuscate X-Client-Data header values in Network tab”
Reland of: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062

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

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

Bug: chromium:1103854
Change-Id: I6b959a1d57bcbc84f8571257a88fcbec805bf330
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318257
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-28 06:54:51 +00:00
Kalon Hinds 1ed85887c9 Detect URL-only strings in localizability check script
This patches adds a localizability check that detects and errors on
URL-only strings that are localized. Since URLs cannot be translated
there's no purpose in creating and maintaining grdp file entries for
them.

Change-Id: I3228f2935f54c839833822fd61374d3ce4ea68c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2319836
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Commit-Queue: Kalon Hinds <kahinds@microsoft.com>
2020-07-28 00:00:20 +00:00
Jack Franklin 1e26f876a4 Component bridges: support overriding fields
Now the bridges generator supports extending types it also has to be
wary of types that override existing fields. For example:

```
type Person = { name: string, age: number};

type Jack = Person & { name: "jack" }
```

When we convert that to Closure, the bridges script needs to recognise
that the `Jack` type overrides the `name` field from Person, and
generate Closure that has:

```
* name:"jack"
* age:number
```

This CL makes that change by first collecting all members when we
extend, weeding out duplicates, and then converting them to Closure.

Change-Id: Iacd7fbf39844515257d2c331d6c4c4454b3bba60
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318261
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-07-27 15:15:37 +00:00
Jack Franklin 132769c3d3 Component bridges: support types that extend types
With this change we support:

```
type Person = {}

type SomeOtherPerson = Person & {...}
```

Closure doesn't have a concept of types being extended, so the bridges
code will instead parse all the types and generate a new type for
Closure made up of all the members of any types that are extended.

Note that this CL does _not_ add support for interfaces that extend
another, ONLY types. Interface extending is coming in a follow up CL.

Change-Id: I3f8253663430d16f28f1bdc3c40e582d8ff09248
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318258
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-07-27 13:18:17 +00:00
Mathias Bynens 43af8ef5d3 Revert "De-obfuscate X-Client-Data header values in Network tab"
This reverts commit d63cf4f023.

Reason for revert: [5770:5770:0726/142022.954931:WARNING:devtools_ui_data_source.cc(206)] Unable to find DevTools resource: third_party/chromium/client-variations/ClientVariationsParser.js

Original change's description:
> 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>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1103854
Change-Id: Id405f5991fd33a4dff5dd13c44da5ac3e67609cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318251
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-27 11:15:07 +00:00
Jack Franklin 6fd3bb5abf Component bridges: Support nested interfaces/types in unions
This CL ensures that if a component has `type X = A|B` we will include
not only type `X` but also both `A` and `B` in the generated `_bridge`
file.

Change-Id: I580c9a221da7e753ae1313391d21db6e2fb4bacb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318250
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-27 10:42:37 +00:00
Jack Franklin 2bad4bcfb0 Add support for type X = to component bridges
We previously only looked for interfaces, but sometimes we use types, so
now we support both.

There's still features that aren't supported - e.g. if you extend a
type, that won't work, but that's next on the list. Similarly we don't
parse union types to see if they contain other types, but that will also
be done in another follow-up CL. It's easier to incrementally add these
features than do them in one big go.

Change-Id: Ifa9c647b4b261a1ea1ca237d554733fed23221da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318247
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-27 09:43:37 +00:00
Jack Franklin 6ac73e3ba7 Add support for type aliases to component bridges generation
There's more to be done here - we don't support nesting these yet, but this is a
good start. I'm splitting all the work up into smaller CLs rather than add ALL
THE FEATURES in one go. Bug:

Change-Id: I4c39f336570b16835f082bb7b8a5b7f1608ec234
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316307
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-07-27 06:48:16 +00:00
Mathias Bynens 4ceefeb36e Add support for rolling ClientVariationsParser.js
Bug: chromium:1103854
Change-Id: Ie5cebb77290727aadf9e3074f4c95306119df17c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316074
Reviewed-by: Mathias Bynens <mathias@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-25 08:16:54 +00:00
Jack Franklin 40876b86f0 Fix interface detection in union types in component bridges generator
If a setter took an object literal where the value was a union type
(e.g. `foo: Foo|null`) we would ignore it, and as such the bridge generator
would not include `Foo` in the bridge. This CL adds a check for union types
where we loop over each member and check if there's an interface in there.

Change-Id: I23039dea3af12d1bd0f3a3382e320a8c053cacc1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317317
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-07-24 13:44:53 +00:00
Jack Franklin f037a3d352 Improve bridges generation interface detection
This CL fixes the component bridges so that it can find nested interfaces. That
is, if it sees:

```
interface Foo {
  bar: Bar
}
```

Before this CL only the `Foo` interface would end up in the _bridge.js as a
Closure typedef. Now, with this CL, it will also include the `Bar` interface in
the _bridge.js file too.

Change-Id: I87a614fd5620c6572a062458a3e4b7dd30ca86e6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316066
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-24 13:28:23 +00:00
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