Commit Graph
38 Commits
Author SHA1 Message Date
Tim van der Lippe 46e1bcace9 Remove pre_generates_legacy from module.json files
This was a temporary flag used during the build_release_applications
to GN migration.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I8a772bcc4bee31dbd3270bf7ef62d8c97941024a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484716
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 16:12:09 +00:00
Jack Franklin ff65e1c046 Migrate emulation/EmulatedDevices.js to TypeScript
Bug: 1011811
Change-Id: I88ce8f52b3ab2ea987bcfb1f658622e16cf21ab3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2474660
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-10-16 10:54:07 +00:00
Tim van der Lippe 8a408c1be4 Move legacy files from core modules to GN
R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ic61ee8b06fc5c6cfbc41682aebbdc232e91e556e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2476333
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-16 10:50:32 +00:00
Alex Rudenko c895058e8c Migrate CommandMenu.js to TypeScript
Bug: 1011811
Change-Id: I17f585bb98fa571e4472410764828dd431943dcc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2453294
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-10-08 07:32:07 +00:00
Tim van der Lippe 79960a9c04 Typecheck sources/UISourceCodeFrame.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I832ef16ba413d096378f6d71f17b8962958f66dd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2450030
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-07 15:15:55 +00:00
Johan Bay c3da003b98 Typecheck quick_open/QuickOpen.js with TypeScript
Bug: 1011811
Change-Id: I2f4c37806c223446527d302115b5a5b07c508961
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2443619
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-02 14:26:40 +00:00
Tim van der Lippe a534527691 Typecheck elements/MarkerDecorator.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: Ide2fb75746ebd5232adbd794f1f55e774c35d078
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2440507
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-10-01 07:21:27 +00:00
Tim van der Lippe 7f2002c598 [globals] self.runtime
Migrate all usages of self.runtime to Root.Runtime.Runtime.instance().

This also requires various type updates, as now Closure/TypeScript
can better understand the code and discover issues.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ice07aa0ca959e61a6acdf4618b9a272d8c1096b8
Fixed: 1081614
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2434339
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-29 10:52:39 +00:00
Tim van der Lippe 2930c64a42 Add singleton-instance lookup to sharedInstance
During the TypeScript migration, we are moving to reference singleton
instances, rather than the `sharedInstance` lookup in the runtime.
However, the sharedInstance wasn't aware of the singletons being
declared in (most notably) the panels. Therefore, it is possible
that developers migrate to the singleton pattern and consequently
cause two panels to be constructed.

To prevent this from happening, we update `sharedInstance` to lookup
the `instance` as declared on the type, if it exists. If it does,
it calls that function. This makes sure that singletons declared
won't break the Runtime/module.json setup that already exists.

For all panels/classes that perform the `sharedInstance` invocation
in their own declared `instance` method, we migrate to singletons
straight away. Otherwise, we end up with a StackOverflow where
both methods call each other.

R=aerotwist@chromium.org

Bug: 1131423, 1011811
Change-Id: Ice7d2f59114b9aaa8ddd8d24f7eefc7aa880ff4e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2428897
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-25 07:29:56 +00:00
Tim van der Lippe 8134d1f706 Cleanup _loadModules in Runtime
Both of these checks are obsolete with the removal of scripts from
the module.json files. To cleanup build_release_applications in the
future to allow us to remove modules from module.json files, we need
to remove these checks.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: If2fb0ad2751eeee569f5340d42d307cd39d4c268
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2426523
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-23 16:26:14 +00:00
Paul Lewis 41ba5ed318 Adds support for loading text resources in Runtime
At the moment the Runtime loading code, fetchResource, assumes the same
root as the hosting module, i.e. if Lighthouse is on devtools/bundled,
it assumes that the loaded resource will also be on devtools/bundled.
This assumption does not hold true for Lighthouse loading its
localization files, which are held on devtools/remote. The Runtime
module currently provides a function for loading a binary resource, and
this CL adds an equivalent function for loading text resources, with the
expectation that modules like Lighthouse can use this to fetch remote
resources.

R=jacktfranklin@chromium.org

