Tim van der Lippe
421827d590
Add ninja template for copying to the gen folder
...
We are doing this so often and the syntax for the `outputs` arg
is difficult to remember, I figured it is better to extract out
a template. This should make it easier to copy-paste from other
BUILD.gn files as well.
R=aerotwist@chromium.org ,jacktfranklin@chromium.org
Bug: 1088463
Change-Id: Ic78ee5082ee5eae4e07f7ceeb21842f54dcbaf56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224807
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-06-02 10:38:50 +00:00
Tim van der Lippe
696a03e075
Revert "Move rollup configuration to front_end/rollup.config.js"
...
This reverts commit 11c3e48f98 .
Reason for revert: Has a negative performance impact for Chromium builds
Original change's description:
> Move rollup configuration to front_end/rollup.config.js
>
> This makes it easier to change the rollup configuration and allows
> us to introduce the terser minification plugin.
>
> R=jacktfranklin@chromium.org ,aerotwist@chromium.org
>
> Bug: 1084578
> Change-Id: Ie9c3447913a9d6ca59905267472a8bad328642b2
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208134
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
> Reviewed-by: Paul Lewis <aerotwist@chromium.org >
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org ,jacktfranklin@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1084578
Change-Id: If359d1398796330e8569a1ecf0af9d94ad08abae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2218065
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-28 11:10:30 +00:00
Tim van der Lippe
b25b1446aa
Typecheck sdk/ChildTargetManager.js with TypeScript
...
This also fixes an issue with the protocol externs to not being
able to handle optional types. The ChildTargetManager would
otherwise not being able to call `detachedFromTarget` in
`dispose`.
R=jacktfranklin@chromium.org
Bug: chromium:1011811, chromium:1079233
Change-Id: Ib5ccf0ff72ee6e954adbb15241dc53dbc7f2e6ac
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2215851
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-05-26 17:11:16 +00:00
Tim van der Lippe
8ea04b09d5
Also copy over integration_test_runner.html in BUILD.gn
...
This includes `integration_test_runner.html` in the copy action of
`front_end`. We previously ran into issues with the layout test
runners, which was probably because we erroneously removed the
mention of `integration_test_runner.html` in the `devtools_test_files`.
Therefore, remove all logic related to `has_html` and remove
`integration_test_runner.html` from the root BUILD.gn, but not from
the `devtools_test_files` array which is used on CQ.
R=aerotwist@chromium.org
Fixed: 1078770
Change-Id: Id5379903278fcee569662dc986b64d665c40f3e8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209101
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-26 10:47:31 +00:00
Tim van der Lippe
b12011da35
Revert "Use terser rollup plugin"
...
This reverts commit f045c636f9 .
Reason for revert: Chromium uses `is_debug` for a different purpose and therefore this change significantly increases the build time for engineers working on the DevTools backend. We should gate Rollup behind `is_official_build` instead.
Original change's description:
> Use terser rollup plugin
>
> Terser can minify variables names and is a smarter minifier than
> the previous regex-based minifier. The regex-based minified only
> removed whitespace and comments.
>
> This reduces the total size of resources loaded for a fresh load
> of the Elements panel from 3.4MB to 2.6MB.
>
> It does increase the build time for a release build, but this should
> not have an impact on the development workflow of engineers working
> on DevTools.
>
> R=jacktfranklin@chromium.org ,aerotwist@chromium.org
>
> Fixed: 1084578
> Change-Id: I037206da9fe2f3e6148fd814f5af7db78d543cee
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208139
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
> Reviewed-by: Paul Lewis <aerotwist@chromium.org >
TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org ,jacktfranklin@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I96c24f6b4cd5eac5cc2a3807db211b96c3d44576
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2215842
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-26 09:30:51 +00:00
Tim van der Lippe
f045c636f9
Use terser rollup plugin
...
Terser can minify variables names and is a smarter minifier than
the previous regex-based minifier. The regex-based minified only
removed whitespace and comments.
This reduces the total size of resources loaded for a fresh load
of the Elements panel from 3.4MB to 2.6MB.
It does increase the build time for a release build, but this should
not have an impact on the development workflow of engineers working
on DevTools.
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
Fixed: 1084578
Change-Id: I037206da9fe2f3e6148fd814f5af7db78d543cee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208139
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-05-21 11:51:17 +00:00
Tim van der Lippe
11c3e48f98
Move rollup configuration to front_end/rollup.config.js
...
This makes it easier to change the rollup configuration and allows
us to introduce the terser minification plugin.
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
Bug: 1084578
Change-Id: Ie9c3447913a9d6ca59905267472a8bad328642b2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208134
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 09:43:27 +00:00
Tim van der Lippe
b3bb9d3aa2
Fix registerDispatcher types in Closure
...
We need to accept both Protocol. and ProtocolProxyApi. namespaced
dispatchers, as older dispatchers use the former and newer dispatchers
use the latter.
R=sigurds@chromium.org
Bug: 1081686
Change-Id: I44fb6ff510e5fb5f3879e3ef285e908673dc0054
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209107
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Sigurd Schneider <sigurds@chromium.org >
Reviewed-by: Sigurd Schneider <sigurds@chromium.org >
2020-05-20 07:46:07 +00:00
Tim van der Lippe
719446c0db
Include workaround for TypeScript compiler bug
...
The TypeScript compiler has a bug where, when you implement an
interface in JSDoc which is defined in a `.d.ts` file which
uses a namespace, it generates an invalid declaration file [1].
To workaround this bug, we have to add global interfaces that
are essentially aliases of the actual interfaces. As a result,
the TypeScript compiler no longer fails with resolving.
Update Closure accordingly such that we can use the correct
type to work in both Closure and TypeScript.
[1]: https://github.com/microsoft/TypeScript/issues/38640
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
CC=sigurds@chromium.org ,janscheffler@chromium.org
Bug: 1081686, 1011811
Change-Id: I088a4520c90ce0873cf9850a8ed65f9c8dd896ef
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208978
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-19 14:06:46 +00:00
Tim van der Lippe
0755417a60
Add dispatcher object notation types to Closure
...
This is required to teach Closure about the new object notation.
These live only on the ProtocolProxyApi, as that is what TypeScript
understands.
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
CC=sigurds@chromium.org ,janscheffler@chromium.org
Bug: 1081686
Change-Id: Ibeed69ec116b9d86bbf7acc5a05f71f0a8f4b794
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2207237
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-19 10:16:36 +00:00
Jan Scheffler
3f36af81ee
Remove "Agent" from closure types
...
By removing Agent from the closure types for CDP requests and responses,
the types become compatible with TypeScript:
Protocol.PageAgent.SetDeviceMetricsOverrideRequest
becomes:
Protocol.Page.SetDeviceMetricsOverrideRequest
Change-Id: I3442061c9007c39b08a4ab945d19253880d74ba7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204285
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
2020-05-18 12:48:46 +00:00
Jan Scheffler
bb0779674b
Add basic types from protocol to closure
...
Change-Id: I3c522e24f7f06fa55881f363546d4be12f5da64e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204108
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
Auto-Submit: Jan Scheffler <janscheffler@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-15 20:28:07 +00:00
Jan Scheffler
36aca5228a
Use enums for params in closure
...
This patch puts the work from crrev.com/r/2204105 into
effect and changes all callsites to use the enums instead
of strings.
Change-Id: I9079813f0a79cac11e43be8734fc984b67a96f24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204110
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
Auto-Submit: Jan Scheffler <janscheffler@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-15 20:15:07 +00:00
Jan Scheffler
97aa83941c
Make closure aware of enums in CDP params
...
Change-Id: Id9a05a9fdc6e2fbc15914a2bfb58469d7b7cc539
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204105
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
Auto-Submit: Jan Scheffler <janscheffler@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-15 14:33:21 +00:00
Jan Scheffler
e6ca9bd614
Add support for enums defined in parameters
...
Change-Id: Ibb02f77a67b020d1d9f178f4af5bcc4ad993e916
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204103
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-15 13:56:56 +00:00
Alex Rudenko
7bf4d03c58
Move overlay implementation to DevTools
...
This CL moves the implementation of inspect_tool_highlight.html to
DevTools, sets up a separate resource build target containing code
bundles produced by rollup. Also, it adds size checks and sets up
an example test. The future CLs will cover the rest of inspector tools
and better tests. A follow-up CL for Chromium to use the newly generated
resource is prepared[1].
[1] https://crrev.com/c/2194865
Bug: 1078267
Change-Id: I1c66e3c2aaec04c2f07fab8623d674ada95d8b24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2192892
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: Peter Marshall <petermarshall@chromium.org >
2020-05-14 06:05:14 +00:00
Jan Scheffler
68eefdc2c5
Enable TypeScript for PaintProfiler and add Protocol.binary to closure
...
Bug: chromium:1011811, chromium:1079233
Change-Id: If8f39e531002411524d3ee4ce6b94ca8843dbdc3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196384
Commit-Queue: Jan Scheffler <janscheffler@chromium.org >
Auto-Submit: Jan Scheffler <janscheffler@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-13 10:24:21 +00:00
Tim van der Lippe
3cccb4f51b
Complete typecheck of sdk/NetworkManager.js with TypeScript
...
What we learnt/changed:
- For invoke_* commands, allow the omission of the request object,
by adding an initializer in the generated code.
R=aerotwist@chromium.org
Bug: 1011811
Change-Id: I04ee0eec703bdcc0235bc5a4a41387af72f912a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2173374
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-05-04 11:09:51 +00:00
Tim van der Lippe
fcf8179a6a
Fix issues with SDK compilation
...
Even though we were using the SDK files in the unittests for SDK,
not all files were included. A CL which attempts to use sdk.js (e.g.
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165757 )
would then fail on several generated .d.ts issues.
Issues fixed:
- Usage of `Object` instead of `Map` causing issues with a type
alias of `string`, since TypeScript object notation only allows
primitives to be used as indices.
- Missing return types for function types
- A reference to `Protocol.NetworkAgent` which does not exist on
the protocol. Instead, that is part of the protocol-proxy-api.
Therefore, we must include the declaration file in the ts_library.
This also showed that the `ProtocolApi` needs to be exported
instead of declared.
This means that for any future reference to any Protocol type
that is actually an agent, we should be using the
`ProtocolProxyApi` definitions instead. To make sure Closure
understands that type, I aliased it in the externs.
R=jacktfranklin@chromium.org
CC=sigurds@chromium.org ,szuend@chromium.org
DISABLE_THIRD_PARTY_CHECK=Typescript fixes
No-Presubmit: true
Bug: 1011811
Change-Id: I4f5a488edb2d5fa6c5ed12d33411efb5f7fb8133
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165795
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Sigurd Schneider <sigurds@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-04-27 14:22:46 +00:00
Tim van der Lippe
efb2a94cdc
Run Karma unittests on the Ninja output directory
...
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder.
It uses the Ninja build output to find the unittest files.
You can run the new script with:
npm run unittest
npm run unittest -- --target=Release
To make sure you perform a minimal build and run tests right after it, run:
npm run auto-unittest
npm run auto-unittest -- --target=Release
If no ninja-build-name is set, it assumes that `out/Default` exists.
The `auto-unittest` command will run autoninja for you on the output folder.
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
No-Presubmit: true
Bug: 1061125
Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-04-27 10:16:15 +00:00
Mathias Bynens
51980699f7
Avoid unnecessary use of Object.entries
...
Previously, the script would output code of the form:
new Map(Object.entries({
'word-wrap': 'overflow-wrap'
}));
This patch simplifies that down to:
new Map([
['word-wrap', 'overflow-wrap']
]);
No-Presubmit: true
Bug: chromium:1039620, chromium:1075437
Change-Id: Ia102b46b70bdbb227c5ff41742fcb82940d48eb9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165787
Commit-Queue: Mathias Bynens <mathias@chromium.org >
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org >
2020-04-27 09:32:55 +00:00
Andrey Kosyakov
be26c1703e
Only declare trailing optional param names as {type=} in generated JSDoc
...
This fixes front-end compilation in case a parameter that was previously
non-optional is made optional in the protocol.
Change-Id: I86f02d3dbdccff5a65636a98edcfe81476c8455e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150158
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Andrey Kosyakov <caseq@chromium.org >
2020-04-16 00:14:59 +00:00
Tim van der Lippe
5d2d79b814
Fix presubmit check to always run when generated files change
...
We are changing the build output in the generated file, but were not
properly checking that these were changed, as the presubmit check
was ignoring files in the `front_end/generated` folder.
Also fix the issue where the InspectorBackendCommands.js would be
changed to not emit the typedef.
R=szuend@chromium.org
Bug: 1011811
Change-Id: I2e09bce9cae69f4191d93de177b5ab5bb7da46c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2115630
Reviewed-by: Simon Zünd <szuend@chromium.org >
Commit-Queue: Simon Zünd <szuend@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
2020-03-23 12:34:41 +00:00
Simon Zünd
b6414c9da6
Rename legacy global for protocol_client to ProtocolClient
...
R=tvanderlippe@chromium.org
Bug: chromium:1011811
Change-Id: Ibe6de479bcc18d28dceb7fa2266388ca0d65eae2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107558
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Simon Zünd <szuend@chromium.org >
2020-03-19 12:48:42 +00:00
Simon Zünd
3b0c540211
Rename front_end/protocol to front_end/protocol_client
...
This CL is part of the work to switch over to the TypeScript compiler
for type checking.
R=tvanderlippe@chromium.org
Bug: chromium:1011811
Change-Id: Ic709a193b252df7e9027c00cf20d8afe525a215a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107539
Commit-Queue: Simon Zünd <szuend@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-03-18 18:06:20 +00:00
Tim van der Lippe
6d51bf00ea
Factor out Runtime to root/Runtime.js
...
front_end/Runtime.js was doing multiple things: it was instantiating
side-effecty descriptors and initializing applications, as well as
storing all state for the modules/extensions, etc...
To support proper ES Modules, we need to separate these. root/Runtime.js
contains simple classes that store the data and can be retrieved, as well
as some helper functions that will load the respective data.
The RuntimeInstantiator.js code includes the start functions used in the
entrypoints themselves. They will use an instance of the Runtime to
properly load the application.
Along the way, I also fixed various TypeScript errors, mostly around
incorrect or missing type definitions.
R=aerotwist@chromium.org ,jacktfranklin@chromium.org
Bug: 1011811
Change-Id: If3ddea9267813691b3faeb6ea4b0cf64edbde1f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107523
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-18 12:19:29 +00:00
Tim van der Lippe
c19ea32ca5
Fix protocol generator formats
...
- The protocol files were generated without license headers
- There were whitespace issues in the .d.ts files
Change-Id: I19572989360a4a537fdfe829f212587ae70e180f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107217
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org >
2020-03-17 12:34:08 +00:00
Tim van der Lippe
ba26b2b503
Run ESLint on the scripts directory
...
We weren't running ESLint on this directory and, as it turns out, there
are quite a few linter errors in this folder.
R=jacktfranklin@chromium.org
Change-Id: Ic6cb9f6ad4858f69114e0c433a954041215b49e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096705
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-11 14:47:51 +00:00
Changhao Han
1e4c9dd21a
use "alias_for" from css_properties.json5 to get canonical css property names
...
Bug: chromium:1039620
Change-Id: I3be48ee7da959fa500c8775323aa416de520353e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2089908
Commit-Queue: Changhao Han <changhaohan@chromium.org >
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org >
2020-03-09 21:49:48 +00:00
Tim van der Lippe
6a0c2e2f5b
Sort generated property values on keys
...
When dumping the JSON object, we have to ensure that the keys are in the
same order. Otherwise, the generated file is non-deterministic.
We hit this issue when we made a subsequent update in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2089908
where we are adding an additional dictionary to the file, causing
failures on Windows.
R=changhaohan@chromium.org
Bug: 1039620
Change-Id: Iec33962d4fd5dff461bc2930db54e5c85ce645b7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095300
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Changhao Han <changhaohan@chromium.org >
Reviewed-by: Changhao Han <changhaohan@chromium.org >
2020-03-09 18:00:38 +00:00
Tim van der Lippe
8bdbc7af8c
Use rollup to bundle module entrypoints
...
Settting the Ninja arg `is_debug` will retain the old behavior. However,
setting that flag to `false` will start using Rollup. Rollup will bundle
everything into an entrypoint, but will avoid bundling module
dependencies.
For example, if a file in `ui` depends on `common`, then everything in
`ui` will be bundled into `ui/ui.js`. But, it will retain all imports to
`common` as `import * as Common from '../common/common.js';`.
This also caught an issue with misconfiguration in the
wasmparser_worker, which should import the files directly and can't use
it in the dependencies array of the module.json
Lastly, the BUILD.gn definition is significantly cleaned up. In the
process of doing all this work, I discovered that we can simply use
`foreach` to iterate through all source files. This removes the
duplication of both `fron_end` and `$resources_out_dir` and
significantly reduces the amount of clutter in BUILD.gn.
As such, update check-gn.js to check for the correct GN variables.
roll CodeMirror: ignore
Bug: 1046596
Change-Id: I7dcda7949e79e001c8a11307dc902f96a8fa6696
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2089906
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-09 10:59:37 +00:00
Tim van der Lippe
f5b833c6d2
Remove useless content read
...
This logic was only performed for the shell.js, which is essentially
empty. As such, we can remove it.
Bug: 1046596
Change-Id: I0218e0a7264594b588080e36c73b498c06e0d160
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035793
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-03-05 16:01:24 +00:00
Tim van der Lippe
a092065b44
Remove unused methods
...
They are not referenced anywhere in this file
Bug: 1046596
Change-Id: If9a76df7ee83d2d95a3c8185371a01fee71fa283
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035792
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-03-05 15:42:13 +00:00
Tim van der Lippe
e894e9c586
Stop rewriting html entrypoints
...
This adds the necessary ES imports to the various entrypoints to
properly load their dependencies. This means that we can stop rewriting
the HTML entrypoints and simply copy them over to the build directory.
Bug: 1046596
Change-Id: If1182ed051a22cc2bb0c77456456ab039f63cec2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035791
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-03-04 17:19:45 +00:00
Tim van der Lippe
b3b90761b1
Generate InspectorBackendCommands.js on presubmit
...
This checks in the InspectorBackendCommands in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.
In the process, I discovered multiple misconfigurations in the formatting
presubmit check. First of all, it was never running, because the
.eslintignore had an empty line. Second of all, it was running twice,
which is unnecessary since we now check for changed files at the end
of the presubmit. Lastly, it was only formatting JS files, while it
should check all files.
I have also updated the _CheckGeneratedFiles check to only run if it
is actually necessary. If there are no changes made to any affected of
the files, it will skip the step. This should thus reduce the presubmit
time and we will only pay the cost if we actually update any of the
files.
Lastly, it will now properly format and lint the generated files. This
makes reading the code a lot easier and makes it easier to digest the
diff when a protocol update goes through. I have verified that, in a
full build, the files are still minified. Thus, this has no impact on
the loading performance.
DISABLE_THIRD_PARTY_CHECK=Updating protocol generation
Fixed: 1056614
Change-Id: If49b0e749978ea1a7838992ec13507ee761ad76c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087765
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-03-04 15:52:35 +00:00
Tim van der Lippe
f664763cdf
Generate SupportedCSSProperties.js on presubmit
...
This checks in the SupportedCSSProperties in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.
Bug: 1056614
Change-Id: If0ff2ba0f94f1f0eded2792922e9a917820d9772
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087762
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-03-04 14:23:14 +00:00
Tim van der Lippe
4d004ec2b8
Generate ARIAProperties.js on presubmit
...
This checks in the ARIAProperties in the source tree file and ensures
that it is kept in sync whenever the third_party location has been
updated.
Bug: 1056614
Change-Id: Ic48b6cba17fe0a3c6b7d28dd3f74483ceac2969b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2085176
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-03-04 12:07:04 +00:00
Tim van der Lippe
1418552cad
Remove bundled Runtime.js
...
After
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2030781
all entrypoints properly import the Runtime.js. As such, we no longer
need to force-bundle the Runtime in any entrypoint.
Bug: 1046596, 1006759
Change-Id: I0b1d14f3857b4c9511e14f416ddf7774e7d0071b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2031122
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-02-03 13:50:28 +00:00
Brandon Goddard
53faba1c7d
Reland "Add script that checks license headers of JavaScript files"
...
This reverts commit 27f15d113a .
Reason for revert: script is fixed on Windows
Original change's description:
> Revert "Add script that checks license headers of JavaScript files"
>
> This reverts commit 6122ebd2f9 .
>
> Reason for revert: Presubmit fails on windows due to relative
> path comparison with excluded files
>
> Original change's description:
> > Add script that checks license headers of JavaScript files
> >
> > The script checks if the license header is the BSD-3 license header that
> > DevTools is licensed under. It excludes files that have license headers
> > that reference non-Google/non-Chromium authors or are third_party
> > bundles that are checked into a non-third_party folder.
> >
> > Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
> > Reviewed-by: Liviu Rau <liviurau@chromium.org >
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org >
>
> TBR=bmeurer@chromium.org ,aerotwist@chromium.org ,tvanderlippe@chromium.org ,liviurau@chromium.org
>
> Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com >
> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com >
> Commit-Queue: Brandon Goddard <brgoddar@microsoft.com >
TBR=bmeurer@chromium.org ,aerotwist@chromium.org ,lomitch@microsoft.com ,brgoddar@microsoft.com ,tvanderlippe@chromium.org ,liviurau@chromium.org
Change-Id: I191665c8e3fdbee7f3c5c312b5ba00513502e080
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019021
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com >
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com >
2020-01-24 18:16:35 +00:00
Brandon Goddard
27f15d113a
Revert "Add script that checks license headers of JavaScript files"
...
This reverts commit 6122ebd2f9 .
Reason for revert: Presubmit fails on windows due to relative
path comparison with excluded files
Original change's description:
> Add script that checks license headers of JavaScript files
>
> The script checks if the license header is the BSD-3 license header that
> DevTools is licensed under. It excludes files that have license headers
> that reference non-Google/non-Chromium authors or are third_party
> bundles that are checked into a non-third_party folder.
>
> Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
> Reviewed-by: Liviu Rau <liviurau@chromium.org >
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org >
TBR=bmeurer@chromium.org ,aerotwist@chromium.org ,tvanderlippe@chromium.org ,liviurau@chromium.org
Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com >
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com >
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com >
2020-01-24 16:50:05 +00:00
Tim van der Lippe
6122ebd2f9
Add script that checks license headers of JavaScript files
...
The script checks if the license header is the BSD-3 license header that
DevTools is licensed under. It excludes files that have license headers
that reference non-Google/non-Chromium authors or are third_party
bundles that are checked into a non-third_party folder.
Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Liviu Rau <liviurau@chromium.org >
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org >
2020-01-24 11:51:49 +00:00
Tim van der Lippe
4d1ddf7f73
Migrates protocol/ to ESM internally
...
Bug: 1006759
Change-Id: I99743fcf3d33bc1e5a3b729c2c544826e1d8e923
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013156
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-01-23 13:19:20 +00:00
Tim van der Lippe
6d1e03c598
Reland "Migrate accessibility/ to ESM internally"
...
This reverts commit 5a8f4d89e1 .
Reason for revert: Use fix as we did for CSSProperties
Original change's description:
> Revert "Migrate accessibility/ to ESM internally"
>
> This reverts commit 785c6a4f1c .
>
> Reason for revert: Suspected to break "run_type_check.py" on the bot.
> https://ci.chromium.org/p/chromium/builders/try/linux-rel/279842
>
> Original change's description:
> > Migrate accessibility/ to ESM internally
> >
> > Bug: 1006759
> > Change-Id: I9d801349fd73a06d7f72933acfa65b103531a278
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991511
> > Commit-Queue: Paul Lewis <aerotwist@chromium.org >
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
>
> TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org
>
> Change-Id: Ie4fe54b84cf91cd034bfdb21c20b97eaacdb3599
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994960
> Commit-Queue: Simon Zünd <szuend@chromium.org >
> Reviewed-by: Simon Zünd <szuend@chromium.org >
Bug: 1006759
Change-Id: I7e3b3eafd608aa2fa7d05319a9ff0d4947a2dc88
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013148
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-01-22 14:48:24 +00:00
Tim van der Lippe
9293af7230
Migrate sdk/ to ESM internally
...
Bug: 1006759
Change-Id: I2bb0c8eaa4fdc89edd8da2b12d9fd0e08d427174
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003327
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-01-17 15:17:17 +00:00
Rob Paveza
41120592d3
Refactor of the 'copy_all_modules' build step
...
I've sporadically seen the same CreateProcess failure in ninja recently
that we'd been seeing for the GRD script [1]. This failure is related to
the copy_devtools_modules script.
As part of this change I've also corrected some linting errors that I
had made with the previous fix.
[1] The previous fix can be found at
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1992319
Change-Id: Ic9a66160acddfc929fdd43f20572435ceff3724c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1997723
Commit-Queue: Robert Paveza <Rob.Paveza@microsoft.com >
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-01-13 19:07:47 +00:00
Simon Zünd
5a8f4d89e1
Revert "Migrate accessibility/ to ESM internally"
...
This reverts commit 785c6a4f1c .
Reason for revert: Suspected to break "run_type_check.py" on the bot.
https://ci.chromium.org/p/chromium/builders/try/linux-rel/279842
Original change's description:
> Migrate accessibility/ to ESM internally
>
> Bug: 1006759
> Change-Id: I9d801349fd73a06d7f72933acfa65b103531a278
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991511
> Commit-Queue: Paul Lewis <aerotwist@chromium.org >
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org
Change-Id: Ie4fe54b84cf91cd034bfdb21c20b97eaacdb3599
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006759
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994960
Commit-Queue: Simon Zünd <szuend@chromium.org >
Reviewed-by: Simon Zünd <szuend@chromium.org >
2020-01-10 06:01:18 +00:00
Paul Lewis
785c6a4f1c
Migrate accessibility/ to ESM internally
...
Bug: 1006759
Change-Id: I9d801349fd73a06d7f72933acfa65b103531a278
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991511
Commit-Queue: Paul Lewis <aerotwist@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-01-09 17:06:11 +00:00
Rob Paveza
4947355c94
Fix for too-long length of command line in Windows build.
...
Apparently related to the changes to ESM, the Windows build command
line has started to exceed 32kb. This is running into a fault within
ninja in which the call to CreateProcess fails as a result of the
command line being an invalid parameter.
This fix addresses it by dumping the file list into a GN "response
file" which is then fed into the corresponding Python script, as
indicated by the GN docs. See:
https://gn.googlesource.com/gn/+/master/docs/reference.md#var_response_file_contents
Bug: 1040233
Change-Id: Ie421a09d2a23756e9195e3ad84b941187de6e3c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1992319
Reviewed-by: John Emau <John.Emau@microsoft.com >
Reviewed-by: Mike Jackson <mjackson@microsoft.com >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Robert Paveza <Rob.Paveza@microsoft.com >
2020-01-08 22:17:55 +00:00
Tim van der Lippe
0c21af5553
Use module scope for workers
...
This changes the Common.Worker to create Workers that use the module
scope rather than the global scope. It allows us to use es-imports,
which consequently allows us to remove the bundling during the build
step. This should hopefully improve the Ninja non-determinism that we
were facing when making changes to files that are used in the various
workers.
Bug: 1006759
Change-Id: I7ac209817b1576d2accd790f1bf7ef6a658f5605
Fixed: 1013129
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1981615
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-01-08 15:12:05 +00:00
Mathias Bynens
f885d2e6f8
Prefer Brotli over gzip for compressing webui resources
...
This makes resources.pak another 228.1 kB smaller (from 7,070,021
bytes down to 6,841,901 bytes).
Bug: chromium:1025041
Change-Id: I0d45e3b40f5765bcb5c2266750698d33b6adcae2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1964350
Auto-Submit: Mathias Bynens <mathias@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2019-12-12 14:36:14 +00:00