Commit Graph
82 Commits
Author SHA1 Message Date
Jack Franklin c4492956ad Remove component bridges generation
Now Closure is gone we don't need bridges and this removes all the code
and tests for them.

All relevant checks we wanted to keep around have been moved to ESLint
rules (see attached bug).

Fixed: 1130536
Change-Id: I82a7b8e5e7b047b36f42c5c76ddb9dfbd0742d45
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2565377
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-30 17:33:11 +00:00
Tim van der Lippe 7104ca0b6b Cleanup package.json scripts
These scripts should have been removed as part of
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I82c64e158fcf27d0c6adedff06e4bc97fc1fe1e8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560250
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-25 13:41:37 +00:00
Tim van der Lippe 16534e267d Remove Python infrastructure for the Closure Compiler
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I2ae75adec9fc47eedc410b4f066342ed3fb0a136
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-25 12:39:37 +00:00
Jack Franklin 5006ab2f52 Fix bad gen in npm bridges script
The gen directory doesn't exist any more, we generate to the same dir as
the source code.

Change-Id: Icf90df81c3c8cdbd849de116633c14a28b164046
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479135
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-16 11:32:27 +00:00
Changhao Han 1100a6c15f Fix generate-bridge-file script path
It seems like the old "cli.js" lives inside a folder called "gen", but
this folder has been removed recently. The npm script has not been
updated. This CL updates the npm script for this.

Change-Id: If1c7e5128a0d1f14d784982e2c801b661f6e232e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2470622
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-14 09:01:10 +00:00
Jack Franklin 102df67838 Fix component bridges tests
A recent TS config change elsewhere had caused these tests not to
compile with the error of:

```
error TS6307: File '/Users/jacktfranklin/src/devtools/devtools-frontend/scripts/component_bridges/value_for_type_node.ts' is not listed within the file list of project '/Users/jacktfranklin/src/devtools/devtools-frontend/test/unittests/scripts/component_bridges/tsconfig.json'.
```

The fix is to mark the dependency from the unit tests as a TS project
reference, and then generate output in the same place as the source, so
that import paths don't need to change.

This isn't ideal, and we would use ts_library if doing this now, but
this code pre-dates ts_library and also is only going to be around for
the length of the TypeScriptification work, so it doesn't feel worth the
effort to restructure it.

Change-Id: I9a924bf3e2ed945dd22ce233eda2c8c15f3193c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466188
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-10-13 10:35:14 +00:00
Maksim Sadym d53ca9807f Respect additional arguments in npm targets
Make following targets respect additional arguments, so that `--chrome-binary=[LOCATION] --chrome-features=[FEATURES]` can be used.
* `auto-debug-e2etest`
* `auto-debug-unittest`
* `auto-e2etest`

Bug: 1130513
Change-Id: I416dd08cc38597355d98ec43029e639716762296
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422946
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
2020-09-22 10:24:34 +00:00
Jack Franklin d557298f36 Add npm run auto-debug-unittest
To match the npm run auto-debug-e2etest command.

Change-Id: I06b7cb4b4a92d9bd986d25faf0a72554402e512e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409954
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-16 12:05:17 +00:00
Tim van der Lippe 5f83b28dd7 Update TypeScript to 4.0.2
DISABLE_THIRD_PARTY_CHECK=Updating TypeScript
R=szuend@chromium.org

Fixed: 1120303
Change-Id: I342cfacaf25c4b450bb00703454fe69db4b6f3cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367944
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-21 13:17:14 +00:00
Jack Franklin 580a4b1d52 Script to re-generate all bridges
This script will regenerate all _bridge.js files, which will be useful when we
come to fixing bugs in the generation and need to apply that across the entire
codebase.

Change-Id: Id2a12f9b134564f221ff49d7beb92861544c0dcf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332809
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-08-04 22:35:39 +00:00
Peter Marshall 9c4cbce5ab Set env to disable chromium download in manage_node_deps.py
Previously this was set in package.json which assumed the script would
not be run directly.

Set it in the script instead so it can be run directly.

