Commit Graph
58 Commits
Author SHA1 Message Date
Jack Franklin 5bb7528e13 Update check_license_header rule with new year
It was inserting comments with 2020 in. I've updated it to figure out
the current year. This theoretically could cause problems if people are
either side of a year on New Years eve, but I'm hoping people are busy
not working then :D

Bug: none
Change-Id: I9f6cc9329189d89e6994cc0963fa70617cb446c3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2696660
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-02-16 12:53:28 +00:00
Jack Franklin 9e71e6a50f ESLint rule to ban interpolation within <style> tags
LitHtml strongly discourages this approach and it's one that often can
be avoided using CSS custom properties that are set from JavaScript, so
we're going to try to avoid its usage creeping into our codebase. We can
revisit if we hit upon a case where it's really needed.

Bug: chromium:1166108
Change-Id: Ib8c60d8670707b8f0e239d911ec569c64a3b1846
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2626294
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-14 09:34:54 +00:00
Tim van der Lippe 28a79aace9 Move assertNotNull into platform
R=jacktfranklin@chromium.org

Fixed: 1154208
Change-Id: I3729d0f06577a3bb065ea362dec9e83d096965b1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2618318
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>
2021-01-11 17:14:27 +00:00
Tim van der Lippe f78841938e Fix lit_html_data_as_type to handle multiple data setters
R=jacktfranklin@chromium.org

Fixed: 1164372
Change-Id: Idcf5419de6a7d3fa9ae816c9b9e73b6a853cbf0d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2617793
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-08 14:46:57 +00:00
Tim van der Lippe 9264487850 Convert UIString.js to TypeScript-authored
This allows us to make follow-up changes to use TypeScript-specific
features.

R=jacktfranklin@chromium.org

Change-Id: Ie17a8e1101ca6e9800fab49bc560cce8001b58ca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612859
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 16:33:36 +00:00
Jack Franklin 51ffa992c9 Migrate component docs data grid example to TS file
Writing the component docs example inline makes it easier to quickly
through an example together but means we lose any type checking on the
examples.

This CL migrates one example to TS and updates the ES Modules Import
lint rule to allow component docs files to import the test helpers -
which we do to allow them to emulate a full DevTools environment if
required.

This change caught some invalid config in the component doc example so I
think if we can make this migration across all the component doc
examples it will help ensure our examples are up to date and valid.

Bug: 1144106
Change-Id: I32cf0e09bfe158ae5ba9b57dbc535e14a9985a5f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2613206
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-07 10:05:36 +00:00
Jack Franklin 75b0efc9b9 Ban "front_end" imports from front_end directory.
If you're in the front_end directory and you mistakenly include
front_end in an import, e.g:

import * as UI from '../../front_end/ui/ui.js';

instead of:

import * as UI from '../ui/ui.js';

It will cause problems in a release build. This CL lands an ESLint rule
to ban these, but still allows it for unit tests.

Fixed: 1157057
Change-Id: Ia49279794616568f9e88241152e3412fcd9a8b36
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2581547
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-09 15:00:16 +00:00
Jack Franklin 92fe8ff0c7 Enforce readonly string[] over ReadonlyArray<string>
A stylistic choice we've made and now are enforcing.

Fixed: 1152710
Change-Id: If84b8adbc872d12517b7a6b38f0e5049b94f286e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571114
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-12-03 11:26:43 +00:00
Jack Franklin 01d09b0089 Ban underscored methods and properties in TS files
With one exception: if a class with private property _foo has a public
foo() method, we'll allow it.

Change-Id: Ie89ce5661e49e78abc0ab9f41db14743b1690aa0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2567956
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-03 10:07:33 +00:00
Jack Franklin dd3be2e786 Enforce const enum via ESLint rule.
R=andoli@chromium.org

Bug: 1130536
Change-Id: I2304b32f1f0c9f4a6713156c9218ec9d0c9270ae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562854
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2020-11-30 15:56:41 +00:00
Jack Franklin 3077c439b5 [ESLint] rule for .data=${{} as X}
This rule enforces that within a LitHtml template when we bind to the
`.data=` property we provide an explicit type cast that must be a type
reference.

This is one of the checks that the component bridges used to make, but
now we need to port them to ESLint rules.

