Commit Graph
1245 Commits
Author SHA1 Message Date
Randolf J 5cbcb68e9a Update puppeteer from 13.1.1 to 14.0.0
Bug: none
Change-Id: I157e7f5ddff43eb17fe371cc1437a636ad42cd4f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3641417
Commit-Queue: Randolf Jung <jrandolf@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-05-11 13:38:33 +00:00
Jack Franklin d7508305f9 Enable ESLint rule for LitHtml.LitTemplate
Bug: 1320753
Change-Id: If7e442d3250508c9be9199f1706e73847782197d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3629865
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-05-09 15:06:40 +00:00
Ergün Erdoğmuş 5f638bacef Add eslint rule for binding scheduleRender render argument
Bug: NO_BUG
Change-Id: I64d643a65d0cf4bc3546ed4f75adde7a53c83c4e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3624641
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
2022-05-05 11:06:21 +00:00
Jack Franklin aa70334697 Script to reformat js/ts files with clang-format
During my work to update JS import wrapping, I wrote up a hacky script
to auto-run clang on all JS and TS files. This CL is that script, but
tidied up and made a bit neater. I think it's worth landing as I can
easily imagine us needing to use it again in the future if clang
releases new config options we want to apply.

Bug: none
Change-Id: I43240c0ffab912d77950cb76540ccdfe8fed556c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3627330
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-05-04 11:37:00 +00:00
Jack Franklin a00b89c22a Lint against TemplateResult|typeof nothing
We have a common pattern in our codebase where a function might return a
lit template, or the result of `Lit.nothing` (which is equivalent to
`{}`). Therefore we have a fair amount of code that looks like:

```
foo(): LitHtml.TemplateResult|{}
// or
foo(): LitHtml.TemplateResult|typeof LitHtml.nothing
```

I'd like us to be consistent over which we prefer, but also this feels
like a little bit of an implementation detail that's leaking out - to a
person using our components system, a Lit template result or `{}` are
really equivalent - and we shouldn't have code that cares.

Therefore I'm proposing we expose (this will be done in a separate CL):

```
type LitTemplate = TemplateResult|typeof nothing
```

And then use this ESLint rule to:

1) update existing code to use the new type
2) ban future code from not using the new type

Both of those steps will also be done in a follow-up CL, this CL
introduces the basic rule.

Bug: 1320753
Change-Id: I2f3d5029a695922c9a71334e34259597eaebfcc0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3613881
Commit-Queue: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-29 16:07:23 +00:00
Mathias Bynens 54303dcc64 Unify developer-facing and user-facing short URLs
For any shortened URLs:

- Use goo.gle for Google Docs and chromium.org target URLs.
- Use g.co for everything else.

Bug: chromium:1321016
Change-Id: I09099dc62b92a14fa68d62155953262328476db2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3613872
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2022-04-29 10:46:23 +00:00
Jack Franklin c70d2688e1 ESLint rule for inlined type imports
This rule is able to merge imports such as:

```
import type {Crumb} from './breadcrumbs.js';
import {BreadcrumbComponent} from './breadcrumbs.js';
```

Into:

```
import {BreadcrumbComponent, type Crumb} from './breadcrumbs.js';
```

It can also inline standalone type imports:

```
import type {X, Y} from './foo.js';
```

Into:

```
import {type X, type Y} from './foo.js';
```

Note: this CL only lands the rule and does not enable it.

Bug: 1319340
Change-Id: I0f7d9e8a6833f836a0e4581d68ee7fd1b27c0edc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605262
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-26 11:54:37 +00:00
Simon Zünd 41c626075a Don't prepend PWD to file paths for natives generation
roll_deps.py was upgraded to Python3 in https://crrev.com/c/3521887.
This changed the paths that are passed to the natives generation script
to be absolute and no longer relative.

To account for this, we no longer prepend the working directory to
calculated paths.

R=jobay@chromium.org

Bug: None
Change-Id: Ia0a0f946e27d61fa64e7856daef0f709fb058365
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3607830
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-26 09:43:17 +00:00
Jack Franklin 38391d47f5 Land --no-fix flag to ESLint runner
This is useful sometimes if debugging a new ESLint rule - I've found
myself manually updating the script to disable fixing whilst I figure
something out.

Adding this flag and a separate `lint-check-js` script will make this
easier.