Change-Id: I96d7f9d4589585d1a83655c6b1967e1a89ba7958
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279843
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-06 14:30:42 +00:00
Paul Lewis ee1b328d6a [Watch] Changes autoninja target
We are building the :front_end target when files change, but this
doesn't seem to be broad enough to ensure we build on all changes. This
CL updates the target to devtools_frontend_resources, which does seem to
be a broader target.

This CL also includes a drive-by fix so that the output is sent to
stdout.

Bug: 1098694
Change-Id: I1d02cc0226767377aa4729af3cf3a734ec774026
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2278471
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-02 10:59:39 +00:00
Paul Lewis 64ba20b911 Adds watch mode for rebuillding changes
Since we are moving to running from built content in the gen/ directory,
we need to have a watcher to ensure convenience for anyone working on
the codebase. This CL introduces a watcher that calls autoninja whenever
a file is changed in the front_end folder. It also updates node.py so
that it outputs the contents of stdout and stderr when the --output flag
is set.

R=tvanderlippe@chromium.org

DISABLE_THIRD_PARTY_CHECK=Updating node alongside relevant changes

Bug: 1098694
Change-Id: I4ddb3d250d0fd80455ea24e95055de74b2be879c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2272559
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-29 15:32:58 +00:00
Paul Lewis 5ad7492821 Update node.py to allow logging
The node.py script does not currently output stdout or stderr, which for
ninja-based work makes total sense. However, when using it in more
general contexts (including debugging), having access to stdout and
stderr is useful. This CL allows the addition of --output as the first
argument to node.py, which, if found, will disable the piping of stdout
and stderr, allowing the developer to see their contents.

DISABLE_THIRD_PARTY_CHECK=Update package.json in line with node.py

Change-Id: Icfdd5479a391539dcf8b17e8d2180b5223ee1ea8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2273180
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-29 14:40:33 +00:00
Tim van der Lippe fe75007069 Run e2e-tests on build output
The e2e-tests now use the build output in resources/inspector in
the out directory. This allows us to introduce TypeScript-authored
files in the source directory `front_end`, which will get compiled
into resourc/inspector.

After to making a change to a e2e-test or the front_end, you need
to rebuild Devtools, after which you can run `npm run e2etest` as
normal.

Since we now use the build output, this also means that you can
run the e2e-tests on the release build. In other words, if you
build DevTools with build optimizations (such as Rollup), the
e2e-tests will now use the output (and thus provide test coverage).

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

Fixed: 1088463
Change-Id: I02ec3c2476bc3647158fede9e1d347963b3a720a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224809
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-06-29 11:35:23 +00:00
Mathias Bynens 1b2c5e463e Enable stylelint on presubmit
Bug: chromium:1083142
Change-Id: I74136f2ba5b74d4385760e157e2495d706cb5c35
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2248184
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-18 10:41:46 +00:00
Tim van der Lippe 8dcbdb8aeb Remove npm run start script
It is superseded by the runtime flag `--custom-devtools-frontend`,
as documented in our README.

We can no longer keep this script around, as it blocks the inclusion
of TypeScript-authored files in the source tree.

R=yangguo@chromium.org,Rob.Paveza@microsoft.com

Design-Doc: https://docs.google.com/document/d/1COgCBWWuTh2o-Zbp6h_z0h0LtlJaimaEDsION4RZPxc/edit
Bug: 1061037, 1011811
Change-Id: Id7a347f28acf7a3a065c5c3dea4e74443d4ac7ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247653
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-06-17 11:33:07 +00:00
Mathias Bynens 8a163a0661 Use the bundled node binary for all npm scripts
It was previously only done for 1 out of 12 scripts.

DISABLE_THIRD_PARTY_CHECK=updating Node.js wrapper
No-Presubmit: true
Bug: chromium:1074325
Change-Id: I18cb95af0acfcabb8b2fcb5e9e889921b0ab04db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247644
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-16 12:07:58 +00:00
Jack Franklin 1557a1c167 Components dev server
This introduces the components server that we will use to view
components locally.

Design doc:
https://docs.google.com/document/d/1P6qtACf4aryfT9OSHxNFI3okMKt9oUrtzOKCws5bOec/edit?pli=1

