Commit Graph
1300 Commits
Author SHA1 Message Date
Jack Franklin c8d5dd2e7c Apply JSDoc alignment rule to scripts/ directory
I mistakenly applied this rule only to `*.ts` files, but we should apply
it to JavaScript files also.

Bug: none
Change-Id: I6c7af0e897e06a7a04ec3dea83fcbd9719744705
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4111459
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-12-21 16:26:37 +00:00
Jack Franklin fd72c071cc Enforce alignment of JSDoc comments
This CL adds the eslint-plugin-jsdoc plugin and enables just one rule,
`jsdoc/check-alignment`, which ensures that all the lines in a comment
are correctly aligned. For example:

```
/**
* foo
 * bar
*/
```

Would fail the check and be corrected to:

```
/**
 * foo
 * bar
 */
```

DISABLE_THIRD_PARTY_CHECK=deliberate install + use of
eslint-plugin-jsdoc node_module

Bug: none
Change-Id: I969983cd550653654a334ede3409b8c850467245
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4110906
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-21 12:30:47 +00:00
Jack Franklin 0ad9b52d3f Create rule to ban certain imports in directories
Created because to enable certain code to run in workers you need to ban
certain modules from being used - in this case, SDK. We can enable this
rule in directories as required.

Bug: 1399455
Change-Id: I129838897127532743167d4b09ccbd6fb2b43b9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4114281
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-19 15:41:50 +00:00
Jack Franklin a682d93584 Re-enable cssnano with "lite" preset
We had to disable CSSNano because it was causing broken fonts in release
builds (exact reason TBC). This CL installs the `cssnano-preset-lite`
package which applies only the following optimisations:

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

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

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

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

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

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

Bug: 1399763
Change-Id: I2adc192d9f79bc99df7dd1a178e4bdb3c5e3feeb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092736
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-12-09 15:17:11 +00:00
Jack Franklin c712a3e629 Move generate_css_js_files to use cssnano
Bug: 1399763
Change-Id: I96964df8eb6c8979d5f208aa442687c439acaa7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092364
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-12-09 12:57:29 +00:00
Jack Franklin a5fd0a412d Add cssnano
The CSS minifier we currently use (clean-css) is not maintained and
lacks support for new CSS features. CSSNano is a replacement that
supports features we need (primarily container queries).

This CL only adds the relevant dependencies, and does not use it. I will
do that (and remove clean-css) in a follow-up.

Bug: 1399763
Change-Id: I899ecc4482164404dd5ac2fd13f92fb797978e29
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092305
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-12-09 12:08:23 +00:00
Jack Franklin 43f33bfab5 Add tests for generate_css_js_files script
No functional changes here - but we will be making changes in the future
to this script, so I think adding a few tests is a good idea.

The changes to the source code are purely to allow the relevant function
to be tested easily, and there are no actual output changes here.

Bug: 1399763
Change-Id: I7fec01f62ea2b034b175071aa1dd92a9d3df51b6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092303
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2022-12-09 10:58:02 +00:00
Jack Franklin df0e9312aa Add ESLint rule for commented out import statements
This is something I've been caught out with a few times when moving code
round, and thought it would be a good ESLint rule. I've enabled the rule
as part of this CL as we currently have few issues that need fixes.

Bug: none
Change-Id: I72c6aad3e4258fbda280e062f98823a068c6bfc8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4076326
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-05 11:24:51 +00:00
Jack Franklin 5ee20e32de Revert "Update ESBuild to 0.15.16"
This reverts commit 4b5ea512d3.

Reason for revert: causing failures on waterfall

Original change's description:
> Update ESBuild to 0.15.16
>
> A reland of my failed CL yesterday that caused issues; these were caused
> by me updating the DEPS version but not the node_modules version, which
> I have now updated in this CL.
>
> DISABLE_THIRD_PARTY_CHECK=purposeful update of ESBuild in two places.
>
> Bug: none
> Change-Id: I0a59296d7ad7a276e7f807d8154eb68a05d75451
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4061716
> Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
> Reviewed-by: Liviu Rau <liviurau@google.com>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>