Bug: none
Change-Id: I929b13b09ece40690d630620da162986ed01e790
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-25 13:00:57 +00:00
Jack Franklin 40a72b0ca0 Remove run_lint_check_js.js
We have run_lint_check_js.mjs which is used in PRESUBMIT, package.json
and on the bots. I think we just forgot to delete the old version.

Bug: none
Change-Id: I91179c3d30c306968774981678a044f3249c1d18
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598880
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-22 08:22:47 +00:00
Alex Rudenko d990ae300a Improve handling of .spawnSync errors
Fixed: 1198532
Change-Id: Id299bb7700f7a78aad97ad77eee23e4bd0c5b5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598878
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-21 15:37:27 +00:00
Jack Franklin 3710bbf933 Upgrade eslint to 8.13.0
Bug: none
Change-Id: I438ea7b8e1c69e85939b1ed60578aa10fe87b821
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598874
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-21 10:20:38 +00:00
Jack Franklin e60446000d Lint for checkbox stylesheet adoption in Lit components
This CL introduces (but does not enable) an ESLint rule to check that if
a Lit component renders a checkbox, that it also imports and adopts the
common `Input.checkboxStyles` into the component's shadow root.

We can also roll this rule out to the text inputs too, but I wanted to
start with just one and see how it goes. I will follow up this CL with a
CL to enable this rule.

Bug: 1316297
Change-Id: Ibed7109d5948c8be3f4c9d376738290137e444ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3586906
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-19 08:53:26 +00:00
Simon Zünd 7a5852438e Update @typescript-eslint/plugin to 5.20.0
Our current @typescript-eslint version does not support TypeScript 4.6.
The update fixes that.

.eslintrc.js changes taken from https://crrev.com/c/3583292.

DISABLE_THIRD_PARTY_CHECK="Update contains a breaking change. Requires
updated config"

Bug: None
Change-Id: Id1d9f4f073f068ec95af6632a6d061adbee63cca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3592593
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-19 07:12:14 +00:00
Jack Franklin 46a28a3c5d Allow same-module .css.js imports
These don't need to have the same import rules applied quite so
religiously to them.

Bug: none
Change-Id: Iddded5916ff93a5acf661ecf288ee6d5f79a029a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3584111
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-14 15:35:31 +00:00
Jack Franklin 0a2413e991 Add callee check to check_component_naming lint rule
I had an error in my editor; I was midway through typing and ESLint was
running. It turns out we needed to check for the existence of a `callee`
before reading properties on it.

Bug: none
Change-Id: If1f1b2a2fb621514265c894fec94e454048ae6ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3569023
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-04 15:06:22 +00:00
Jack Franklin 85ad87189b Upgrade eslint to 8.11
Bug: none
Change-Id: I27c4a453180acadf8935ab3f766751245bc2963b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3550273
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-03-25 12:36:13 +00:00
Liviu Rau b9d36166b6 Migrate to py3
+ drive-by imports cleanup

DISABLE_THIRD_PARTY_CHECK=Migrating multiple scripts to py3
Bug: 1292013
Change-Id: Ie81765366236bd6f6213075de3d529afe21d561f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3521887
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-03-15 13:19:16 +00:00
Tim van der Lippe 30e0d8719a Update to TypeScript 4.6.2
There was only 1 fix required in InspectorView where `DisplayNames.of`
can also return `undefined`. Default to "English" (which I don't think
can ever happen, but alas) is the safest option. Other than that, no
problems with the upgrade 🎉

DISABLE_THIRD_PARTY_CHECK=TypeScript fix
R=szuend@chromium.org

Fixed: 1304218
Change-Id: Ie3c61858259b325f465062aec9dbaf34492a6e00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3509848
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-03-09 11:15:43 +00:00
Tim van der Lippe ece3c51ea2 Fix install deps script on Python 3
We ran into "RuntimeError: OrderedDict mutated during iteration" when
running this script. The problem was that we were mutating the
`pkg_data` while also iterating over it. Per
https://stackoverflow.com/a/52549728 the fix is to copy the package data
and pop from there.

R=jacktfranklin@chromium.org

Bug: 1304218
Change-Id: Ibaeb3f1e26ca346c794984311c082bb2f9e672c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3509847
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-03-08 15:43:11 +00:00
Jack Franklin 3ea21da3c7 Lint against image URLs containing Images/src
Fixed: 1304152
Change-Id: If4e8928af76ab27ef9ea4584399419a4f94b91a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506656
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-03-08 15:19:00 +00:00
Liviu Rau 3f146240d2 Run deps scripts with vpython3
+ drive-by imports cleanup