Change-Id: I6cd7588f045c3cd46e57f1f44441ffa95f0b70bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199081
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-06-08 14:53:56 +00:00
Tim van der Lippe 3116ece03e Update license field in package.json to SPDX identifier
This allows automated tooling to confirm that the licenses are valid.
Before, we used a custom license reference, which automated tooling
can not understand.

R=yangguo@chromium.org

Change-Id: Ib719c61fd68d11363a20e214ec51faacdf4b1a1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199084
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-05-15 14:24:26 +00:00
Tim van der Lippe 0cbb83a5ec Allow node.py to run node scripts
If third_party/node/node.py is executed as a regular script,
it will consequently run the Node script with the node version
that is synced with gclient sync.

DISABLE_THIRD_PARTY_CHECK=Node Python fix
R=liviurau@chromium.org

Bug: 1074325
Change-Id: I738dc3de5dabdef349f90dfc972acd99f139c027
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2194873
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-13 09:10:31 +00:00
Tim van der Lippe 40875028ce Update Puppeteer to v3.0.3
DISABLE_THIRD_PARTY_CHECK=update Puppeteer

Also-By: tvanderlippe@chromium.org
Change-Id: I4ddb6a2b426bcde95f9b764790e88b560441225c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2187209
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-07 11:21:08 +00:00
Jack Franklin c6577bae1c Add support for Platform.UIString calls in GRDP parsing
Now UIString is defined in Platform [1] we need to update the GRDP
parsing code to look for calls to it rather than `Common.UIString`.

We still support `Common.UIString` so this CL extends the script to look
for:

1) Usage outside of Platform:

```
import * as Platform from '../platform/platform.js';

Platform.UIString.UIString('foobarbaz');
```

2) Usage inside of Platform:
```
import {UIString} from './UIString.js';

UIString('foobarbaz');
```

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

Change-Id: I8c0f97817709e936bdddce8f0b60d759e80fd1ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2170067
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-04-28 14:13:33 +00:00
Tim van der Lippe efb2a94cdc Run Karma unittests on the Ninja output directory
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder.
It uses the Ninja build output to find the unittest files.

You can run the new script with:

npm run unittest
npm run unittest -- --target=Release

To make sure you perform a minimal build and run tests right after it, run:

npm run auto-unittest
npm run auto-unittest -- --target=Release

If no ninja-build-name is set, it assumes that `out/Default` exists.
The `auto-unittest` command will run autoninja for you on the output folder.

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

No-Presubmit: true
Bug: 1061125
Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 10:16:15 +00:00
Tim van der Lippe dfd18c4e75 Remove istanbul-diff from node_modules
The package is unused at the moment. It was originally added in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2024871
to enable karma-coverage support. However, istanbul-diff itself
is not required for that process, as we still generate the
karma-coverage report without it.

R=liviurau@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove istanbul-diff

Bug: 1068145
Change-Id: I38df9ebdfeb5232f013ea45b4a596239bfd63d7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137391
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-14 11:21:15 +00:00
Mathias Bynens 1f948917ee Remove preinstall hook from package.json
The `preinstall` hook is problematic for users trying to `npm install
chrome-devtools-frontend`. For DevTools development, it’s not
directly needed since `npm run install-deps` is supposed to be used
instead of `npm install` anyway.

Therefore, this patch removes the `preinstall` hook.

Bug: chromium:1066415
Fixed: chromium:1058161
Change-Id: If7fccf2ed392ec47bf79e55470a0fd3cc5a8b880
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144091
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-09 10:30:20 +00:00
Tim van der Lippe 35cca41271 Allow manage_node_deps to run custom npm commands
This allows us to execute the following:

npm run install-deps -- outdated

Which is equivalent to `npm outdated`, although it will run on the
actual node_modules output (that we can verify is unchanged).

Most of the npm commands require the private information to exist.
Therefore, if we run a custom command we first have to install with
`npm ci` to get the private information. Then we have to execute
the command, perform the cleanup and only after that finisht the
script. If we would bail out right after executing the custom command,
the private information would remain in the repository.