Change-Id: I723f8196904d62f3b024e662bfbbdb20742545d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2424190
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-23 10:21:04 +00:00
Changhao Han 0ee96f1137 Clean up legacy set-like objects in Runtime.js
Change-Id: Iea5806d621333fb001ae73dcb212b747babb740b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421695
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-09-22 05:52:04 +00:00
Changhao Han a8ad63fbf7 Enable CSS Grid experiment by default
The original mechanism of enabling/disabling experiments has several
states:
- enabled (set to true in local storage)
- disabled (set to false in local storage, entry removed after refresh
- enabledTransiently (not interested, since it hides the checkbox)
- serverEnabled (not interested because it's from the server)

None of the states serve our needs, so a new state: enabledByDefault
has been added, which will turn on an experiment if user hasn't turned
it off explicitly before.

Also, since when the user turns off an experiment, the entry:
  "experimentName": false
will only remain in the current session, and will be "cleaned up"  when
DevTools refreshes, I've also updated the cleanup logic to avoid
cleaning up enabled-by-default experiments.

Backend CL to update tests: https://crrev.com/c/2418315

Bug: chromium:1047356
Change-Id: I32078b5c8bfd8de7bdd60578c84ba054cec3c05b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416525
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
2020-09-21 14:26:10 +00:00
Tim van der Lippe f5feb1fec6 Reland "Reland "Remove support for remote modules""
This reverts commit 862107080d.

Reason for revert: Chromium build issue fixed.

Original change's description:
> Revert "Reland "Remove support for remote modules""
> 
> This reverts commit b3859e8d65.
> 
> Reason for revert: Breaking roll (https://ci.chromium.org/p/chromium/builders/ci/win-archive-rel/17700)
> 
> Original change's description:
> > Reland "Remove support for remote modules"
> > 
> > This reverts commit d5044ddf05.
> > 
> > Reason for revert: Fixed Chromium debug issue.
> > 
> > Original change's description:
> > > Revert "Remove support for remote modules"
> > > 
> > > This reverts commit 419c91eff6.
> > > 
> > > Reason for revert: Breaks roll https://chromium-review.googlesource.com/c/chromium/src/+/2416805
> > > 
> > > Original change's description:
> > > > Remove support for remote modules
> > > > 
> > > > LightHouse is currently broken in Canary, because of problems with
> > > > the appspot server. This isn't the first occurrence of this problem
> > > > and it becomes increasingly more difficult to figure out why the
> > > > server keeps on breaking. This is combined with a large infrastructure
> > > > cost of supporting remote modules and a confusing debugging experience
> > > > when working with it locally.
> > > > 
> > > > The reason we had remote modules was the fact that these modules are
> > > > too large to be included in the Chromium bundle. In the last months,
> > > > we have made numerous remote modules bundled, by applying minifications
> > > > and optimizations to each module.
> > > > 
> > > > The remaining remote module that we are currently shipping is LightHouse.
> > > > Since the remote appspot server is broken and unlikely to be fixed
> > > > anytime soon, now is the best time to finally resolve the remote
> > > > modules question.
> > > > 
> > > > Therefore, we remove support for remote modules from the `module.json`
> > > > files and `Runtime.js`. Additionally, we update the build system
> > > > to properly generate the required files and load them via ES modules.
> > > > 
> > > > We will be able to perform subsequent cleanups in the Runtime to remove
> > > > more infrastructure related to scripts/remote modules, but given that
> > > > this CL is already quite large we are doing that in a follow-up CL.
> > > > 
> > > > Follow-up action items for the LightHouse folks are to further decrease
> > > > the bundle size for LightHouse. Since we are now loading it via ES
> > > > modules, we can now use ES imports in the `devtools-dt-bundle.js` as
> > > > well. This allows us to remove the copy of the SDK files, as well as
> > > > make use of proper ES exports, rather than the browserified requires.
> > > > 
> > > > R=​aerotwist@chromium.org,yangguo@chromium.org,paulirish@chromium.org
> > > > 
> > > > Fixed: 1128890
> > > > Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
> > > > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> > > > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > > 
> > > TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
> > > 
> > > Change-Id: I9d3da08108a35d7dadeefd526ea9dbd562ad3432
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416519
> > > Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
> > > Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
> > 
> > Change-Id: I26bf0565297c8e167039362b30109d7020bbca56
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418431
> > Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> 
> TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,alexrudenko@chromium.org
> 
> Change-Id: I0ed24d32c9b68bc4cb8026f6fc362540800beeb0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418408
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>

Change-Id: I8718e9d94c384a13fd18261f8f497d32418658fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421690
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-09-21 12:11:10 +00:00
Paul Lewis 862107080d Revert "Reland "Remove support for remote modules""
This reverts commit b3859e8d65.

Reason for revert: Breaking roll (https://ci.chromium.org/p/chromium/builders/ci/win-archive-rel/17700)

Original change's description:
> Reland "Remove support for remote modules"
> 
> This reverts commit d5044ddf05.
> 
> Reason for revert: Fixed Chromium debug issue.
> 
> Original change's description:
> > Revert "Remove support for remote modules"
> > 
> > This reverts commit 419c91eff6.
> > 
> > Reason for revert: Breaks roll https://chromium-review.googlesource.com/c/chromium/src/+/2416805
> > 
> > Original change's description:
> > > Remove support for remote modules
> > > 
> > > LightHouse is currently broken in Canary, because of problems with
> > > the appspot server. This isn't the first occurrence of this problem
> > > and it becomes increasingly more difficult to figure out why the
> > > server keeps on breaking. This is combined with a large infrastructure
> > > cost of supporting remote modules and a confusing debugging experience
> > > when working with it locally.
> > > 
> > > The reason we had remote modules was the fact that these modules are
> > > too large to be included in the Chromium bundle. In the last months,
> > > we have made numerous remote modules bundled, by applying minifications
> > > and optimizations to each module.
> > > 
> > > The remaining remote module that we are currently shipping is LightHouse.
> > > Since the remote appspot server is broken and unlikely to be fixed
> > > anytime soon, now is the best time to finally resolve the remote
> > > modules question.
> > > 
> > > Therefore, we remove support for remote modules from the `module.json`
> > > files and `Runtime.js`. Additionally, we update the build system
> > > to properly generate the required files and load them via ES modules.
> > > 
> > > We will be able to perform subsequent cleanups in the Runtime to remove
> > > more infrastructure related to scripts/remote modules, but given that
> > > this CL is already quite large we are doing that in a follow-up CL.
> > > 
> > > Follow-up action items for the LightHouse folks are to further decrease
> > > the bundle size for LightHouse. Since we are now loading it via ES
> > > modules, we can now use ES imports in the `devtools-dt-bundle.js` as
> > > well. This allows us to remove the copy of the SDK files, as well as
> > > make use of proper ES exports, rather than the browserified requires.
> > > 
> > > R=​aerotwist@chromium.org,yangguo@chromium.org,paulirish@chromium.org
> > > 
> > > Fixed: 1128890
> > > Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
> > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
> > > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> > > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > 
> > TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
> > 
> > Change-Id: I9d3da08108a35d7dadeefd526ea9dbd562ad3432
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416519
> > Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
> > Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
> 
> Change-Id: I26bf0565297c8e167039362b30109d7020bbca56
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418431
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,alexrudenko@chromium.org

Change-Id: I0ed24d32c9b68bc4cb8026f6fc362540800beeb0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418408
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-09-18 21:55:03 +00:00
Tim van der Lippe b3859e8d65 Reland "Remove support for remote modules"
This reverts commit d5044ddf05.

Reason for revert: Fixed Chromium debug issue.

Original change's description:
> Revert "Remove support for remote modules"
> 
> This reverts commit 419c91eff6.
> 
> Reason for revert: Breaks roll https://chromium-review.googlesource.com/c/chromium/src/+/2416805
> 
> Original change's description:
> > Remove support for remote modules
> > 
> > LightHouse is currently broken in Canary, because of problems with
> > the appspot server. This isn't the first occurrence of this problem
> > and it becomes increasingly more difficult to figure out why the
> > server keeps on breaking. This is combined with a large infrastructure
> > cost of supporting remote modules and a confusing debugging experience
> > when working with it locally.
> > 
> > The reason we had remote modules was the fact that these modules are
> > too large to be included in the Chromium bundle. In the last months,
> > we have made numerous remote modules bundled, by applying minifications
> > and optimizations to each module.
> > 
> > The remaining remote module that we are currently shipping is LightHouse.
> > Since the remote appspot server is broken and unlikely to be fixed
> > anytime soon, now is the best time to finally resolve the remote
> > modules question.
> > 
> > Therefore, we remove support for remote modules from the `module.json`
> > files and `Runtime.js`. Additionally, we update the build system
> > to properly generate the required files and load them via ES modules.
> > 
> > We will be able to perform subsequent cleanups in the Runtime to remove
> > more infrastructure related to scripts/remote modules, but given that
> > this CL is already quite large we are doing that in a follow-up CL.
> > 
> > Follow-up action items for the LightHouse folks are to further decrease
> > the bundle size for LightHouse. Since we are now loading it via ES
> > modules, we can now use ES imports in the `devtools-dt-bundle.js` as
> > well. This allows us to remove the copy of the SDK files, as well as
> > make use of proper ES exports, rather than the browserified requires.
> > 
> > R=​aerotwist@chromium.org,yangguo@chromium.org,paulirish@chromium.org
> > 
> > Fixed: 1128890
> > Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> 
> TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
> 
> Change-Id: I9d3da08108a35d7dadeefd526ea9dbd562ad3432
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416519
> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>

Change-Id: I26bf0565297c8e167039362b30109d7020bbca56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418431
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-18 17:50:39 +00:00
Paul Lewis cd831078ae Adds remote base helper
Change-Id: I89ff9c5e30c6acf559955323f8aaaadadc040df4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418441
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-18 15:08:39 +00:00
Alex Rudenko d5044ddf05 Revert "Remove support for remote modules"
This reverts commit 419c91eff6.

Reason for revert: Breaks roll https://chromium-review.googlesource.com/c/chromium/src/+/2416805

Original change's description:
> Remove support for remote modules
> 
> LightHouse is currently broken in Canary, because of problems with
> the appspot server. This isn't the first occurrence of this problem
> and it becomes increasingly more difficult to figure out why the
> server keeps on breaking. This is combined with a large infrastructure
> cost of supporting remote modules and a confusing debugging experience
> when working with it locally.
> 
> The reason we had remote modules was the fact that these modules are
> too large to be included in the Chromium bundle. In the last months,
> we have made numerous remote modules bundled, by applying minifications
> and optimizations to each module.
> 
> The remaining remote module that we are currently shipping is LightHouse.
> Since the remote appspot server is broken and unlikely to be fixed
> anytime soon, now is the best time to finally resolve the remote
> modules question.
> 
> Therefore, we remove support for remote modules from the `module.json`
> files and `Runtime.js`. Additionally, we update the build system
> to properly generate the required files and load them via ES modules.
> 
> We will be able to perform subsequent cleanups in the Runtime to remove
> more infrastructure related to scripts/remote modules, but given that
> this CL is already quite large we are doing that in a follow-up CL.
> 
> Follow-up action items for the LightHouse folks are to further decrease
> the bundle size for LightHouse. Since we are now loading it via ES
> modules, we can now use ES imports in the `devtools-dt-bundle.js` as
> well. This allows us to remove the copy of the SDK files, as well as
> make use of proper ES exports, rather than the browserified requires.
> 
> R=​aerotwist@chromium.org,yangguo@chromium.org,paulirish@chromium.org
> 
> Fixed: 1128890
> Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=yangguo@chromium.org,paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: I9d3da08108a35d7dadeefd526ea9dbd562ad3432
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416519
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-17 16:36:31 +00:00
Tim van der Lippe 419c91eff6 Remove support for remote modules
LightHouse is currently broken in Canary, because of problems with
the appspot server. This isn't the first occurrence of this problem
and it becomes increasingly more difficult to figure out why the
server keeps on breaking. This is combined with a large infrastructure
cost of supporting remote modules and a confusing debugging experience
when working with it locally.

The reason we had remote modules was the fact that these modules are
too large to be included in the Chromium bundle. In the last months,
we have made numerous remote modules bundled, by applying minifications
and optimizations to each module.

The remaining remote module that we are currently shipping is LightHouse.
Since the remote appspot server is broken and unlikely to be fixed
anytime soon, now is the best time to finally resolve the remote
modules question.

Therefore, we remove support for remote modules from the `module.json`
files and `Runtime.js`. Additionally, we update the build system
to properly generate the required files and load them via ES modules.

We will be able to perform subsequent cleanups in the Runtime to remove
more infrastructure related to scripts/remote modules, but given that
this CL is already quite large we are doing that in a follow-up CL.

Follow-up action items for the LightHouse folks are to further decrease
the bundle size for LightHouse. Since we are now loading it via ES
modules, we can now use ES imports in the `devtools-dt-bundle.js` as
well. This allows us to remove the copy of the SDK files, as well as
make use of proper ES exports, rather than the browserified requires.

R=aerotwist@chromium.org,yangguo@chromium.org,paulirish@chromium.org

Fixed: 1128890
Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-17 14:49:58 +00:00
Changhao Han 25f15e6f33 Fix Runtime.instance to return singleton when it exists
The original if condition will always result in the error being thrown
when no moduleDescriptors is passed in. This CL updates the logic to
return runtimeInstance when we have created one.

R=aerotwist@chromium.org

Change-Id: I569407d92abe3da7be2cb3464d243897eb023698
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2415989
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-17 09:36:48 +00:00
Tim van der Lippe 8b068ffba1 Remove initialization of globals in Runtime
We initialize the globals in the `-legacy.js` files and therefore
don't require the additional assignments in the Runtime itself.

R=jacktfranklin@chromium.org

Bug: 1127902
Fixed: 1058320
Change-Id: Id6c13d9f2b9d781bfab73957621324335d394a2b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2410225
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-15 12:08:12 +00:00
Tim van der Lippe 594b592fd9 Remove loadResources from Runtime.js
We include all resources as part of the build process and therefore
we don't have to load these resources separately.

R=jacktfranklin@chromium.org

Bug: 1127902
Change-Id: I9f0377e8517a81dec4110fc6e4850453d94d908c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2410224
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-15 08:23:11 +00:00
Tim van der Lippe c4e2fefe33 Load emulated_devices images from bundle instead of remote
This changes `emulated_devices` to load from bundled, via the
`importScriptPathPrefix` in Runtime, rather than the remoteBase. We
need to load these images from the bundle, rather than remote, for
security and stability reasons.

For the build changes, we need to move the `_module.js` to non-remote,
have to update the GRD to include the files and copy the files to
the correct locations in the `resources/inspector/` and `gen/devtools/`.

All images are compressed with AVIF for the best compression rate, to
keep the impact on the Chromium binary size to a minimum. This CL
increases the bundle size of `resources.pak` by about 100Kb.

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

Fixed: 1095614
Change-Id: If1bdceeda8c00e9981dc229fd7c81022bb6ae6f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2248183
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-11 14:52:54 +00:00
Tim van der Lippe 5df64b2cd4 [globals] self.Runtime.cachedResources
This refactors away the cachedResources from an object map
to a normal Map as defined in `Runtime.js`. The Map is used during
boot time by setting the relevant stylesheet contents, which is
included by `build_release_applications`. Moreover, it moves the
`*_module.js` files into the `modules` array rather than scripts.
This ensures that `*_module.js` files can use ES imports.

In a follow-up CL, we can do additional cleanup in the Runtime
to stop retrieving `resources` in `_loadResources`, as that should
no longer be possible. (In both debug and non-debug we build the
appropriate `_module.js` files)

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

Bug: 1058320

Change-Id: I89602b332360338f5914038f6cd505f75b531f8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2398829
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-11 13:05:54 +00:00
Tim van der Lippe cac65d4fa0 Remove skip_rollup
This was a temporary flag as part of the devtools_entrypoint migration.
Since that migration has concluded, we can now remove all references
to it and clean up `build_release_applications.py`.

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

Bug: 1101738
Change-Id: I3ef9ec1a99bc9fc1758532124db22b3b4b1a5e2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391140
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-08 15:44:09 +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
Simon Zünd 6c6b27983e [ts] Type-check ui/Context.js with TypeScript
R=aerotwist@chromium.org

Bug: chromium:1011811
Change-Id: Ie0566caf6383758a69d756cdb6c7b81d024e46a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2349168
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-12 07:15:46 +00:00
Brandon Goddard 413d17276c Add histograms for Devtools Experiments
This CL introduces 3 histograms around devtools experiments:
ExperimentEnabled - fired when users turn on an experiment
ExperimentDisabled - fired when users disable an experiment
ExperimentEnabledAtLaunch - fires on Devtools launch for each
experiment that is enabled.

These will allow us to gain better understanding of how users
interact with devtools experiments.

Explainer:
https://docs.google.com/document/d/1pcvN11C4onSXqOE0dTjUUHodMj55bRVl_5_e3kMg_rs/edit?ts=5f2329dc#

Corresponding backend CL: https://crrev.com/c/2341215

Bug: 1107636
Change-Id: I4ae72881b6409d25204fea0335f6796161cc61c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2341950
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
2020-08-10 18:13:05 +00:00
Paul Lewis e9817f52a1 Migrates root to devtools_entrypoint
Bug: 1101738
Change-Id: I23ebeefe2c051ea9690c25c15f9a72896f977261
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2306158
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-22 10:04:40 +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
Patrick Brosset e65aaac861 Enable the no-return-assign ESLint rule
This rule disallows assigning a value in a return statement.
It also works in one-liner arrow functions.

For instance, a => a = 2 will trigger a warning.
This is to avoid cases where you actually meant to compare a to 2, not
assign the value 2 (maybe you wanted to return a boolean in a filter
callback).
These sorts of issues can easily pass review and cause weird problems
that are hard to track down later.

The rule is enabled in this CL, and all warnings are fixed with this CL.

More info about the rule: https://eslint.org/docs/rules/no-return-assign

Bug: 1093379
Change-Id: I38b98ea59ecaedc83a7f69073b17980808f9a3bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2242761
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-06-22 08:34:42 +00:00
Connor Clark 5f8ce18be7 Update the fallback revision for remote modules.
This revision is very old, and no longer works for the only usage of
this (Lighthouse)–the name of the remote worker and the interface has
changed.

Example: https://chrome-devtools-frontend.appspot.com/serve_file/@9c7912d3335c02d62f63be2749d84b2d0b788982/lighthouse_worker/lighthouse_worker_module.js

For more, see https://github.com/GoogleChrome/lighthouse/issues/10883

Change-Id: Id569b1809305e30cf3c87b58e99e44852229982d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2225600
Reviewed-by: Paul Irish <paulirish@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Connor Clark <cjamcl@chromium.org>
2020-06-02 22:04:41 +00:00
Jack Lynch f1f00fa32a Add VS Code shortcuts as an option
This CL adds the ability (hidden behind an experiment) for users to
select a set of shortcuts to use, the two options initially being the
default shortcuts and shortcuts that match those from VS Code. A new
`keybindSets` array is added to binding objects in module.jsons,
allowing shortcuts to be filtered on launch much like the existing
platform option. Also like platform, if the keybindSets array is
undefined for a shortcut then that shortcut will be considered common to
all keybindSets.

In general, I left keybindSets undefined for default DevTools shortcuts
that do not conflict with VS Code shortcuts so that they remain common
shortcuts. When both the DevTools and VS Code define the same shortcut,
I add both sets to keybindSets.

This should only affect users who have opted into the custom keyboard
shortcuts experiment. If a user with the experiment enabled selects VS
Code shortcuts and then turns the experiment off, ShortcutRegistry will
reset the shortcuts to the DevTools default on next launch.

Enumerating the differences between VS Code and the DevTools default
shortcuts uncovered some workflows that we'd like to add shortcuts for
that do not currently have actions in the DevTools, such as save as and
find/replace. I plan to add those in future CLs.

Due to problems with ListWidget's accessibility, I have to manually add
aria roles to the list and list items. This is a temporary state of
affairs until this tab is changed to use ListControl rather than
ListWidget for better accessibility. Since the ListWidget here contains
no editable items and is only marked as a list, there are no keyboard
navigation or focus management requirements to worry about yet.

I have put up a telemetry CL here so that we can evaluate the success of
the feature:
https://chromium-review.googlesource.com/c/chromium/src/+/2172132

Screenshots:
  https://i.imgur.com/ka0VEyM.png
  https://i.imgur.com/CG8hAro.png

Custom shortcuts design doc: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit#

Bug: 174309
Change-Id: I0e3484eb2712c945121cc7b68e14a1a98f858bab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095859
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Songtao Xia <soxia@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-05-01 23:48:06 +00:00
Mathias Bynens 5e43b27e8b Reformat module.json files
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.

Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.

Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-14 05:35:23 +00:00
Tim van der Lippe d71c22d7ce Typecheck host/ with TypeScript
Hacks, hacks and hacks. These files were very inconsistent in terms of typing.
They now use the proper FileSystem API's (which ship with Closure, but not
with TypeScript).

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

Bug: 1011811
Change-Id: I46bd59d2f22372157afcdb18871442f51e20e778
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108763
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-03-19 13:14:12 +00:00
Tim van der Lippe 7defff6c1b Typecheck common/Settings.js with TypeScript
We can now also typecheck common.js, as Settings.js was the last file
that required checking.

Bug: 1011811
Change-Id: Ia17644bb439f8295b789169249447a52d65cb1ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107220
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-18 15:52:09 +00:00
Tim van der Lippe db09d1b2bd Typecheck root/ with TypeScript
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I24aaff1e3a6e06e9e992044a1cb81a041dbb296c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107532
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 15:02:49 +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