Bug: 1130536
Change-Id: I401661289a829fd181bf91943fffe162b87de8b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-27 10:37:14 +00:00
Jack Franklin 65cfd29d84 [ESLint] enforce set data methods use a type reference
And not a literal type. Again, was enforced by the component bridges
code.

Bug: 1130536
Change-Id: I766015ef69470df06443a71035dd04037104f85b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562351
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-26 17:59:13 +00:00
Jack Franklin 6c3b0937fe Remove LitHtml and Marked exemption from ESLint modules rule.
We do now import third-party properly and with the heuristics update they are
now correctly detected as a bundle.

Bug: 1147888
Change-Id: Ibb68f391258c001c16784a32b64f957217af4905
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534951
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-18 15:38:48 +00:00
Jack Franklin b14dbe3426 Fix heuristic for determining external bundles in Release
The current bundling system with Rollup tries to determine when given a
file if it’s an entry point (e.g. ui/ui.js) or not (e.g ui/someFile.js).
If it’s not an entry point, it will bundle that file into the entry
point JS file. So when we go to bundle ui/ui.js, it’ll find files like
ui/someFile.js, and pull them into ui/ui.js, which ends up being a fully
“rolled up” version of the ui folder.

The problem comes when you nest these folders;
ui/components/components.js is an entry point but the logic that the
Rollup bundling code uses incorrectly detects it as a regular file. So
you end up with ui/ui.js including a rolled-up version of
ui/components/components.js, which itself is a rolled-up file. We then
ship ui/ui.js and ui/components/components.js, meaning we’ve shipped
components.js twice - once as a standalone file, and once because it was
rolled up into ui.js.

This CL fixes this by changing how we detect bundles, we now look for
importing files whose parent directory is the same, so:

- components/components.js is a bundle
- but components/foo.js is not a bundle

By making this change we also now correctly detect third_party bundles,
with the exception of Acorn which is a special case, so we can lose the
checks for that in our Rollup config.

The logic here is somewhat duplicated between Rollup's config and the
ESLint rule plugin that we have; I plan on making a follow-up CL that
tries to define this logic in one place so if it changes in the future
we can update the code in one place and have the linting & rollup
update, plus we'll be able to use the ESLint tests as coverage to ensure
we've not broken our bundling.

Fixed: 1144123
Change-Id: Idd82a3ef69a09871867626a0d74266e25801243f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534202
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-18 14:19:58 +00:00
Tim van der Lippe 66f80d99ca Fix ESLint tests
The upgrade to ESLint 7.0.0 broke our custom rule tests. It seems
we were affected by https://github.com/eslint/eslint/issues/13293
after all.

R=jacktfranklin@chromium.org

Change-Id: I3dcf8b7e15f1bc6a26c2fa069f24241e87f07627
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2538840
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-16 12:15:09 +00:00
Jack Franklin b5920ca458 Enforce kebab-case naming of custom events
Fixed: 1145972
Change-Id: Id16bd5d28e77f0d37b543e0366257bbf84b5d4a0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2536399
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-16 10:12:09 +00:00
Paul Lewis be466dc7ac [eslint] Change es_modules_import rule to also check unit test files
This is a clone of https://crrev.com/c/2323191.

Bug: 1148296
Change-Id: Ia49ccdb2ba253f0c9fe2138b07ca19f082501522
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537957
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-13 17:48:19 +00:00
Peter Marshall f8f4ea4e9f tests: Add a lint check for it.repeat()
We don't want these accidentally committed.

Bug: 1101782
Change-Id: I67a820bbaa6b8a8d1cb4a1a6afdb29bc8dacdc5e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354107
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-17 08:04:25 +00:00
Peter Marshall 467b0b1632 tests: Use mocha-extensions in e2e tests
The extensions have helpers like it.repeat() and async tracing which
make development and debugging easier. All the tests will import from
the extensions file now rather than mocha directly.

A follow-up CL will add lint checks for this.

Bug: 1101782
Change-Id: I7b1a540be1685375b06f1db5d0fda2f2879446c2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354104
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-17 07:37:56 +00:00
Alex Rudenko a39d214440 Layout pane
This CL adds a new layout panel to the sidebar in Elements. Currently,
the pane only displays CSS Grid settings. In the future, the list of
all CSS grids will show up above the settings. The new panel is behind
the CSS Grid experiment flag.

Screenshot: https://i.imgur.com/T5Kd5Wi.png