R=jacktfranklin@chromium.org

Fixed: 1068132
Change-Id: I50d3538a7115783dea19e1899faf17b1622f22ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137381
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-06 13:01:08 +00:00
Tim van der Lippe 2dceb7fba0 Run the formatter after generating protocol resources
This makes reading the diff a lot easier.

R=kimanh@chromium.org

Change-Id: I50c4c630dab52c2520e80f252be7b3c647ae8c8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122146
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2020-03-26 16:46:00 +00:00
Paul Lewis 3fc8005cfe [e2e] Allows debug of single test file
The use of npm run e2etest inside of debug-e2etest was blocking the
passing of more params. This CL changes debug-e2etest to call the python
script directly.

Change-Id: I19c9009e7054c59e1f4f1456448304dc1c44d00b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122055
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-26 12:34:20 +00:00
Jack Franklin d3f547209d Component bridges generation
This CL introduces a script to generate `_bridges.js` files for TypeScript web components.

For further details see:

* `scripts/component_bridges/README.md` in this CL.
* Modernising UI components: https://docs.google.com/document/d/1Asq9BDFFvnsqhDbpu2Ez92pugPN2-8nq50O6sNO0SpY/edit
* Building bridges to a TypeScript world: https://docs.google.com/document/d/1qpa5QSSHrvvo_w73GV0hOJRug4N0_9JfFDw01d-NaCE/edit#heading=h.7nki9mck5t64

Change-Id: I95656acd6d22f5e09d178875dd3bcaf47da75a9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108761
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-03-26 11:36:00 +00:00
Tim van der Lippe 2ffbc3f6d5 Check Ninja output with expected build output
We now check that the build_output.txt is equivalent to the build_output.txt.expected.
This includes compilation failures, which `compilation_failure_front_end` shows.

To be able to have machine-agnostic buildoutputs, the toolchains need to be
absolutely referenced and thus every fixture needs the same copy of a toolchain.
Also, the ts_library print must use the relative path rather than the absolute path.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Add ts_library tests.

Bug: 1064287
Change-Id: I4a4db566cc155b7f6e73cadc2efcfa8d615286ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2118097
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-25 13:06:03 +00:00
Tim van der Lippe d9de4a0ddb Rename check-type to check-type-closure
To reduce confusion as to which typechecker is running when executing
`npm run check-type`, rename this command to `check-type-closure`.
For those that invoke the previous `check-type` command, it will now
provide a descriptive message on which command to run for the
respective typechecker.

R=yangguo@chromium.org

Bug: 1011811
Change-Id: I1e8c1d64de2a3d3799e36ef8bc42dce76af44402
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2112369
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-03-20 15:35:27 +00:00
Tim van der Lippe 8fa65441f9 Add filesystem TypeScript types
We use these types for all of our interactions with the local filesystem
API's and they don't normally ship with TypeScript library definitions.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Add node_module

Bug: 1011811
Change-Id: I41ae8faf8cce289c86a6795ff76d8a10b5b3609d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108760
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 17:58:39 +00:00
Jack Franklin 02d03f4ef2 Revert "Add tsickle as a node dep"
This reverts commit 82dc0cef49.

Reason for revert: We don't think that we're going to use tsickle yet. Apologies - I made this CL a little hastily in hindsight.
Original change's description:
> Add tsickle as a node dep
> 
> We need it to convert from TypeScript to Closure to generate bridges
> whilst we migrate from Closure to TS.
> 
> DISABLE_THIRD_PARTY_CHECK=adding tsickle
> 
> Change-Id: I0bb28ecd6f5f6f131a59a02c8833aebd7ae92471
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107215
> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

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

Change-Id: Iee3631911650c03df4c18d07969b94b2d797cb5a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107530
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-03-18 11:15:28 +00:00
Jack Franklin 82dc0cef49 Add tsickle as a node dep
We need it to convert from TypeScript to Closure to generate bridges
whilst we migrate from Closure to TS.

DISABLE_THIRD_PARTY_CHECK=adding tsickle