DISABLE_THIRD_PARTY_CHECK=Migrating multiple scripts to py3
Bug: 1292013
Change-Id: I6d004c6fd54253cc3694cf02cfe94731c7d2146d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484199
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-02-25 10:14:22 +00:00
Liviu Rau 3da5d4a22e Run build scripts with vpython3
Bug: 1292013
Change-Id: Idf2e5de0b6ca3a296e5efd7952911783d6005e30
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484196
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-02-25 10:12:14 +00:00
Alex Rudenko 4c118bf7b6 Fix typo in scripts/build/assert_third_party_readmes.py
Bug: none
Change-Id: Ife8f1a210db1c501f7c1bb3674aee3f1a558a055
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3480035
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-22 13:58:47 +00:00
Tim van der Lippe 7961ea6fa9 Update build system guidance
Remove references to the legacy closure compiler files and add
more guidance with respect to output locations and timestamps in
GN templates.

R=yangguo@chromium.org

Bug: none
Change-Id: I672d196c7f2ceebf6e057c60c4b1630ae2887d90
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3477111
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-02-21 16:22:08 +00:00
Simon Zünd db5dcc9f1a [e2e] Load DevTools on a different origin than the target page
This CL changes e2e tests to load the DevTools frontend on the
'devtools-frontend.test' origin instead of using 'localhost'.
'localhost' is used by the target page. If we also load DevTools via
'localhost' than the two pages share window.localStorage and are
considered "same-origin", which hardly reflects reality.

To enable this CL, we have to change the hosted-mode server to set
some CORS headers. More specifically, we allow the DevTools frontend
to request arbitray resources from the hosted-mode server, while
target pages have to be explicit in their ".headers" or
".rawresponse" files.

The CL also rebaselines a couple of e2e test that expect exact
response sizes or expect exact response headers.

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

Bug: 1297458
Change-Id: Ie18069e2effcc53cfd10a19296dc5d5c74b40e17
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3467975
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-16 12:43:57 +00:00
Weizhong Xia 9e9e0ec7d9 Rename arg name --time-out-ms for rwt
Change this to --timeout-ms to align with other parameter names,
e.g. --exit-after-n-crashes-or-timeouts, --skip-timeouts,
--initialize-webgpu-adapter-at-startup-timeout-ms.

Bug: 1095123
Change-Id: I9bdf511efeeef9eaf4b00dbba958e921f7d13834
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3457544
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Weizhong Xia <weizhong@google.com>
2022-02-14 17:15:27 +00:00
Jack Franklin a08500377b Add --mocha-fgrep to unit tests
This CL adds the ability to run:

```
npm run auto-unittest -- --mocha-fgrep=breadcrumb
```

To the Karma unit test suite to mirror the similar flag available in the
interactions and e2e test runner script. This is also why it's named
`fgrep`, as that's the same flag as used in the other script, and we
should be consistent.

Bug: none
Change-Id: Ic119f7186e0e97c83e00bf92a66d69181c931a8b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3452723
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-11 09:55:47 +00:00
Simon Zünd b7c0be6a85 [e2e] Enable caching in hosted mode server
This CL sets the `Cache-Control` header, allowing Chrome binaries to
cache DevTools resources for up to an hour. While that sounds a lot,
keep in mind that different invocations use fresh Chrome profiles, so
the cache is implicitly cleared between test suite re-runs.

Running the e2e tests in test/e2e/application/ yielded:

With cache: https://pastebin.com/w7Nh2rYW
Without cache: https://pastebin.com/XVNRCdQm

Keep in mind that we collected the numbers against a "is_debug=true"
build. The difference for release builds might not be as pronounced.

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

Bug: None
Change-Id: I9f729f453eefad5867aaf144d12d81ead67a2506
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3447414
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-10 15:03:25 +00:00
Takuto Ikuta d0e51ea796 add test for esbuild plugin
Fixed: 1293772
Change-Id: I0c12c27c66fcab491fac6869f282b3059e16ee9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439239
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-08 13:52:42 +00:00
Takuto Ikuta 5bfd102f96 use __dirname
Bug: 1294413
Change-Id: I10fff9f43c9354e424d88f2a1eb47f9bc064f99b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439243
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-07 12:18:16 +00:00
Takuto Ikuta 1595cda8b6 fix devtoolsRootPath for internal build
See https://crbug.com/1294413#c5 for explanation.

