Commit Graph
147 Commits
Author SHA1 Message Date
Tim van der Lippe 1164044d4c Migrate test_runner to devtools_entrypoint
This is the very last folder that needed to migrate. As such,
we can now remove all references to `all_devtools_module_sources`
and its corresponding `copy_devtools_modules` infrastructure.

A follow-up change will remove all Rollup logic from
`build_release_applications` as well.

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

Bug: 1101738
Change-Id: Ib706b58d56a76ee367378059aa49b6931b6f6727
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2390630
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-03 09:59:01 +00:00
Tim van der Lippe 19a45dfd55 Remove is_legacy_javascript_entrypoint
This removes the now-obsolete is_legacy_javascript_entrypoint build flag,
which was used as part of the devtools_entrypoint migration.

This uncovered that accessibility was still using devtools_pre_built
and a file was missing from the GRD variable.

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

Fixed: 1101738
Change-Id: Ie1556ccc1d1563c855417de18e896308de0cfe19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2356305
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 12:32:29 +00:00
Tim van der Lippe 662c01bba2 Remove ProtocolProxyApiWorkaround
The upstream issue has been fixed in TypeScript 4 and therefore this workaround
is no longer necessary.

R=sigurds@chromium.org

Change-Id: I4a831566f3a7f7756f8938668c38e5fabe2ca14c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367947
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-21 14:10:19 +00:00
Jack Franklin a6a4ad6fdf Copy devtools_entrypoint sourcemaps into resources
Fixed: 1115876
Change-Id: I9b797acc355129e2f97a94a06001f3bd82b0299b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354091
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-08-18 10:26:28 +00:00
Ian Clelland 2f5d7054bb Don't abort copying multiple files when one matches
Bug: 1115386
Change-Id: Ib9be093c232066a21843acc078189ce0da3bde53
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2351521
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-08-12 10:26:57 +00:00
Paul Lewis 7e3e7bb351 Early exit from copy-file(s).js
Now that we have copy functions that do not create hardlinks in gen, it
shouldn't be necessary to remove the target file before writing. This CL
removes the unlinking and early exits.

Change-Id: I8e099224479458d446977f930065b4c54a3d0ac6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2334972
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-11 11:53:41 +00:00
Paul Lewis 20d9bb09b4 Update copy paths to be absolute
The path wrangling we do for copy-files.js does not work on all builds.
This CL updates the paths to use absolute ones everywhere.

Bug: 1113321
Change-Id: I7d8c3bb500ee4fcff6d4b564c17230bafb6b9b2f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339528
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-08-06 10:11:57 +00:00
Paul Lewis de0d0a288f [TypeScript] Ensure no hardlinks before tsc runs
When TypeScript writes to pre-existing files, it will overwrite the
contents, but it won't create a new file per se. If files in gen/ were
previously created by devtools_pre_built they will be hardlinked to the
original source file, thus any changes tsc makes to the file in gen will
be reflected back to the source. This causes an issue with ninja, since
it believes on the next run that the source file has changed.

This CL updates the behavior of devtools_pre_built such that it no
longer calls gn's copy, but rather a node utility that ensures that
there is a freshly minted copy of the file rather than a hardlink.

Change-Id: I11a23fce764101eb237e434a64159223ef8d700e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335277
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-08-04 08:36:03 +00:00
Paul Lewis 2828f7640e Unlinks files for devtools_entrypoint
Inside of devtools_entrypoint we use gn's copy command. This generates
hardlinks, which can sometimes mean that incremental builds get into a
broken state. This CL changes those copy commands over to being node
actions that ensure the files are copied rather than hardlinked, and it
also unlinks files before writing them (if they exist) to prevent the
case where hardlinked files are overwritten.

R=jacktfranklin@chromium.org

Change-Id: I86a1f351780afc3ac725c690866b4ac9dd649fd1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335056
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-08-03 12:51:08 +00:00
Jack Franklin 4e556fa817 Copy sourcemaps into resources/inspector in is_debug mode.
This introduces the change that was reverted in https://crrev.com/c/2310810,
with the fix for the revert issue.

DISABLE_THIRD_PARTY_CHECK=ts library change