Change-Id: I0bb28ecd6f5f6f131a59a02c8833aebd7ae92471
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107215
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-17 11:40:19 +00:00
Tim van der Lippe 60bc8888bf Remove jsconfig configuration files
These files were used in the pre-ES module module era, to instruct
editors like VS Code to resolve symbols. However, since we are in ES
modules land we explicitly *don't* want this resolution. By removing
suport for jsconfig, the editor will now warn before hand on un-imported
symbols. This should reduce the risk of accidentally using the global
symbol rather than the import.

After this change, there will be numerous `jsconfig.json` in the
repository. You are recommended to `git add . && git reset --hard` to
remove these from your local checkout.

Most files will now see a lot of red squiggles with errors, which is to
be expected, as TypeScript does not understand many of the globals. I
have declared `ls` in the globals to at least suppress these, as well as
fix the definition of UIString. These seem to be the most prominent.

All other usages will still need fixing before the files in question can
be typescriptified. However, we do hope that with this change, it is
more difficult to check in new code that is not compliant with
TypeScript already.

Bug: 1006759
Change-Id: I6591e73d66c845a2160b843b627c1adcb1389c24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2098602
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-03-16 17:13:36 +00:00
Tim van der Lippe 4a8441c385 Port license header check to ESLint
This improves the PRESUBMIT performance as we can rely on the AST
parsing of ESLint, meaning we don't have to parse AST twice.

It also allows us to use the nice `--fix` solution to insert the proper
license header in the files.

This shaves an expected 5 seconds of the presubmit time
(non-scientifically computed based on 2 uploads).

Change-Id: I5c53e9b232585f9ec46f86b36557c50bf80f7add
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097992
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:08:22 +00:00
Jack Franklin 8297869795 Generate protocol.d.ts files in devtools-frontend
We need this to be able to migrate parts of the frontend over to
TypeScript that use the Protocol.

We can generate this automatically via a script [1] from the
devtools-protocol repository on GitHub that we've pulled into our repo
and tweaked slightly.

The files are commited and can be easily re-generated should the PDL
files be updated.

DISABLE_THIRD_PARTY_CHECK=expected ts_library changes

[1]: https://github.com/ChromeDevTools/devtools-protocol/tree/master/scripts

Change-Id: I7115fdf109487a82edcaaf7f9984e8ec587d8b04
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096703
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-12 15:18:42 +00:00
Tim van der Lippe d6c33c4cd6 Add custom ESLint rule to check ES import statements
This makes sure that the guidance of
https://docs.google.com/presentation/d/1KaTDaKEcLmgv3Wum79gPP9mv9x2fm3kuEgx_b8wLVug/edit?usp=sharing
will be caught during build time. This prevent issues where duplication
of code in combination with Rollup can cause runtime issues.

Bug: 1060003
Change-Id: Ic8c8dfcc4e9890592791adc23044033b1aa3ca1b
Fixed: 1060123
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096700
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-10 17:33:13 +00:00
Tim van der Lippe b0d65f1b3c Extract protocol generation to separate script
This allows us to add an npm command that does the same thing. This is
necessary to support the workflow of making changes in the pdl during
development.

You can regenerate the relevant protocol files with
`npm run generate-protocol-resources`. Note that the files it generates
are not formatted, but on presubmit it will both format and lint the
files to the correct notation. However, that should not impact the
workflow of making changes to the protocol files and testing their
behavior.

R=sigurds@chromium.org

Change-Id: I87c06183c8842d8643c4647cb1519850d75bd46d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088093
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-03-05 12:21:12 +00:00
Tim van der Lippe 62e4435627 Update TypeScript to 3.8.3
This includes the fix for
https://github.com/microsoft/TypeScript/issues/36989 which was blocking
the typescript-ification of `host`.

R=szuend@chromium.org
DISABLE_THIRD_PARTY_CHECK=Update typescript