Bug: 1294413
Change-Id: Id6461f1830b62eb9e5a14fccfd2229b6b64c8161
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439235
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-07 11:00:53 +00:00
Tim van der Lippe 800d875627 Add build script tests
You can run these tests with `npm run build-test`, while we also run
them as part of our PRESUBMIT if we make any changes to the build
folder.

R=yangguo@chromium.org
CC=tikuta@chromium.org

Bug: 1293772
Change-Id: Id3b02c83398d2346a4ec5a06f3b938d33070d4f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439987
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-04 13:25:10 +00:00
Takuto Ikuta 4d1f2028c3 esbuild: do not relativize node's built-in modules
This is followup of https://crrev.com/c/3430082.

This fixes error like
https://logs.chromium.org/logs/devtools-frontend/buildbucket/cr-buildbucket/8823327185154097217/+/u/compile__with_patch_/raw_io.output_text_failure_summary_

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: Ibdb456f32a3ffa1a24998e2ee58190cb396945cc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3435628
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-02-03 10:57:51 +00:00
Johan Bay 8d8c684c22 Update roll_deps.py to also run javascript_natives/ script
With this change, we also update the argument hints for javascript
functions defined in .idl files when we roll Chromium deps.

DISABLE_THIRD_PARTY_CHECK=changes to roll_deps.py and javascript_natives/
are related

Change-Id: I0544acbe82a0292e486cfb3fac47b683438c3759
Bug: 1255619
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431347
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-02-02 18:18:51 +00:00
Johan Bay 986acd0681 Add dependencies for js signature generation to top-level node_modules
This change makes it easier to run the script from directly
`roll_py.deps` without having to fetch the dependencies first. This also
makes it easier to track which dependencies our tooling have.

Change-Id: I1ce55074ee6a1fffa6f2a2f05a56d0d74b4aca90
Bug: 1255619
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431346
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-02-02 17:33:42 +00:00
Takuto Ikuta 6621f46716 devtools_plugin: mark non-relative import as external
This is to prevent error like
https://ci.chromium.org/ui/p/devtools-frontend/builders/try/devtools_frontend_linux_blink_light_rel_fastbuild/95/overview

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: I51ee2b52b88b9b52edf47edfd94c4a771540fd89
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3430082
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-02 13:21:01 +00:00
Simon Zünd 957496f839 Minify locale JSON files at build time
This CL adds a new build rule "minify_json" that takes a list of JSON
files, minifies them, and puts the result into then "gen/" directory.

The i18n module uses the new rule to minify the locale JSON, reducing
the raw size per locale file 10-15%.

R=tvanderlippe@chromium.org

Fixed: 1293324
Change-Id: I0aabc5cdea7957334dfe21304e117dc23a563606
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431345
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-02 13:19:01 +00:00
Johan Bay 0c881d5071 Add W3C to list of allowed licenses
Change-Id: Iaffd76028079853ea30ec1b38ca34b14307bc09d
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3428457
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-02-02 10:56:51 +00:00
Takuto Ikuta 7f5fd554eb fix build errors
This fixes build error when we disable typescript and when we build
puppeteer.

Bug: 1293019
Change-Id: Ia927344166f543846e6fc3351f1621cd03593a49
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3430599
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-02 10:45:11 +00:00
Takuto Ikuta 4aef68ea32 enable fast bundle when skip typecheck
Use fast bundler if typecheck is skipped, assuming builders/developers
want to get result faster in such build config.

This will also remove the necessity of having devtools_fast_bundle
config from chromium CQ/CI's build.

This is step 6 of http://go/devtools-fast-bundle

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: I516b0af30c8c76c9382dfa09763d4efb8d1bdae7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3429380
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
2022-02-01 13:03:00 +00:00
Takuto Ikuta 2548a6cd6c introduce devtools_fast_bundle build config
Proposal: http://go/devtools-fast-bundle

This CL introduces build flag switching bundler from rollup.js to
esbuild by
* adding esbuild to npm without downloading binary packages
* making devtools_plugin for rollup.js re-usable to esbuild