Bug: none
Change-Id: Ia26c87ec87a6160f268c2e7455621099b4c2784e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4067325
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-12-01 10:38:13 +00:00
Jack Franklin b5a63097ce Ensure ESBuild versions are in sync in PRESUBMIT
We have ESBuild as a dep in two places:

1. `DEPS`, managed by gclient
2. `manage_node_deps.py`, managed by npm

These versions need to match, otherwise any builds that use `esbuild`
will fail in Chrome land. This CL introduces a script and PRESUBMIT
check to ensure that the two versions are in sync.

Bug: none
Change-Id: I7ea9172ae386e4e21e1ac82c208d171b65b29e22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4067299
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-01 10:02:04 +00:00
Jack Franklin 4b5ea512d3 Update ESBuild to 0.15.16
A reland of my failed CL yesterday that caused issues; these were caused
by me updating the DEPS version but not the node_modules version, which
I have now updated in this CL.

DISABLE_THIRD_PARTY_CHECK=purposeful update of ESBuild in two places.

Bug: none
Change-Id: I0a59296d7ad7a276e7f807d8154eb68a05d75451
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4061716
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-12-01 09:52:59 +00:00
Jack Franklin cc58dfaae4 Add npm run install-deps note to manage node deps script
Bug: none
Change-Id: I61ccd40e837c4c5b2a440e229c143bc302cec6e4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4061692
Reviewed-by: Nancy Li <nancyly@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Nancy Li <nancyly@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-11-29 10:46:11 +00:00
Jack Franklin 2703ce56ba Upgrade @typescript-eslint packages
After upgrading TS to 4.9, we need to upgrade these packages so they can
parse the new TS features (such as the `satisfies` keyword).

Bug: 1392651
Change-Id: I85466727628e37b5b63c0f1e45484324fd05b8fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4046522
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-11-28 11:31:39 +00:00
Nancy Li 6403713b4d Update types
- Update `@types/node` packages to the latest version

Bug: none
Change-Id: I0caaa8c1a889e0ce593da6458563e305101e44af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4048320
Auto-Submit: Nancy Li <nancyly@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Nancy Li <nancyly@chromium.org>
2022-11-22 16:47:17 +00:00
Simon Zünd 50dcea80fa [l10n] Use generated en-US.json/en-XL.json
This CL switches out the in-tree versions of en-US.json/en-XL.json
in favor of the versions generated at build time. They are identical.

The implementation is straight-forward. On the minification step, we
exclude the in-tree en-US.json/en-XL.json and instead add the
outputs of the "collect_strings" action (aka the generated en-US.json/
en-XL.json).

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I923fba50033305a7df6bedccf65c657ecc8e5235
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4043247
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-11-22 08:51:46 +00:00
Simon Zünd d481608a05 [l10n] Remove src directory parameter for minification script
Instead the input sources should specify their path completely.
This allows us to also include generated inputs.

Note that all sources will still be put into a single output
directory, namely $target_gen_dir/core/i18n/locales.

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I203f284f74cb468ebe44c22e5d594f1b6cb182e0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4042782
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-11-22 08:17:39 +00:00
Jack Franklin 2204d75049 Upgrade TS to 4.9
DISABLE_THIRD_PARTY_CHECK=TS upgrade.

Bug: 1392092
Change-Id: I3a5f352b12914ea6f908118fe6fda8ca3286cae5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4041404
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-11-21 15:14:06 +00:00
Simon Zünd c6be86815b [l10n] Don't comma separate files passed to the minification script
Just a small refactoring to go with the standard way of passing
each file as a separate argument instead of doing a join + split.

R=kimanh@chromium.org

Bug: 1185727
Change-Id: I5a292053e1138448e8a1e7a09162b248d6851a25
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4042209
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2022-11-21 12:14:02 +00:00
Jack Franklin 28918fb831 Fix ESLint rule typo
"exlcusive" => "exclusive"