Bug: 1109177
Change-Id: I7b5620ce6818df68d1f9cb36975be3679ca16837
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317315
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Peter Müller <petermueller@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-11 05:46:01 +00:00
Paul Lewis 7b17f160f7 [global] Stage second impl of ThemeSupport
Theme Support is currently in the ui/utils subdirectory. This ultimately
creates a circular dependency when we move to accessing it via imports
rather than by the global namespaced version. This CL creates an inert
copy of the Theme Support logic in the top level folder, and a future CL
will migrate all call sites to this version and remove the current
implementation in ui/utils.

Change-Id: I628b335dcc34fba29c79d11e4180593bb936f798
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346370
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-10 15:44:55 +00:00
Philip Pfaffe 7d128bd540 [eslint] Ensure that linting doesn't crash on a custom it.skip
Change-Id: I3fc841a4c0e34b1c29686157ba3089e620036f51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332230
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-31 13:35:59 +00:00
Mathias Bynens 4a0d19365c Reland “De-obfuscate X-Client-Data header values in Network tab”
Reland of: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062

Screenshot: https://i.imgur.com/LJHFIp9.png
Note that the screenshot shows this as a response header instead of a
request header, since that was easier to test. In real-world scenarios
it would be a request header instead, but the UI looks the same.

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

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

Bug: chromium:1103854
Change-Id: I6b959a1d57bcbc84f8571257a88fcbec805bf330
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318257
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-28 06:54:51 +00:00
Mathias Bynens 43af8ef5d3 Revert "De-obfuscate X-Client-Data header values in Network tab"
This reverts commit d63cf4f023.

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

Original change's description:
> De-obfuscate X-Client-Data header values in Network tab
> 
> Screenshot: https://i.imgur.com/LJHFIp9.png
> Note that the screenshot shows this as a response header instead of a
> request header, since that was easier to test. In real-world scenarios
> it would be a request header instead, but the UI looks the same.
> 
> CL preparing the ClientVariationsParser for use in the DevTools UI:
> https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
> 
> Bug: chromium:1103854
> Change-Id: Ifb63c011df2ea7af8aeb47dd615e2b20863a02c1
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
> Reviewed-by: Ilya Sherman <isherman@chromium.org>
> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
> Commit-Queue: Mathias Bynens <mathias@chromium.org>

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

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

Bug: chromium:1103854
Change-Id: Id405f5991fd33a4dff5dd13c44da5ac3e67609cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318251
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-27 11:15:07 +00:00
Mathias Bynens d63cf4f023 De-obfuscate X-Client-Data header values in Network tab
Screenshot: https://i.imgur.com/LJHFIp9.png
Note that the screenshot shows this as a response header instead of a
request header, since that was easier to test. In real-world scenarios
it would be a request header instead, but the UI looks the same.

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

Bug: chromium:1103854
Change-Id: Ifb63c011df2ea7af8aeb47dd615e2b20863a02c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-24 09:04:39 +00:00
Simon Zünd a9f48fb117 Introduce thin wrapper module for third_party package 'marked'
This CL adds the //front_end/marked module as a thin wrapper for the
third_party package. Please note that //front_end/marked is currently
only usable from Closure land. Support for TypeScript-land is planned
but currently blocked on infra changes.

R=aerotwist@chromium.org

Change-Id: I91d0ce2772271ce09d608113ecb6fe13b48e1af2
Bug: chromium:1099162
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287511
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-07-08 12:01:16 +00:00
Tim van der Lippe d9af05ccd9 Fix eslint check_test_definitions to handle template literals
R=petermarshall@chromium.org

Fixed: 1102324
Change-Id: I059e8ec845382f126d09c85b92e9752457a9a1b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282569
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-07-06 15:28:51 +00:00
Benedikt Meurer 6860b5971b [wasm-debugging] Drop experimental out-of-progress language plugin
The out-of-process language plugin is no longer actively developed
and the design is considered insecure, so remove that from the tree
now.

Bug: 1083146
Tbr: tvanderlippe@chromium.org
Change-Id: I5fdb29fb070c6171202177b675f50f3b5fc1042e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282342
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2020-07-06 07:32:42 +00:00
Alex Rudenko 4f8e4f9344 Reuse blendColors util
This CL extracts blendColors into a new utils file (more lightweight
function utils compared to Color.js) and reuses it in the overlay code.
Also, it adds an exception to eslint module import rules for the
inspector overlay folder because inspector overlay benefits from
granular imports instead of complete namespace imports.