Change-Id: Ibf4e6e6167b8fce56c83afa7319389fa5520db38
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2325215
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-29 15:36:14 +00:00
Jan Scheffler f3277b2ec7 Add _sources suffix to ensure sorting in .gni files
This cl adds a _sources suffix to make sure files are sorted in
all_devtools_modules.gni and devtools_module_entrypoints.gni
[see: https://gn.googlesource.com/gn/+/master/src/gn/command_format.cc#386]


Change-Id: I21962895f7b72f1052c89b30cefdc843f7b36624
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318263
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-07-28 11:53:11 +00:00
Jack Franklin 7a25be0377 Make cross-reference script show errors
I had a bad gn file and running the cross-reference script didn't show
that but instead treated it as if gn knew of no dependencies and
therefore gave me a huge output of JS files that were not declared as gn
deps.

If the script gets an error, it should bail and log that error rather
than treat it as if there were no gn deps found.

Change-Id: I5672e97581659836adbf2fc1aa4fc5f837b78835
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317308
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-28 08:54:01 +00:00
Jack Franklin 15a98cd148 Use local tsc for cross-referencing script.
So that we don't depend on people having TypeScript installed globally.

Change-Id: Iaaf0a5c1c28fe5775bc58a67289906df4391db84
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316069
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-23 15:55:18 +00:00
Paul Lewis 2f7079da66 Adds more cases for TS/GN cross-reference
TBR=jacktfranklin@chromium.org

Change-Id: Ib80f21e3410179e305b8fe7433658738144a03af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316064
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-23 13:46:58 +00:00
Paul Lewis a1448c2f77 Adds cross reference script
It is possible for TypeScript to import a file that is not included in
the corresponding devtools_entrypoint as a dependency. In many cases
this would likely cause the build to fail, but it's also possible that a
dependency might have been provided as a dep of another entrypoint.
Given that ninja parallelizes builds this results in a race condition
where on some builds the dependency that wasn't declared is there, and
on some builds it is not. This is further complicated if build artifacts
from previous builds are kept around.

This CL introduces a script that can be run manually that cross
references the files that GN knows about, and the files that TypeScript
expects to be able to import. Any files expected by the TypeScript
compiler that are not declared in the BUILD.gn (even indirectly as a
dep of a dep etc) will be flagged.

Change-Id: Ieb95600f11bfc20e0e71d8792a7f344b13a0fb8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316063
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-23 13:15:28 +00:00
Simon Zünd 94beb690c0 Use 'forward_variables_from' in 'devtools_module'
This CL changes 'devtools_module' to use the standard way of
copying properties from the invoker. Not all devtools_module will
provide 'deps'. The current code assumes its always there, so modules
have to provide an empty deps list, otherwise we get build errors.

R=jacktfranklin@chromium.org

Change-Id: I49fd82ab1e54816c02fb99eccb70287d845b8233
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2310457
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-07-22 13:23:30 +00:00
Brandon Goddard 55b591c650 Revert "Copy sourcemaps over in is_debug mode"
This reverts commit 9702c2c5dc.

Reason for revert: On Windows, this is failing to gn gen with is_debug = true with the following error: https://imgur.com/g3g4ADu

I bet the issue could be the source maps being copied over with fwd slash instead of os specific path separators


Original change's description:
> Copy sourcemaps over in is_debug mode
>
> DISABLE_THIRD_PARTY_CHECK=typescript library change
>
> Change-Id: I993b8a3c742cc7feea1ae1dee250aad7469eb22b
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302069
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

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

Change-Id: I0e4c1b308beee837f6be1b2e642350656fb284d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2310810
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-07-21 19:03:55 +00:00
Jack Franklin 9702c2c5dc Copy sourcemaps over in is_debug mode
DISABLE_THIRD_PARTY_CHECK=typescript library change

Change-Id: I993b8a3c742cc7feea1ae1dee250aad7469eb22b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302069
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-21 15:12:12 +00:00
Paul Lewis 1434e6f967 Changes ninja hardlink copy for file copy
The internal ninja copy action is, for Linux and Mac, the creation of a
hardlink. In the case of an is_debug = false build, we copy the
devtools_entrypoint file with ninja to the gen folder. However, should
the file then change in the gen folder, those changes will be reflected
back in the original source file since the two are hardlinked. This does
happen when the JavaScript file moves to being managed by the TypeScript
compiler, for example, because tsc often changes blank lines and adds
sourcemap information to the file. If the gen folder is empty and no
hardlink exists prior to build, there are no issues. If, on the other
hand, the hardlink exists, and the TypeScript compiler runs, the file
written in the gen folder will update, and then so will its original
source.

The ways to resolve this reflection back to the source folder is either
by deleting the gen folder before rebuilding (where one anticipates
changes being reflected in source), or, instead of using the ninja copy,
using an action to call out to a script that will ensure that a new file
is created and not hardlinked.

This CL chooses the latter path.

Change-Id: Id2cc8acdc240eb73ac736ddaf6f1eabdd08f8359
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308534
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-21 14:34:02 +00:00
Simon Zünd 868adc06e7 Don't add sourceURL comments to HTML and Markdown files
Served resources automatically have a 'sourceURL' comment appended
to their content. This CL omits the sourceURL comment for HTML and
Markdown files and keeps Runtime.js in sync with a build script.

R=tvanderlippe@chromium.org

Bug: chromium:1099162
Change-Id: Iee11fd8f620bf736dcd7c4d1bf60e0c1ee49ea4a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302594
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-17 12:22:14 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Paul Lewis 1213aa4256 Asserts that all devtools_module files are listed in all_typescript_modules
Bug: 1105861
Change-Id: I1e23ec3912ce4e8c591033d3f5223ec52e5c430c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302075
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 15:41:41 +00:00
Paul Lewis cb26e04da6 Asserts that each entrypoint is listed in devtools_module_entrypoints
Bug: 1105861
Change-Id: Ie62b2d5ac043baeff0f4e885508b23e201efcb4d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302074
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 15:36:21 +00:00
Tim van der Lippe ced0044c7c Make devtools_module only visible to same-file targets
This prevents other targets to depend on a `devtools_module` where
they should have depended on the `devtools_entrypoint` instead.

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

Change-Id: Id92b1871a805c30ed9b45a448ce3181adf7f7da9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302073
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-16 15:08:01 +00:00
Tim van der Lippe fade2847b8 Add documentation for the usage of devtools_{entrypoint,module,pre_built}
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Id20494d6524c5fc108dee8da26991a7458fab736
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300113
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 12:31:51 +00:00
Jack Franklin 187489319e Reland "Ship new ElementsBreadcrumbs to production"
This reverts commit 8794ac6b44.

Reason for revert: Fixed issue with missing file that caused browser tests to fail.

Original change's description:
> Revert "Ship new ElementsBreadcrumbs to production"
>
> This reverts commit d8d96d5f0a.
>
> Reason for revert: Breaks browser_tests: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8874686472852976032/+/steps/browser_tests/0/logs/Deterministic_failure:_SitePerProcessDevToolsSanityTest.InspectElement__status_FAILURE_/0
>
> Confirmed locally on a Linux Debug build that this is the offending CL.
>
> Original change's description:
> > Ship new ElementsBreadcrumbs to production
> >
> > This CL ships the new elements breadcrumbs component to production,
> > replacing the old legacy breadcrumbs with the new custom element that
> > we've built to replace it.
> >
> > Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
> > keep the diff on this CL clear and easy to follow. I plan to follow this up
> > with another CL that does the renaming.
> >
> > Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY
> >
> > Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
> > Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
>
> TBR=aerotwist@chromium.org,tvanderlippe@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: I62be4e9e3bd1fc328733ded3fff377ffd50e2d81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300491
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

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


Change-Id: Iae6aa0ce84a57312a29d79344059f887f337c5bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300494
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-16 10:21:51 +00:00
Simon Zünd 8794ac6b44 Revert "Ship new ElementsBreadcrumbs to production"
This reverts commit d8d96d5f0a.

Reason for revert: Breaks browser_tests: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8874686472852976032/+/steps/browser_tests/0/logs/Deterministic_failure:_SitePerProcessDevToolsSanityTest.InspectElement__status_FAILURE_/0

Confirmed locally on a Linux Debug build that this is the offending CL.

Original change's description:
> Ship new ElementsBreadcrumbs to production
> 
> This CL ships the new elements breadcrumbs component to production,
> replacing the old legacy breadcrumbs with the new custom element that
> we've built to replace it.
> 
> Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
> keep the diff on this CL clear and easy to follow. I plan to follow this up
> with another CL that does the renaming.
> 
> Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY
> 
> Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

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

Change-Id: I62be4e9e3bd1fc328733ded3fff377ffd50e2d81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300491
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-07-16 07:14:53 +00:00
Jack Franklin d8d96d5f0a Ship new ElementsBreadcrumbs to production
This CL ships the new elements breadcrumbs component to production,
replacing the old legacy breadcrumbs with the new custom element that
we've built to replace it.

Note that I haven't renamed the file from `NewElementsBreadcrumbs`. I wanted to
keep the diff on this CL clear and easy to follow. I plan to follow this up
with another CL that does the renaming.

Light mode & dark mode screenshots: https://imgur.com/a/UyF4ktY

Change-Id: I5c3df09456101ce03072f3eeb27f6a1c568cf9c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297395
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-15 15:15:15 +00:00
Tim van der Lippe 91128ac2ba Move embedder-scripts to front_end/BUILD.gn
These files are part of `front_end/` and therefore should be built
in that directory.

R=aerotwist@chromium.org

Change-Id: I295a34eafd39f87a64b930dd11738c83db3d4f9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300102
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-15 14:29:45 +00:00
Tim van der Lippe 6ec6dea4ea Fix elements buildgn
This allows us to cleanup the check_gn.js script as well, as we
can now always use `skip_rollup` as leading example, rather than
custom exempted folders.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: I5dca1a79a188857e3ee2e0640dc19b46d337be70
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297392
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-14 15:03:46 +00:00
Tim van der Lippe 312069a404 Introduce devtools_pre_built
This template makes sure that the sources are copied both to gen
and the resources/inspector folder

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

Bug: 1101738
Change-Id: Ic6b9c52845abafad45cacf76565c7c3721ec3935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2297479
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-14 13:37:56 +00:00
Tim van der Lippe 2957dc8af0 Move data_deps to front_end
Since `devtools_{entrypoint,module}` now properly use the data_deps
to move data over to isolates on CQ, we can move these back into
the proper location of `front_end/BUILD.gn`

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: I858d863471df549e6b19b23ab41b1ff4d189e40c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2295861
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-14 13:07:26 +00:00
Tim van der Lippe 52c8c76899 TypeCheck formatter_worker/FormatterWorker.js with TypeScript
Required changes:
- Add CodeMirror types as globals
- Add support for `is_web_worker` in `ts_library` and
`devtools_module`, as the FormatterWorker is a worker. This
also moves the `lib` specification out of `tsconfig.base.json`,
as we now need to dynamically generate it
- Fix (seemingly unrelated) issues with untyped events in other
files. I don't understand why TSC suddenly started to complain
about these.

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

Bug: 1098730
Change-Id: I7d33c22983f2fe5e793c20fa5d56411d996ec999
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2294985
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-14 10:07:30 +00:00
Tim van der Lippe f377647886 Fix data_deps for devtools_{module,entrypoint}
This moves `front_end/formatter_worker:bundle` out of the `data_deps`
of `devtools_all_files`. Instead, it uses `data_deps` of the eventual
`devtools_entrypoint` definition, which is a `copy_gen_to_resources`
action.

Change-Id: Ic0252c22928f7d574be753e7fba57c6f7d34ef6f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2292283
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-14 09:56:20 +00:00
Jack Franklin 4bf640308b Create {copy_sources,copy_gen}_to_resources gni helpers
Sometimes in devtools we want to take a file directly from sources into
the `resources/inspector` folder, and other times we want to move files
from `out/Default/gen` into `resources/inspector`. Rather than have one
command for both of these and do nasty path wrangling to put the files
in exactly the right place, we instead split them into two templates.

This is nasty but our hope is we can hide this complexity behind other
templates that most people will use; this shouldn't be used directly by
people very often.

Change-Id: I3e7acbbed0c6d1bb8ad69a62cbe7341ad856d98b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287517
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-13 09:01:49 +00:00
Tim van der Lippe 3c9765775e Migrate front_end/sdk/ to devtools_{module,entrypoint}
This also adds support to devtools_entrypoint for specifying a
legacy `ts_library` that is running on a `JavaScript` file. The
field `is_legacy_javascript_entrypoint` must be assigned an
array of strings that are references to CRBugs that fix them.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: If0935e9446a71de30c27521e9b2b6da1cfdd4469
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284841
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-10 12:46:49 +00:00
Tim van der Lippe c33de4fd55 Add support for skip_rollup in module.json
For folders that already have a `devtools_entrypoint` target, we
should skip Rollup as part of `build_release_applications.py`. To
remove the hardcoded list of skipped folders and enable
parallelization of a fixit to migrate all folders, we have to put
the information in the `module.json` instead.

Once all folders are migrated to `devtools_entrypoint`, we can remove
the field and the Rollup logic in `build_release_applications.py`.

R=aerotwist@chromium.org

Bug: 1101738
Change-Id: Ibadab13e87cf28622c40896a56f6ed18cc34bea2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284838
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-10 08:49:48 +00:00
Paul Lewis 8bf8ca6dc7 Fix tsconfig generation paths
The logic for generation of tsconfig files in devtools_entrypoint made
some assumptions about the locations of other targets. This CL updates
the logic to be more robust with respect to paths.

R=tvanderlippe@chromium.org

Bug: 1011811
Change-Id: I211d607df61d35a2e025e9ca4b049b316b37a364
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282818
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-07 10:29:32 +00:00
Tim van der Lippe 98a014f2e1 Migrate IdentityFormatter to TypeScript
This introduces the first TypeScript-authored file that also makes
use of TypeScript features. To do so, we have to perform several steps:

1. Move the `formatter_worker` typescript files into a new template called
`devtools_module`. This template takes care of running TypeScript and
copying the files it generates to `resources/inspector`. (The latter can
be removed when we are in a position to do so)
2. Move the files out of `all_devtools_modules` into (yet another) GN variable.
We should clean this up by using the `grd_file_group`, which is possible
with an integration with `devtools_module`. However, for simplicity's sake
I decided to fix that in a follow-up. The integration of `devtools_module`
with the GRD action script would then finally allow us to remove the duplication
of all of these file strings in multiple places.
3. To make sure that the buildgraph remains intact, we have to perform
the copy-step after the typescript-step. However, this means we need to use
a different name than `target_name` for the typescript compilation. We run
into issues there, as the project references assume that the names are the
full folder names (e.g. `../formatter_worker`). If we would then use a different
name for the `ts_library` action, then we generate a `tsconfig.json` with
the wrong name. To counteract that, introduce a (temporary)
`typescript_config_name` where we can explicitly set the name of the `tsconfig.json`
that we generate. This is not ideal and I am still thinking of a better
alternative, but haven't figured out a solution yet.

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

Bug: 1098730
Change-Id: I1457067845cdedbc7d4ce6a80c12d7943b67087c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282809
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 10:28:17 +00:00
Tim van der Lippe e67c959ee1 Extract copy to resources into separate template
We will use this template later in a different `devtools_module` template.
It also clearly documents how the remapping works to `resources/inspector`.

Ideally, we will remove this copy-step altogether, but since not all
files for DevTools live in `gen/`, we can't make that change yet. But now
we have a central place where we do the copying, so hopefully it is easier
to remove that once we are there.

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

Bug: 1098730
Change-Id: I3981c97f99b3e3309ebe6ea0f4ec05fb0340835a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282808
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 09:22:52 +00:00
Tim van der Lippe 62283b083c Fix dependency chain for copy-pasting of declaration file
After Rollup is finished, we need to copy the declaration file
from the pre-existing TypeScript task. However, we weren't including
the TypeScript task in the dependency chain of the copy-paste action.

TBR=aerotwist@chromium.org

Bug: 1098730, 1101738, 1061037
Change-Id: Ie5ff77ebb0b58fa42bd1127b8a282b1ef863a80c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282810
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-06 17:26:01 +00:00
Tim van der Lippe ea5df6afa1 Move copy_to_gen into build/ninja
Also rename it to `copy.gni`, since I will be adding a separate
`copy_to_resources` template that copies the content to
`resources/inspector/`.

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

Bug: 1098730
Change-Id: If4266a9f701ac591614125442b4986d4fe38aafe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2278476
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-06 15:59:51 +00:00
Tim van der Lippe 844f83ba74 Generate tsconfig in both debug and release build
Previously, we were generating the tsconfig only in release builds.
However, debug builds require the same treatment. Therefore,
refactor `devtools_entrypoint` to generate the tsconfig in both
cases.

We need to separate out the copying of the declaration file, as that
still only happens when we run Rollup in a release build.

This is a temporary fix to unbreak master and the inclusion of the
first custom element. We will clean up this logic in a follow-up CL.

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

Bug: 1098730, 1101738, 1061037
Change-Id: I231d87b6788b76c88028a80c27dd742e04dc70de
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282518
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-06 14:19:51 +00:00
Tim van der Lippe 4bb269783e Fix generated tsconfig in devtools_entrypoint
Before this change, we would incorrectly rename the generated tsconfig
as the second step of the devtools_entrypoint template. This would
then make TypeScript upset, as it was not able to find the built
Rollup bundle in release mode.

To fix that issue, we have to generate a custom `tsconfig.json`
(very much alike what we do for the third_party packages) and make
sure that the entrypoint has a corresponding `.d.ts` file as well.

CC=jacktfranklin@chromium.org

Bug: 1098730, 1101738, 1061037
Change-Id: I25e79e6c9d28377a752212c7380627d1c32ebb97
Also-By: aerotwist@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279845
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-06 11:36:57 +00:00
Tim van der Lippe 5095a02a94 Use devtools_entrypoint for elements/
This allows us to introduce the bridges files as imports into elements/
which uses Rollup and terser. This makes sure the minifier will not
mangle away the HTML template tags, as well as properly minify the
content of the TypeScript implementations of a custom element.

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

Bug: 1011811, 1061037, 1101738
Change-Id: Iaa1318c20f6d37c5aad97955f48ac16dacef246d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2277994
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-03 10:17:08 +00:00
Tim van der Lippe 28d76057f3 Fix dependencies for Rollup action in devtools_entrypoint
When a file change was made to a file that was bundled in Rollup,
it would not properly retrigger the Rollup action. That can be
fixed by explicitly adding the `invoker.deps` to the Rollup action.

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

Also-By: aerotwist@chromium.org
Bug: 1098730
Change-Id: Ic52e2ba7bb9c998b1444b2b5b65bdd4aff767e96
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279832
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-02 17:12:30 +00:00
Tim van der Lippe 60421845f4 Implement devtools_entrypoint
Port formatter_worker to use devtools_entrypoint, which is the abstraction
around `rollup`. It handles the creation of the rollup bundle, but leaves
it alone if you are building with `is_debug=true`. This way, we can keep
development use the existing workflow where individual files are fetched,
while in release mode we bundle the entrypoint into 1 big file.

In the future, anything we consider an entrypoint must use this method.
This would include third_party packages like lit-html and CodeMirror.
A follow-up CL will move the lit-html entrypoint back into
third_party/lit-html, as we no longer require it to be a direct subfolder
of `front_end/` (that was fixed in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2270168)

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

Bug: 1098730
Change-Id: I5d2e67cc9c71291e8b67bbc29354e75239aae9a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2267001
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-02 10:08:19 +00:00
Tim van der Lippe 9f3b52b677 Extract external module computation into rollup.config.js
This allows us to remove the pre-computation of the external modules
from the Python script, into the Rollup module. This is a necessary
change for the future, where we can define an entrypoint in any
location. This could be in a folder which is not a direct
sub-folder of `front_end`.

To do so, we operate on the assumption that the directory that the
input file is in, is the entrypoint. If you resolve an import that
is in that directory or in a subdirectory, we treat it as internal.
If it is outside of that folder, we treat it as external.

This largely mimics the implementation of the ESLint rule for
ES modules.

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

Also-By: janscheffler@chromium.org
Also-By: alexrudenko@chromium.org
Bug: 1098730
Change-Id: I416b4c9cd9997b9fc2a50aea41077c41fea59af0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2270168
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-01 12:08:59 +00:00
Tim van der Lippe 2a908b9501 Run terser minifier as part of rollup_entrypoint
We are not running the minifier as part of build_release_applications.py,
as the build performance would be significantly worse. We don't pay that
high of a price with `rollup_entrypoint`, as Ninja will not rebuild if
it is not necessary.

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

Fixed: 1084578
Change-Id: Id18fb826aef33c9efddfe390a62eec69485c6295
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2256989
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-01 12:00:39 +00:00
Tim van der Lippe 14cfc426ea Fix rollup inputs for restat computation
A Rollup action takes an entrypoint as input. However, we did not
specify this input explicitly in GN. This could then lead to
non-deterministic build failures, if a subsequent change to a
target using the `rollup_entrypoint` template would trigger a build.

To make sure that GN understands that the entrypoint is an input,
we have to add it to the `inputs` array of the target.

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

Bug: 1011811
Change-Id: Idf03693575f68ea8fe06a2df10f895c4416bfe5c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2276265
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-01 11:28:29 +00:00