On 24C/48T Z840 Linux machine, this shows following performance
difference by using
```
devtools_skip_typecheck = true
is_debug = false
```
as base build config.

esbuild (devtools_fast_bundle = true)
$ time ninja -C out/Default/
...
real    0m21.174s
user    2m47.513s
sys     0m38.549s

rollup.js (devtools_fast_bundle = false)
$ time ninja -C out/Default/
...
real    1m28.286s
user    30m19.220s
sys     5m36.392s


So esbuild is 3.2x faster and use only 9.6% of machine resouce
(user + sys) compared to rollup.js.

refs:
* https://esbuild.github.io/plugins/#on-resolve
* https://rollupjs.org/guide/en/#resolveid

Bug: 1278663
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_linux_blink_light_rel_fastbuild,devtools_frontend_linux_dbg_fastbuild
Change-Id: If6b2e774f48091b0fe9c959e7ed1ed9bc2b0847c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3401984
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-02-01 12:49:12 +00:00
Takuto Ikuta cfcea4217a rename rollup to bundle
rollup target will support esbuild, so I rename that to bundle.

Bug: 1278663
DISABLE_THIRD_PARTY_CHECK=parent CL has change for npm
Change-Id: I823f425e9ac5d599a3ddc3fd1fcd7e47cd18e3bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3419385
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-27 10:46:25 +00:00
Takuto Ikuta 9b3b13af90 extract devtools_plugin from rollup.config.js
This is extracted from https://crrev.com/c/3401984/30

I'll use this from esbuild too.

Bug: 1278663
DISABLE_THIRD_PARTY_CHECK=parent CL has change for npm
Change-Id: Ia5f3410a2cb59e349e7a76250fbe35b354462a4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3419384
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-27 10:44:05 +00:00
Takuto Ikuta 2e08a7d1fc npm: add esbuild
This is extracted from https://crrev.com/c/3401984/30

Bug: 1278663
Change-Id: Icddd2af2ce157cc3877bcdc84653fb639f44c083
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3419383
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-27 10:33:05 +00:00
Johan Bay 49f681ae20 Update javascript_natives/index.js script
This change also includes a manual run of the script to update
NativeFunctions.js.

Change-Id: I9ce1c4979674d9513cb7259e3e311e30b13de9ed
Bug: 1255619
Doc: https://goo.gle/devtools-js-argument-hints
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3399837
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-01-27 10:06:25 +00:00
Liviu Rau 547e711f3a Whitespace to trigger builders
R=rubber-stamper@appspot.gserviceaccount.com

Bug: 1256412
No-Tree-Checks: true
Change-Id: I8394d6d313be32bdfbbc90c9f39a139b745ee76e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3416225
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Auto-Submit: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-01-26 14:24:02 +00:00
Takuto Ikuta afe8b8e716 fix isInChromiumDirectory
Checkout of chromium directory may not have 'chromium'.
e.g.
https://ci.chromium.org/p/devtools-frontend/builders/try/devtools_frontend_linux_blink_light_rel
has chromium checkout under 'builder' dir.

Bug: 1278663
Change-Id: Icaef7e58ba93e30528ae23d352842abd3d0f3055
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3414935
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-26 10:44:45 +00:00
Takuto Ikuta 95a359d10c typescript: introduce devtools_skip_typecheck build flag
This is experimental flag introducing esbuild for typescript transpiler.

I needed to modify some test code to pass tests with esbuild.

Bug: chromium:1278663
DISABLE_THIRD_PARTY_CHECK=need to add esbuild DEPS too
Change-Id: I661951fc4fd8f5e6a2a599e531638ab294f887f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3330076
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-24 02:19:51 +00:00
Takuto Ikuta f342a5145f replace protocol.d.ts with protocol.ts
This is to make const enum in protocol.d.ts works with esbuild in
unittest.

Without this, const enum usage from protocol.d.ts is not replaced with
esbuild. So I need to make protocol.d.ts actual TypeScript file and make
it has corresponding JavaScript file with defined enums.

I also need to tweak how protocol.js is imported to make build/test pass
in both tsc and esbuild with child CL.

Bug: 1278663
DISABLE_THIRD_PARTY_CHECK=change generated/ and importing files
Change-Id: Ic5f27633c85bbfe8647636beef9b8625f33eabdd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3367593
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-24 01:35:02 +00:00