Bug: none
Change-Id: Ieb920b8898efdd048b908051a6cf0c14d1a918be
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4028068
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-11-15 12:37:29 +00:00
Randolf 72c60af2e8 [Recorder] Update puppeteer to v19.2.0
Bug: none
Change-Id: Ic5ce2be0e86463593b2e663cf8c982b1ea1a92f8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3999013
Auto-Submit: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-11-02 13:32:05 +00:00
Andrés Olivares 763593787a [ESLint] Report all .only expressions in DevTools' tests
At the moment, we use the no-exclusive-tests plugin to ban exclusive
tests in the test/ repo. This is problematic because the rule doesn't
work for the mocha extensions we use in DevTools (like
describeWithMockConnection, etc.), meaning that exclusive tests like [1]
can slip through the lint check.

This CL adds a new rule that prevents call statements with the shape
statement.only in the test base to account for this. The rule is applied
to files ending with _test.ts and the previous rule is removed.

[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3898961/23/test/unittests/front_end/panels/timeline/SourceMaps_test.ts#80
 (line 80)

 Bug: none
Change-Id: If0e6ac9810c80da067faa1f2158b8bd45f8417f8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3963115
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-10-18 15:13:38 +00:00
Jack Franklin 0752134a5d Add --log-level to unit tests.
This CL adds a `--log-level` flag to the unit test runner that will
allow the log level to be configured. This flag is passed right through
to Karma, but is also respected by the logs output by our test runner
before initialising Karma.

The default value for `--log-level` is `info`, so this CL doesn't change
the built in functionality; but you can now pass `debug`, `info`, `warn`
or `error` to configure it.

Bug: none
Change-Id: I82006a1a8283c3d93389f124317a37bac69b5038
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3963112
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Thiago Perrotta <tperrotta@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-10-18 14:14:35 +00:00
Jack Franklin 08c207dcfd Remove render_coordinator_write rule
It was never enabled, and now with our ScheduledRender helper, any new
rule should enforce that. But given that we've not felt a need for this
rule directly, I don't think it's a worthwhile investment at the moment.

Bug: none
Change-Id: I36c6e8c9411a035aff4f028f01fd08054387955c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3936844
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-10-07 10:43:45 +00:00
Jack Franklin 5445f5cf5f Update eslint node_module
Bug: none
Change-Id: I07591be5189d93085d49ace61ec030291af12b9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757654
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-15 09:09:49 +00:00
Jack Franklin e7a4dd0e8a Upgrade ESLint+TypeScript node_modules
Bug: none
Change-Id: I1f99b10bc418d589cb11adba64ef2211bede5cd8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757653
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-13 11:51:00 +00:00
Jack Franklin 3a80260722 Inline type imports in front_end
This CL enables the `inline_type_imports` rule for devtools-frontend,
and is the result of running the auto-fixer to update all imports
accordingly.

Bug: 1319340
Change-Id: I303256476fd4e94f4505bbf4355c0070ac101aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752799
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-07-13 09:26:00 +00:00
Jack Franklin 061f09c304 Upgrade TypeScript to 4.7.4
There are a couple of code changes for us that are relevant:

1.The accuracy of `lib.d.ts` (DOM definitions) has improved, so we have
  to update a type in `Button.ts`. This changes the type from
  `X|undefined` to `X|null` so this is very minor.

2. TypeScript got better at understanding conditionals that will always
  return `true`, and caught a case where we were doing:

  ```
  addEventListener(e => e.key === 'Enter' && Common.Revealer.reveal(...)
  && false)
  ```

  TS errored because the `reveal()` call is a promise and therefore will
  always return true, causing the entire expression to return the final
  `false`. Returning `false` from an event listener doesn't do anything,
  so I've removed it.

DISABLE_THIRD_PARTY_CHECK=required updates to land TS upgrade

Bug: none
Change-Id: I89ab2ad730d40308da173bd7788c17daf0b4a511
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757623
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2022-07-12 15:22:50 +00:00
Jack Franklin 130d2ae03b Disable clang/eslint in front_end/generated
This CL disables formatting within the `generated` directory, which is
all code that is programatically generated. Previously we disabled
eslint for `protocol.ts`, but now we are being consistent and disabling
it (and clang) for all files.

I also re-generated the files in the generated folder, so we avoid any
confusion if/when the generated scripts get re-run and suddenly the
format drastically changes.

DISABLE_THIRD_PARTY_CHECK=changing generated files + config

Bug: none
Change-Id: I714ada8bf7d85020e3be71b35c9db98840bf3ef2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3755163
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-12 10:51:50 +00:00
Jack Franklin 66c2bf52b7 [ESLint] allow nested components within a components/ folder
Without this fix lint rule was complaining about
`front_end/panels/foo/bar/components/X.ts`. In some situations we do
nest components further within panels, so let's check that the component
is within a `components` folder regardless of the nesting.

Bug:1206616
Change-Id: Ib6ae6252a517f6d5756fd37f51e130df1c7d5014
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752797
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-08 14:58:37 +00:00
Jack Franklin cc2dbce19a [ESLint] allow custom element rule to configure frontend directory
Bug: 1206616
Change-Id: I33d2e5db33e617370eabab1a01f59e49eb7d2767
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3751200
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-07 14:47:41 +00:00
Jack Franklin cf56966bc3 [ESLint] lint front_end/third_party
In crrev.com/c/3748106 we noticed that a CL was able to land that
imported a file without the `.js` extension.

This is because `.eslintignore` listed `front_end/third_party`, so that
folder wasn't linted at all. This is an issue because whilst most of the
code in that directory is not authored by us, the entry points usually
are, and we want to apply our lint rules there.

This CL removes the blanket ignore, instead preferring to ignore
`third_party/X/package/`, and a few other special cases, ensuring that
devtools-frontend authored files in `third_party/` do get linted.

The CL updates the `es_modules_import` rule to not apply the import
checks to files in `third_party` (as they cannot apply the same
conventions we use in DevTools), but it will still check for file
extensions on imports.

The remaining changes are small stylistic changes to align to our ESLint
rules.

Fixed: 1342530
Change-Id: I4ce438499b8c9c77c3fe661576a58bad59d9b061
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3749191
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-07-07 10:55:21 +00:00
Randolf J 26e9ff964e Update puppeteer to 15.3.1
Also disables reviewer lookup and fixes boolean arguments for the `roll_front_end_third_party.py` script.

Bug: none
Change-Id: I3fb3538352841551048520f1f1e85f60d91afe24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3747780
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-07-06 17:03:25 +00:00
Jack Franklin 3ceef987a2 [Lint] fix pathing rules for inject_checkbox_styles
I'd made a mistake in the pathing logic for resolving imports; I needed
the _directory_ of the TS file being linted, not the filename itself.

I then also had to update all the tests as they contained incorrect
filepaths which caused me to miss the bug in the first place.

Bug: 1316297
Change-Id: Ie8303291b23d078a9ea1937d28ab3bef73deb258
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3747779
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-07-06 12:11:55 +00:00
Jack Franklin 8f8ec22bb3 Update karma to 6.4.0
No changes in the changelog
(https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) to
concern ourselves about, but one useful change is they upgraded the
log4js dependency which was spitting out console messages on each test
run. This is fixed with this version of Karma.

Bug: none
Change-Id: Ic49618cbda7a079cacb9813f5129692a83508a92
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3745621
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-05 10:46:37 +00:00
Victor Porof 7e0446e7ad Include applicable state information alongside all the other other property information
This makes it easier to consume the data in the frontend.

Bug: 1325812
Change-Id: I37979a7266af728399a9c4938bf97f77e5781b5b
Signed-off-by: Victor Porof <victorporof@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702682
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-15 13:05:36 +00:00
Victor Porof 93f266f30a Eslint-ignore generated DOM pinned properties dataset
This follows the example of the other generated files.
Avoids having to fight the presubmit check on regeneration.

Bug: 1325812
Change-Id: Ia925628fd5025a03b42aaf9e147e43ff752d2764
Signed-off-by: Victor Porof <victorporof@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702268
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-15 12:51:46 +00:00
Jack Franklin 06218d9b3c [Lint] fix component naming bug
I had an issue where I'd copied/pasted a component definition but
forgotten to change the litTagName property. I then realised that this
rule wasn't detecting the case where we have duplicate `litTagName`
items and should be, so we now check if we've seen a tag before and
error if so. This ensures no duplicate tag names can exist in any single
file.

Bug: none
Change-Id: I2fe5bdfe3bee6a2d2f52e90f9b80e5c82737f416
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-14 08:59:45 +00:00
John Emau 254c8dd221 Fix for devtools-frontend full checkout paths on Windows
Currently calculating the path to chromium's root directory returns an empty string on Windows because the path used to compare against the executable path is not normalized.

```
PATH_TO_EXECUTED_FILE.indexOf(devtoolsPath)
```
Becomes
```
'D:\\drive\chromium\src\third_party\devtool-frontend\src\...'.indexOf('src/third_party/devtools-frontend'); -> -1 on Windows
```

The fix is to use the normalizedPath variable to return the correct substring.

Change-Id: Ia12232f3746466f3257975d652342ac8b9ed2578
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3703315
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: John Emau <John.Emau@microsoft.com>
2022-06-14 07:03:15 +00:00
Victor Porof d8a8db74c8 Improve in-place array merges when generating the DOM pinned properties dataset
Array#includes is O(n) whereas set lookups are O(1).
We still O(n) to generate the set, but only happens once.

Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I29da73edf5e42ad4d088fd9018e505d0e787744a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702261
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 16:48:05 +00:00
Victor Porof 1a8a30d6b4 Add a DOM pinned properties dataset generator
Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I292d49d273d74d33a82e25179478405395159537
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695372
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 14:07:20 +00:00
Victor Porof 6e09692deb Add @webref/idl dependency
Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I044170880d20ce0402062755787cccafd63c6a42
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695370
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 10:23:45 +00:00
Richard Wang efcbd38590 typescript: Fully replace devtools_use_rbe with devtools_use_remoteexec
BUG=chromium:1247781
DISABLE_THIRD_PARTY_CHECK=Update devtools_entrypoint simultaneously rather than making yet another CL

Change-Id: Id85a820f0ab30a46d0631c6e5581a88c206fa8f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3694875
Commit-Queue: Richard Wang <richardwa@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-10 12:01:23 +00:00
Philip Pfaffe 17a9f74a71 Don't build wasm module test inputs in the chromium tree
We currently don't check out emscripten in the chromium tree, so disable
inclusion of the modules that would call emscripten tools in that case.

Bug: none
Change-Id: I7e69d87da6af7a198f6a509a1d2a2b02d6d94341
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695365
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2022-06-10 09:55:03 +00:00
Philip Pfaffe e29b186fe5 Generate inputs to wasm tests from wasm text
This CL introduces support for writing inputs to wasm tests in wat
format. This will allow removing dependencies on opaque binary resources
that can't be regenerated without changing hardcoded offsets in all
tests. Referencing binary and/or source file offsets will now be
possible through special comments left in the wat source.

Bug: 1328729
Change-Id: I6369c86ca57860fd9803b894797f63c36c65d554
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3666419
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-09 17:12:02 +00:00
Eric Leese ed8fe6a3c5 UI polish for authored/deployed grouping
Bug: 1334536
Change-Id: I97a45377ec48f4852e792925771b0790a0415311
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695547
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Jecelyn Yeen <jec@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-09 16:00:02 +00:00
Jack Franklin c03b4c8493 Add undefined checks to lit_template_result_or_nothing rule
My editor errored at me because it tried to lint some code and an
exception was thrown in this rule. I tracked it down to some fields that
we need to ensure exist before continuing. If they don't exist, we can
bail early and not check further.

Bug: none
Change-Id: I32d9a37a7e588e07885f2ba3fa52f2292b9754a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695546
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-06-09 11:17:34 +00:00
Danil Somsikov b46acf27bd Added tests for the size of chunked response.
These would replace flaky browser tests.

Bug: 1307734
Change-Id: I7812c29de230072b94b3ef097e60de902154551b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3657457
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2022-05-24 11:59:01 +00:00