Bug: 1078267
Change-Id: I01ec8f295da8bfac0b57b9dd2661ca9f798de869
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2228514
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-06-04 06:23:51 +00:00
Tim van der Lippe 55f7489e8e Fix es_modules_import to handle .mjs files
This is required for the usage of `acorn.mjs`

R=jacktfranklin@chromium.org

Change-Id: I76fe80b1d444b4325c05a896028ba80fce4ad2bc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2212167
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-27 12:52:39 +00:00
Tim van der Lippe 4b342721d0 Use acorn-loose from front_end/third_party
This also required adding a dummy `.d.ts` file. I will send a
PR upstream to add that.

R=bmeurer@chromium.org

Bug: 1011811
Change-Id: I754ce07bd7d06ae39ab689974f77a71338adb48f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2212164
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-05-26 11:09:21 +00:00
Tim van der Lippe b4efb6ecad Fix regex for name matching
Package names can include dashes and lower dashes in their name.

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

Change-Id: I268fa9931431ad4492b27c5a01a958ea74a0d234
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209087
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-21 11:01:26 +00:00
Tim van der Lippe f864f5b3d9 Port cm files to third_party/codemirror usages
The codemirror.css file needs to stay and will be removed in a
separate CL. Apparently we have our custom CodeMirror theme
in `text_editor/cmdevtools.css` which overwrites internals.

We should look into porting the css styles to use CSS variables
like all other themes.

R=mathias@chromium.org

Bug: 1076825
Change-Id: I0bdbdfa297d5ffac916d93dcadd1db66f15af6b3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179844
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-05-18 09:41:01 +00:00
Tim van der Lippe c606bf358e Fix invalid cross-namespace star import
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193588/1/front_end/sdk/CSSMedia.js#5

R=jacktfranklin@chromium.org

Change-Id: I9a34975891256d40ca0df59647cc3a48df9d1caf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193954
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>
2020-05-11 16:17:30 +00:00
Tim van der Lippe 03fe3e7b0f Fix ESLint rule for full relative URL
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193578/1/front_end/sdk/CSSProperty.js#5

R=jacktfranklin@chromium.org

Change-Id: I40225afb5b6018dc99f1d0d7af53ee9016c86e66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193953
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-11 15:52:50 +00:00
Tim van der Lippe 1066bfdb3e Port cm_web_modes files to third_party/codemirror usages
This removes the cm_web_modes folder, as we now import from third_party
instead. We still double include the css.js and htmlmixed.js in the
formatter_worker and text_editor, but sadly we can't remove that until
the module.json files are removed.

roll CodeMirror

R=mathias@chromium.org

Bug: 1076825
Change-Id: I7b5a15bcc9db51b4a38be7db3d2da97aa9deb0f6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179362
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 11:47:22 +00:00
Tim van der Lippe 4b1e8293fd Use Acorn distribution in formatter_worker
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I564fd56105eb6c1ae484f556febc409796701f57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2181217
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-06 10:14:52 +00:00
Tim van der Lippe a17f6d2107 Port cm_modes files to third_party/codemirror usages
roll CodeMirror

R=mathias@chromium.org

Bug: 1076825
Change-Id: I85c076a68770b6c4d710bca3b5d4b055ac0e78d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2178589
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-04 13:09:51 +00:00
Tim van der Lippe f40e0827f8 Remove checked in headlesscodemirror.js in favor of third_party source
The `headlesscodemirror.js` was actually a copy of
`addon/runmode/runmode-standalone.js`. Using the third_party source
allows to remove configuration for clang-format, ESLint and the
roll_codemirror.py files.

The cm_headless module is used in the formatter_worker. I verified that
the import is working as intended by building DevTools and formatting
a CSS file (which is one of the formatters that makes use of CodeMirror).

Then I found out that the runmode-standalone file expects `window` to
exist, which doesn't exist in workers. Therefore, locally patch that
to `globalThis.CodeMirror`.

R=mathias@chromium.org

Bug: 1011811, 1076825
Change-Id: Id8e5ed1d0ca81c3699def73a0eb63835ffc7a43f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2174418
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-05-04 10:25:16 +00:00
Sigurd Schneider ba81851dad [issues] Add IssueManager abstraction
This CL adds a central singleton that collects all issues from all
known targers. This singleton is then used by the issues view to
display issues.

