Commit Graph
626 Commits
Author SHA1 Message Date
Yang Guo ef36cec5b9 Apply governance change
DISABLE_THIRD_PARTY_CHECK=no code changes
R=bmeurer@chromium.org

Change-Id: I2477c36f5ef2494ccae3efae3f1aee942f365fec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2489420
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-10-21 07:54:15 +00:00
Kim-Anh Tran ba5e4813da Adding linear memory inspector navigator component
This adds the navigator component of the linear memory inspector
that is used to navigate through an array buffer.

After: https://imgur.com/a/RPELp6P

Bug: chromium:1110202
Change-Id: Id2acd96222ed11de92cd2a1fb5130ea5d79c9ab5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484363
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-10-20 13:41:04 +00:00
Tim van der Lippe 3387bd4064 Move startup files to GN
There previously were two special files that were handled
by `build_release_applications`: root.js and RuntimeInstantiator.js.
Both files are explicitly part of the startup process of DevTools
and its various entrypoints.

To remove the copying from `build_release_applications`, we have
to move these to the relevant `devtools_entrypoint`. Since a
`devtools_entrypoints` bundles all subdirectories, we can't keep
these files in `front_end/` directly. Instead, we move these files
to `startup/` to denote their special-casing in the startup process.

Next to that, we have to fix all usages of these files in the entrypoints.
For all JavaScript entrypoint files, all side-effect legacy files
that are loaded by `startup.js` (previously known as `root.js` and renamed
to prevent confusion with the `root/` module) are removed. All
"additional" legacy files that a particular entrypoint requires are
still loaded as-is.

The RuntimeInstantiator is moved to become an implementation detail
of `startup/`. Therefore, all of the usages that were previously
importing from `RuntimeInstantiator` now import via `startup.js`.

In the end, the special-casing of these files are removed and renamed
for clarity. In the future, we want to remove the complicated
entrypoints startup process, but we are not ready for that yet.
That will require additional cleanups with `resources` in `module.json`
before that change can happen.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I198d5a62d2aab70f842c68d9b4c0871fde1587a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485072
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-20 12:55:34 +00:00
Tim van der Lippe 3c7eedcd60 Remove all definitions of usesObjectNotation
This was a temporary method, used during the migration to use
objects in dispatcher callbacks. Since all dispatchers now receive
the event as an object, we can remove these temporary methods.

R=aerotwist@chromium.org

Fixed: 1138492
Bug: 1011811
Change-Id: Ib7fbfae567ebc9b2be0a5d760458e5b0c7edc12e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484723
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-20 10:59:51 +00:00
Philip Pfaffe 8e8994436d Fix caching in emscripten download script
Change-Id: I14376ad9e9856a28a57ed266fff2a83a1fbeef16
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485082
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-10-20 09:53:30 +00:00
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
Tim van der Lippe d5a0a4c418 Remove rollup_module from build_release_applications
This method is now unused, as all legacy files are copied by GN.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ibf74a1ed7752ffb2c38689af71c754242fce2bd0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484715
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-10-19 16:05:34 +00:00
Tim van der Lippe 150eadfde2 Remove Dispatcher protocol types
These were the old Dispatcher types that were using the exploded
argument method definitions. Since all dispatchers have been
migrated to `ProtocolProxyApi`, we can remove the types from Closure.

R=aerotwist@chromium.org

Bug: 1138492, 1011811
Change-Id: Ic0e19c3e5166d60fbc86d5df9dab28a294e8feba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484721
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-19 16:03:04 +00:00
Philip Pfaffe 3351394f22 Update DEPS and gitignore for building with emscripten
Drive-by: Address post-commit comments from crrev.com/c/2409951

Bug: chromium:1128888
Change-Id: I47a8f0c2deee7db15c574195f45a362c4a6d9fbd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466179
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2020-10-15 08:14:33 +00:00
vidorteg 6d2775c5ef Modifying scripts for i18nString localization call
Modifying some scripts that verify the shape of localization calls
to work with the i18nString shorthand:

const i18nString = i18.i18n.getLocalizedString.bind(undefined, str_);

Bug: 1136655
Change-Id: I09a961136dd89e8af11ab33f413f315e61184078
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2469903
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Christy Chen <chrche@microsoft.com>
2020-10-14 21:12:22 +00:00
Tim van der Lippe 8fa9d45123 Build common-legacy.js with devtools_entrypoint
To continue to move away from `build_release_applications.py`, move
building `common-legacy.js` into `devtools_entrypoint`. In the end,
it will allow us to remove `_rollup_module` from
`build_release_applications.py`.

The logic in `build_release_applications.py` is updated to assume
a pregenerated `-legacy.js` file based on the `pre_generates_legacy`
option in the `module.json` file. Once all `-legacy.js are migrated,
we can remove this option once again.

To make sure that we Rollup properly, we should assume that an
entrypoint in the same folder is regarded as external. Otherwise,
we would rollup the contents of `common.js` into `common-legacy.js`,
which is not what we want.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Idcda3e1c2436a0bebb36501523c8d586d6e86fac
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2450297
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-14 11:42:10 +00:00
Tim van der Lippe 67c4ae8e03 Only include legacy file into _module.js bundle if required
For all `_module.js` files, we currently copy all `modules` into
the `module.json` metadata. However, since then the Runtime got
updated to always load the entrypoint. This is possible, because
in release modes only the entrypoint exists and all other files
are removed.

Therefore, we can use an empty array to denote that solely the
entrypoint should be loaded by the Runtime. If however the module
has a legacy file, the Runtime needs to load that instead. (See
`Runtime._loadModules` for more information) Therefore, include
solely the legacy file to the metadata information in the
`_module.js` to load it.

Eventually, this will allow us to remove the files from the modules
array in the `module.json`, as only Closure would require that
information.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ie14bd55b29b356a39aad7e8ca2041c979bd1b2cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461783
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-14 08:58:50 +00:00
Jack Franklin 102df67838 Fix component bridges tests
A recent TS config change elsewhere had caused these tests not to
compile with the error of:

```
error TS6307: File '/Users/jacktfranklin/src/devtools/devtools-frontend/scripts/component_bridges/value_for_type_node.ts' is not listed within the file list of project '/Users/jacktfranklin/src/devtools/devtools-frontend/test/unittests/scripts/component_bridges/tsconfig.json'.
```

The fix is to mark the dependency from the unit tests as a TS project
reference, and then generate output in the same place as the source, so
that import paths don't need to change.

This isn't ideal, and we would use ts_library if doing this now, but
this code pre-dates ts_library and also is only going to be around for
the length of the TypeScriptification work, so it doesn't feel worth the
effort to restructure it.

Change-Id: I9a924bf3e2ed945dd22ce233eda2c8c15f3193c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466188
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-10-13 10:35:14 +00:00
Christy Chen 5a23b94362 Fixing two localization presubmit issues
1. Don't generate grdp strings if they are in ModuleUIString.js
2. Use path.basename instead of index slicing when getting the directory name for a filepath

Bug: 1136655
Change-Id: I828461a4be2dbeaecd4db76eeb13fce53871d16f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461794
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2020-10-09 17:20:24 +00:00
vidorteg 8bce4b0b83 Enable ModuleUIStrings as a fallback in i18n
Root cause:
i18n is designed to work with strings that are declared in a UIStrings
object on the SAME file where they are being used. To my best knowledge
this is done to improve performance when searching for a translation,
but in Devtools there are strings that live in module.json files and
are exposed to i18n via a ModuleUIStrings.js file.

Fix:
There is already a mechanism for this kind of templating in the i18n
library which exposes a small subset of translations that match a
specific pattern, the fix is to change this pattern to match
ModuleUIStrings and to also include this as part of the translation
resolution.
Change-Id: If44a84a9b5892558bf832e6d08ea36d1a8f4ddd1
Bug: 1136655
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2459638
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-10-09 01:57:37 +00:00
vidorteg ca8fc9b475 Removing check_localizability.js verification
The current behavior enforces that the second argument passed to all
i18n.getLocalizedString is part of UIStrings structure, this is not
possible to enforce in the current shape as a reference is also a valid
scenario

--------  e.g-----------

const title1 = UIStrings.title1;
const title2 = UIStrings.title2;

function render(title) { i18n.getLocalizedString(str, title) }

--------  end e.g-----------

Also minor fix in the naming convention of the file (localizationV2checks)

Change-Id: I9e7536850f7bbb73b2e27f5906343b3b1dbfd82d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2451369
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Christy Chen <chrche@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
2020-10-07 16:46:15 +00:00
Dirk Pranke 75443e831f Python3-related fixes for the devtools build.
This CL addresses a few issues that will help make it possible
to build Chromium using Python 3.

Nothing in this CL should cause any functional changes, and
Python 3 is not required (indeed, won't even work yet), but
this CL will be needed to unblock other work.

See https://crrev.com/c/2333868 for the roll-up Chromium patch,
which also has multiple other dependencies.

Bug: 1112471
Change-Id: Ica8a5b2b24674e1abd267bcd558b7101a6da6fc5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2330718
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
2020-10-03 17:14:03 +00:00
Jack Franklin c1501227b3 Component docs server only lists HTML files
Fix the component docs server to only generate iFrame examples of HTML files,
allowing any helper files (e.g. helper scripts/CSS/imgs/etc) to be placed
alongside the examples without being linked to.

Fixed: 1132846
Change-Id: I9680f001bda4fb2f00eebc275729e66ac62f4189
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2443615
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-02 10:53:00 +00:00
Philip Pfaffe 02376092a3 Download emscripten-releases binaries for building wasm tests
This CL adds a DEPS hook that will download tagged emscripten-releases
binaries from googlestorage that will be used to build wasm debugging
tests.

Bug: chromium:1128888

Change-Id: Ib5d0488fe3fe2c3514faa9f76b07e84c51296c25
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409951
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-09-29 11:28:38 +00:00
Philip Pfaffe f56f06bae0 Delete back_end
Work on the external symbols backend is discontinued, so delete
it from the repo.

Change-Id: Id590f849a98bf8feb1ba31e81912c575ea0aedfb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2429774
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-09-25 13:28:48 +00:00
Jack Franklin e6e1b79912 Ensure that data setters in components take an interface
It's clearer if a component's data setter is defined as:

  set data(data: Foo)

Rather than:

  set data(data: { x: string, y: number, ...})

And also has some advantages in that you can easily re-use the interface if you
define `get data`, and that you can use this type in Closure land if you need
to. So we are now enforcing at the component bridges level that each `set data`
follows this pattern.

This is part of a larger piece of work to ensure efficient DOM updates, because
exposing the interface like this lets us use it in a component's render code to
tell TypeScript how to type `.data=${{...}}` within lit-html.

Bug: 1129881
Change-Id: Ib8bbe5682acfed371d5afccc31727623167b1fdb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422949
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-09-23 15:19:16 +00:00
Jack Franklin 471cd04976 Enforce that .data= calls in LitHtml are typecast
This change helps ensure that we keep some type coverage when using
`.data=${}` calls within LitHtml templates.

Change-Id: I4a6ef0327e6c3250231cb23536085380069596ae
Bug: 1130981
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422951
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-09-23 11:07:54 +00:00
Maksim Sadym 627aff4a25 Roll Puppeteer from v5.2.1 to v5.3.1
DISABLE_THIRD_PARTY_CHECK=updating node_modules deps

What was done:
* updated puppeteer to v5.3.1 in `scripts/deps/manage_node_deps.py`
* run `python scripts/deps/manage_node_deps.py`
* reverted not related changes

Bug: 1130513
Change-Id: I500e46b9f43e7139bce35aafa10d7b891364caa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422954
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
2020-09-22 19:39:57 +00:00
Liviu Rau dfc0200060 Whitespace to trigger builders
tbr: jacktfranklin@chromium.org
Change-Id: If7ceac58cfc82c3df04af5fedfe89c99f563278c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421111
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2020-09-22 13:29:16 +00:00
Tim van der Lippe 3aa84724e0 Remove scripts support from module.json
This removes all references to and declarations of the scripts array
as defined in the module.json files.

R=aerotwist@chromium.org

Fixed: 1105476

Change-Id: I8edcebb5a527c235c606f79283adf5c977a47886
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416513
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-22 11:44:35 +00:00
Yuke Liao 2a275e45bf Make devtools work for non-default toolchains
This CL makes devtools work for non-default toolchains.

Bug: 1129223
Change-Id: I9cc201e1cfc66bbd0d3695543d7f63f5974b66b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2419795
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
2020-09-21 17:12:23 +00:00
Tim van der Lippe 73a80d4976 Move message handling of worker into formatter_worker.ts
Since formatter_worker.ts is the actual entrypoint for the worker,
we should perform the message handling and postMessage invocations
there. This allows us to remove accesses to the `self.postMessage`
global in the implementation of the parsers and formatters, allowing
proper unit testing. Note all `self.postMessage`s have been removed,
as that requires additional refactoring in a follow-up CL.

This also paves the way for removing `formatter_worker_entrypoint`,
which is currently a no-op file. That requires additional infrastructure
changes to `Common.Worker` to allow specify a subfolder of `front_end/`
to be passed as the entrypoint.

Note that this CL also removes the `parseSCSS` method, which appears to
be unused in both the Chromium codebase as well as externally. Testing
on stable shows that we are currently not formatting `.scss` files
anyways.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I808c5ea83efa5ec9fed6bd1aec2418487f553848
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2410232
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-21 16:52:43 +00:00
Jack Franklin 71b08cd277 Fix non-primitive nullable handling in bridges
The generator was making a pointless distinction and using `?X` or
`!X|null` (which are equivalent). Much simpler to always use the `?X`
syntax.

Change-Id: I75ff06369ddff6b0de0883b97f77d60bf96e3903
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421703
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-09-21 15:53:53 +00:00
Tim van der Lippe 6b739ed467 Upgrade TypeScript to 4.1.0-beta
DISABLE_THIRD_PARTY_CHECK=Update TypeScript
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I7ff488de6b844a1503a421399417fd8b32705653
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421689
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-21 12:56:40 +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
Sigurd Schneider 64e7f0648f Reland "Typecheck sdk/SourceMap.js with TypeScript"
This reverts commit dfe3e28145.

Reason for revert: Reland

Original change's description:
> Revert "Typecheck sdk/SourceMap.js with TypeScript"
> 
> This reverts commit c9118a78a3.
> 
> Reason for revert: Layout test update encovered an actual functional change: https://test-results.appspot.com/data/layout_results/linux-rel/401616/blink_web_tests%20%28retry%20shards%20with%20patch%29/layout-test-results/results.html
> 
> Original change's description:
> > Typecheck sdk/SourceMap.js with TypeScript
> > 
> > R=​sigurds@chromium.org,rreverser@google.com
> > 
> > Bug: chromium:1011811, chromium:1079233
> > Change-Id: Ied723f6d952cfe8f40b885f63d36eef6b614ed72
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2215850
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Ingvar Stepanyan <rreverser@google.com>
> > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> 
> TBR=sigurds@chromium.org,tvanderlippe@chromium.org,rreverser@google.com
> 
> Change-Id: I3956a020caf198b9f69459f650248837799d72a1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1011811, chromium:1079233
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2230504
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=sigurds@chromium.org,tvanderlippe@chromium.org,rreverser@google.com

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

Bug: chromium:1011811
Bug: chromium:1079233
Change-Id: I4f58efdfd23f97177526381655ab3834b4164bd2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418435
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-09-19 09:13:20 +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
vidorteg 3e2942e2b8 Removing i18n-bundle.js generation on build time.
This PR removes the i18n-bundle.js bundle generation, instead the file
is generated beforehand and checked in so it can be consumed like any
other module.

Bug: 1127204
Change-Id: I79e8369269d0cd1885d6d9fc2346dddf3af1a5a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2411415
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-09-17 17:07:18 +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
Jack Franklin 4738bc7ad7 Fix typo in component server comment
Kateryna raised this as a very valid nit in the original CL and I completely
missed it before landing!

TBR=kprokopenko@google.com

Change-Id: I1fd70cfe804b28f20a24cbe32ab20dc89567d6b5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2415991
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-09-17 09:06:28 +00:00
Jack Franklin 9d4ecf75c3 Fix loading images in components server
In Devtools-Frontend we load images without a leading slash, e.g.
url(Images/checker.png). This works within devtools, but breaks this
component server as the path ends up as
/component_docs/my_component/Image/checker.png. So we check if the path
ends in Images/*.* and if so, remove anything before it. Then it will be
resolved correctly.

Fixed: 1128914
Change-Id: I476165d16b19713b3c095d5969fac95a5d26a678
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2414190
Reviewed-by: Kateryna Prokopenko <kprokopenko@google.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-09-16 14:23:37 +00:00
Tim van der Lippe 96e056291f Generate HTML entrypoints dynamically
This removes the duplication of the multiple HTML entrypoint files
that were defined. It makes sure that all entrypoints honor the
dark mode styling, as well as the proper no-referrer (there were
some files that had these fixes missing).

R=aerotwist@chromium.org

Change-Id: If5022e46c69050d8a7fd3ea695a644d42f4d822c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2410227
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-15 11:23:52 +00:00
Tim van der Lippe ab0853cf8a Load axe_core_test_runner as module
This requires us to move third_party/axe-core into front_end/third_party,
as we are loading these files in the browser.

DISABLE_THIRD_PARTY_CHECK=Moving source code around
R=aerotwist@chromium.org

Bug: 1105476
Change-Id: I139c53af1a12ad2a7df7381c3d01b0c4e0f72c28
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406159
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-14 12:07:57 +00:00
Alex Rudenko eb8edea670 Extract CSS in the overlay's paused tool
Extracts CSS into a separate file (for now for a single tool to keep
the CL small). I have tried using the prefix to indicate imports
invoking the rollup plugin but it does not work well with eslint
rules requiring imports to start with ../ or ./.

Bug: 1100925
Change-Id: I651b66a2e8ddbc977c87800b5d951b3ef8a81186
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2404648
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-11 13:31:04 +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
Christy Chen 0786ad2f56 [Loc] Avoid unnecessary escodegen calls in presubmit
Only call escodegen.generate() on the nodes that are necessary, or it would impact the performance of presubmit

Bug: 1116989
Change-Id: Ic80c7498aee14b7a4bf6462c26c982b7d6170f39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2405627
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-09-11 08:23:36 +00:00
Peter Marshall 8cebafc1be Add owners for scripts/localization
These have more specific owners than general infra

Change-Id: I8a260db3598b5f2fd1381a07179117ca9fb72ba2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2404649
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-09-11 07:54:16 +00:00
Tim van der Lippe 2b117e76f5 Implement GRD file check for devtools_pre_built
While we implemented this check for `devtools_module` and
`devtools_entrypoint`, we did not do so for `devtools_pre_built`.
This caused build failures yesterday when we forgot to add the
live directive of lit-html in the GRD files.

Therefore, implement the same check for `devtools_pre_built`. This
not only catches the live directive file missing, but also found out
that the imports for Acorn were using the wrong version. We use the
`.mjs` bundles from Acorn, not the `.js` versions.

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

Bug: 1126630
Change-Id: I54004efda6fb0ac50f894262f09fe2104d1b2f86
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2403322
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-10 14:10:43 +00:00
Jack Franklin cfd5020c0c Fix optional params in bridges function types
This fixes a bug where parameters in Closure functions weren't given the
right combo of non-nullable plus optional tokens.

Fixed: 1126338
Change-Id: I2be2db38bec3dbf278a4bff208dc057447c6ed81
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2401016
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-09-10 06:34:18 +00:00
Christy Chen 5fc363ed10 [Loc] Presubmit#3: LocV2 Checking the shape of localization API calls
Checking the shape of localization API calls:
if the node is Common.i18n.getLocalizedString,
1. There should be at least two arguments
2. The first argument should be the string instance function 'str_',
3. The second argument should reference the UIStrings object like 'UIStrings.url'

The code would look like:
i18n.i18n.getLocalizedString(str_, UIStrings.url);

Bug: 941561
Change-Id: I1336867b06dd727f5164e6b1d7ac7ae6ed6ea446
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2245769
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-09-09 16:40:02 +00:00
Christy Chen 138c3a87b6 [Loc] Presubmit#2: prevent using of LocV1 APIs in migrated files
The check will prevent the using of V1 APIs in the files under the directory that we determine as 'migrated', or when UIStrings is declared in a file.
Two way to test
1. add to any .js file that calls ls``
export const UIStrings = {
  /**
  *@description a fake string
  */
  fakeString: 'a fakeString',
};

or

in check_localized_strings.js
Update `const migratedDirsSet = new Set([]);`
To `const migratedDirsSet = new Set(['settings', 'console']);`

2. run check_localizable_resources.js

The check will complain about some some files have APIs need to be migrated

See Loc design doc #Presubmit section for details
https://docs.google.com/document/d/1L6TkT2-42MMQ72ZSBMFwUaq7M6mDgA2X0x8oHHKaV_U/edit#heading=h.w1no7qaa0mi0


Bug: 941561
Change-Id: I4f8fba41ac1dd393fdb399d7e580e9a9ba39143a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2244052
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-09-09 15:55:23 +00:00
Tim van der Lippe 88a5d76f5f Fix auto-unittest compile target
Since the inspector_overlay moved, we also moved the karma.conf.js.
However, `npm run auto-unittest` was not properly building the
karma configuration file, as that was moved into its parent
directory.

R=alexrudenko@chromium.org
CC=aerotwist@chromium.org

Change-Id: Ic74c01632fb28de6afe70e0d8555e79f97bbdb33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2401017
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-09-09 12:01:49 +00:00
Christy Chen 6c5e5870e0 [Loc] Presubmit#1: Check unused resources in UIStrings
This check will detect (and autofix) any string resources that are not used in the code anymore. If a developer deletes a localization call but forgets to delete it from the UIStrings structure, the check will warn/remove it.

Testing steps
1. Add the following to the CoverageView.js right after import statements
export const UIStrings = {
  /**
  *@description Text in Coverage List View of the Coverage tab
  */
  perFunction: 'Per function',
  /**
  *@description Text in Coverage List View of the Coverage tab
  */
  perBlock: 'Per block',
};

2. Change: 
        label: ls`Per function`,
 To the Loc V2 API call:
        label: i18n.i18n.getLocalizedString(str_, UIStrings.perFunction),

3. Change:
        label: ls`Per block`,
 To not use any localization API
        label: "Per block",

4. Run
node check_localizable_resources.js --autofix

The Loc V1 check would remove the two entries from grdp
The Loc V2 check would remove perBlock entry from UIStrings

See Loc design doc #Presubmit section for details
https://docs.google.com/document/d/1L6TkT2-42MMQ72ZSBMFwUaq7M6mDgA2X0x8oHHKaV_U/edit#heading=h.w1no7qaa0mi0




Bug: 941561
Change-Id: Ic5f3ee6e9c1586bb3226593c32bc7af7e49a547a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2236544
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-09-09 08:07:29 +00:00