Bug: 1011811
Change-Id: I637861d247ce4b696b0177e0bd8cd31243a47f98
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2083148
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-02 18:16:46 +00:00
Paul Lewis 65761161be [perf] Updates boot perf test
Change-Id: I7d8f9cf62638230a1d912c7c12beca02a2883bfa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2077658
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-28 10:40:09 +00:00
Tim van der Lippe 00e15811f5 Update TypeScript to 3.8.1RC
This fixes an issue where property assignments to static methods (please
don't ask me why we have them) would erroneously omit the static method
from the declaration file.

This is fixed in the latest version of TypeScript, most likely as part
of https://github.com/microsoft/TypeScript/issues/36270

DISABLE_THIRD_PARTY_CHECK=Updating TypeScript

Bug: 1011811
Change-Id: I2744ef44c040fdf001f6b0be9e64a164510e0fea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2064668
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-20 12:04:17 +00:00
Paul Lewis c9f5e3a120 [screenshot] Add helper util to screenshots
This adds support for image diffing interactively. A future CL will need
to include image_diff for Linux and win32.

Bug: 1051458
Change-Id: Ifdcb7ee59dff1f8a93fae19db6a1633e5c0bcdcc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2060004
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-17 15:52:45 +00:00
Paul Lewis ed36b86660 Updates node_modules to remove resemblejs
DISABLE_THIRD_PARTY_CHECK=Updating node_modules requires changing package.json and manage_node_deps.py

Change-Id: I08d05d8c92e501baeb0780ee06cea9b12887ee57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056474
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-14 12:21:53 +00:00
Paul Lewis 25ff1d1ca4 [e2e] Deprecate e2e script and introduce screenshots script
This CL downgrades the existing e2e script to a passthru. Once the bots
use the new script, this can be deprecated entirely.

The CL also updates the paths in the package.json

Bug: 1044632
Change-Id: I4a5bda44f7c212e648a58e72e95712b9c3c6e3e9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054552
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-13 15:36:56 +00:00
Jack Franklin b5bbcc0078 Add sinonjs@8.1.1 dependency
This will be used to build out mocking in the devtools frontend unit tests.

DISABLE_THIRD_PARTY_CHECK=message doesn't apply with this change (checked with aerotwist@).

Change-Id: Ie623b4fb35677c8c4a5e52d5e75180346da6e3fd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2050225
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-11 14:49:21 +00:00
Tim van der Lippe 58c5bcf4da Add console BigInt e2etest
This replaces
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/devtools/startup/console/resources/console-format-startup-bigint.html;drc=77578ccb4082ae20a9326d9e673225f1189ebb63?originalUrl=https:%2F%2Fcs.chromium.org%2F
as an e2etest

Bug: 1047671
Change-Id: I397fd817a18364c081e2f23b2d34bd1c267fecca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035947
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-04 16:01:02 +00:00
Brandon Goddard 53faba1c7d Reland "Add script that checks license headers of JavaScript files"
This reverts commit 27f15d113a.

Reason for revert: script is fixed on Windows

Original change's description:
> Revert "Add script that checks license headers of JavaScript files"
>
> This reverts commit 6122ebd2f9.
>
> Reason for revert: Presubmit fails on windows due to relative
> path comparison with excluded files
>
> Original change's description:
> > Add script that checks license headers of JavaScript files
> >
> > The script checks if the license header is the BSD-3 license header that
> > DevTools is licensed under. It excludes files that have license headers
> > that reference non-Google/non-Chromium authors or are third_party
> > bundles that are checked into a non-third_party folder.
> >
> > Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Liviu Rau <liviurau@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
>
> TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org
>
> Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
> Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,lomitch@microsoft.com,brgoddar@microsoft.com,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: I191665c8e3fdbee7f3c5c312b5ba00513502e080
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019021
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 18:16:35 +00:00
Brandon Goddard 27f15d113a Revert "Add script that checks license headers of JavaScript files"
This reverts commit 6122ebd2f9.

Reason for revert: Presubmit fails on windows due to relative
path comparison with excluded files

Original change's description:
> Add script that checks license headers of JavaScript files
> 
> The script checks if the license header is the BSD-3 license header that
> DevTools is licensed under. It excludes files that have license headers
> that reference non-Google/non-Chromium authors or are third_party
> bundles that are checked into a non-third_party folder.
> 
> Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Liviu Rau <liviurau@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 16:50:05 +00:00