This change enables correct handling of issues that arise from OOPIF
and worker sources.

Fixed: chromium:1073797
Change-Id: I75a8bb46d240f63df013c0b06506cad7fb2e5a8f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2168885
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-29 11:14:55 +00:00
Jack Franklin 93f52244c5 Reland "Move UIString into Platform"
This is a reland of 992295e37d

Original change's description:
> Move `UIString` into `Platform`
>
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
>
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
>
> To avoid rewriting a lot of imports we re-export it from `common.js`.
>
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

Change-Id: I482323d1b35eb38066a571cb8630078b6cff6cde
TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165793
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-04-27 13:59:26 +00:00
Mathias Bynens 6ac9100804 Revert "Move UIString into Platform"
This reverts commit 992295e37d.

Reason for revert: breaks tree

Original change's description:
> Move `UIString` into `Platform`
> 
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
> 
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
> 
> To avoid rewriting a lot of imports we re-export it from `common.js`.
> 
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

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

Change-Id: Ic75fa4dfd49a2c413eee37b03d4c1f54e70eee20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165789
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-04-27 12:38:27 +00:00
Jack Franklin 992295e37d Move UIString into Platform
Platform is the "lowest" part of DevTools - e.g. it depends on nothing.

We have code we want to move to Platform but cannot because it needs
`ls` and therefore creates a circular dependency. So this CL moves
UIString into Platform.

To avoid rewriting a lot of imports we re-export it from `common.js`.

Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 11:57:16 +00:00
Tim van der Lippe 0c197e5a9e Add extensions for implicit imports in named export declarations
R=jacktfranklin@chromium.org

Change-Id: I9886922dc14e0bc05248a1d1a7c3f85304ea7c9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167756
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-27 10:50:35 +00:00
Jack Franklin 28447fd262 Add ESLint rule to ban assert.equal
`assert.equal` is a non-strict check - it uses `==`. In our tests we
should either use:

* `assert.strictEqual` which uses `===`
* `assert.deepEqual` which does
a comparison on objects.

Change-Id: I872f9be140dc4c60b199fce94f95d0c12ee2bbc0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2160929
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-23 12:41:30 +00:00
Benedikt Meurer 3244d968e1 [CodeMirror] roll CodeMirror to 5.53.2
Also fix instructions and roll_codemirror.py script, and add the
new `wast.js` web mode for WebAssembly disassembly (which is going
to be hooked up in a follow up CL).

Bug: chromium:1042721
Change-Id: I2f14934b48528439b707538a64dfff4c2ac846e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159505
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2020-04-23 10:11:09 +00:00
Tim van der Lippe 80c102878f Add ESLint rule for skipped tests
This makes sure that every skipped test also has a corresponding
CRBug filed to track re-enabling that test. Additionally, every
skipped test must have an attached comment with an explanation
as to why it is skipped.

R=jacktfranklin@chromium.org

Change-Id: I006a66ab32e7c014ef2287cb79f50b77de559a20
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159518
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-22 13:32:39 +00:00
Tim van der Lippe b0f499fbae Fix eslint import rules to warn on test import extensions
Tests should also use imports that end with an extension, particularly
as it can silently fail in Karma.

We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144163/4/test/e2e/application/cookies.ts#10

R=janscheffler@chromium.org

Change-Id: Ic379cb90b8e201b55a24010dc45565f6f45d910e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150450
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-15 14:02:58 +00:00
Tim van der Lippe 650668eda9 Fix ES module import linter for module entrypoints
Module entrypoints need to be of the form:
import * as File from './File.js'

This makes sure that all usages of the symbols in a cross-namespace
module use the form Namespace.File.Symbol.

We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2120014/5/front_end/common/common.js#14

R=mathias@chromium.org

Change-Id: If550c3d11456c1ac31ad3230705439e58d226d11
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150452
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-04-15 13:09:08 +00:00
Tim van der Lippe c27927c22e Remove esprima
Esprima is an older parser that does not support modern JavaScript
features. Moreover, we are no longer this parser in either the
ESLint pipeline nor the localization pipeline. Therefore, we can
remove our mirror on GitHub and delete it from node_modules.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove esprima

Change-Id: I372b66c973424752bcd487954504c20b2282d0d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2140940
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-09 11:42:50 +00:00