Reland "Reland "Remove support for remote modules""

This reverts commit 862107080d587e3b4185c6a7d5f7222afc541f6c.

Reason for revert: Chromium build issue fixed.

Original change's description:
> Revert "Reland "Remove support for remote modules""
> 
> This reverts commit b3859e8d65e66b636f7091cf2ffd5c01cc5bc7a3.
> 
> 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 d5044ddf05e65c5c16a75f60b05ecd4105bc05ec.
> > 
> > Reason for revert: Fixed Chromium debug issue.
> > 
> > Original change's description:
> > > Revert "Remove support for remote modules"
> > > 
> > > This reverts commit 419c91eff66647a4a6a16c3b5f558535c5568791.
> > > 
> > > 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=​[email protected],[email protected],[email protected]
> > > > 
> > > > Fixed: 1128890
> > > > Change-Id: Ib4271a8064b18d31b75d9e28dbe5e3cb3c77d7ff
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416511
> > > > Reviewed-by: Paul Lewis <[email protected]>
> > > > Commit-Queue: Tim van der Lippe <[email protected]>
> > > 
> > > [email protected],[email protected],[email protected],[email protected]
> > > 
> > > 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 <[email protected]>
> > > Commit-Queue: Alex Rudenko <[email protected]>
> > 
> > Change-Id: I26bf0565297c8e167039362b30109d7020bbca56
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418431
> > Commit-Queue: Paul Lewis <[email protected]>
> > Reviewed-by: Paul Lewis <[email protected]>
> 
> [email protected],[email protected],[email protected],[email protected],[email protected]
> 
> 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 <[email protected]>
> Commit-Queue: Paul Lewis <[email protected]>

Change-Id: I8718e9d94c384a13fd18261f8f497d32418658fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421690
Commit-Queue: Tim van der Lippe <[email protected]>
Auto-Submit: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/BUILD.gn b/BUILD.gn
index 580ec9b..f905604 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -169,11 +169,6 @@
   "$resources_out_dir/emulated_devices/emulated_devices_module.js",
 ]
 
-generated_remote_modules = [
-  "$resources_out_dir/lighthouse_worker/lighthouse_worker_module.js",
-  "$resources_out_dir/dagre_layout/dagre_layout_module.js",
-]
-
 generated_test_modules = [
   "$resources_out_dir/accessibility_test_runner/accessibility_test_runner_module.js",
   "$resources_out_dir/application_test_runner/application_test_runner_module.js",
@@ -358,8 +353,8 @@
            front_end_devtools_module_entrypoint_sources
   outputs =
       generated_applications_js + generated_non_autostart_non_remote_modules +
-      generated_remote_modules + generated_test_modules +
-      generated_worker_bundles + generated_devtools_module_entrypoint_sources
+      generated_test_modules + generated_worker_bundles +
+      generated_devtools_module_entrypoint_sources
 
   args = devtools_applications + [
            "--input_path",
diff --git a/all_devtools_files.gni b/all_devtools_files.gni
index 46994aa..8475ee7 100644
--- a/all_devtools_files.gni
+++ b/all_devtools_files.gni
@@ -88,8 +88,6 @@
   "front_end/css_overview/cssOverviewSidebarPanel.css",
   "front_end/css_overview/cssOverviewStartView.css",
   "front_end/css_overview/module.json",
-  "front_end/dagre_layout/dagre.js",
-  "front_end/dagre_layout/module.json",
   "front_end/data_grid_test_runner/data_grid_test_runner.js",
   "front_end/data_grid_test_runner/module.json",
   "front_end/data_grid/dataGrid.css",
diff --git a/devtools_grd_files.gni b/devtools_grd_files.gni
index ee83721..0c92869 100644
--- a/devtools_grd_files.gni
+++ b/devtools_grd_files.gni
@@ -229,6 +229,8 @@
   "front_end/lighthouse/lighthouse.js",
   "front_end/lighthouse/lighthouse_module.js",
   "front_end/lighthouse_worker.js",
+  "front_end/lighthouse_worker/LighthouseService.js",
+  "front_end/lighthouse_worker/lighthouse_worker.js",
   "front_end/main/main-legacy.js",
   "front_end/main/main.js",
   "front_end/marked/marked.js",
@@ -311,6 +313,7 @@
   "front_end/theme_support/theme_support.js",
   "front_end/third_party/acorn/acorn.js",
   "front_end/third_party/acorn/package/dist/acorn.mjs",
+  "front_end/third_party/lighthouse/lighthouse-dt-bundle.js",
   "front_end/third_party/lit-html/lit-html.js",
   "front_end/third_party/puppeteer/puppeteer.js",
   "front_end/timeline/timeline-legacy.js",
diff --git a/devtools_module_entrypoints.gni b/devtools_module_entrypoints.gni
index b335d6e..703ef73 100644
--- a/devtools_module_entrypoints.gni
+++ b/devtools_module_entrypoints.gni
@@ -134,6 +134,8 @@
   "$resources_out_dir/layer_viewer/layer_viewer.js",
   "$resources_out_dir/layers/layers.js",
   "$resources_out_dir/lighthouse/lighthouse.js",
+  "$resources_out_dir/lighthouse_worker/LighthouseService.js",
+  "$resources_out_dir/lighthouse_worker/lighthouse_worker.js",
   "$resources_out_dir/main/main.js",
   "$resources_out_dir/marked/marked.js",
   "$resources_out_dir/media/media.js",
@@ -165,6 +167,7 @@
   "$resources_out_dir/text_utils/text_utils.js",
   "$resources_out_dir/theme_support/theme_support.js",
   "$resources_out_dir/third_party/acorn/acorn.js",
+  "$resources_out_dir/third_party/lighthouse/lighthouse-dt-bundle.js",
   "$resources_out_dir/third_party/lit-html/lit-html.js",
   "$resources_out_dir/third_party/puppeteer/puppeteer.js",
   "$resources_out_dir/timeline/timeline.js",
diff --git a/front_end/BUILD.gn b/front_end/BUILD.gn
index ece73c9..abdf43a 100644
--- a/front_end/BUILD.gn
+++ b/front_end/BUILD.gn
@@ -55,6 +55,7 @@
     "layer_viewer:bundle",
     "layers:bundle",
     "lighthouse:bundle",
+    "lighthouse_worker:bundle",
     "main:bundle",
     "media:bundle",
     "mobile_throttling:bundle",
diff --git a/front_end/RuntimeInstantiator.js b/front_end/RuntimeInstantiator.js
index 4890fdd..94d677d 100644
--- a/front_end/RuntimeInstantiator.js
+++ b/front_end/RuntimeInstantiator.js
@@ -79,7 +79,6 @@
   for (let i = 0; i < moduleDescriptors.length; ++i) {
     moduleDescriptors[i].name = configuration[i]['name'];
     moduleDescriptors[i].condition = configuration[i]['condition'];
-    moduleDescriptors[i].remote = configuration[i]['type'] === 'remote';
   }
   self.runtime = RootModule.Runtime.Runtime.instance({forceNew: true, moduleDescriptors});
   if (coreModuleNames) {
diff --git a/front_end/dagre_layout/module.json b/front_end/dagre_layout/module.json
deleted file mode 100644
index 697b86a..0000000
--- a/front_end/dagre_layout/module.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "scripts": [
-    "dagre.js"
-  ],
-  "skip_compilation": [
-    "dagre.js"
-  ]
-}
diff --git a/front_end/devtools_app.json b/front_end/devtools_app.json
index 7fd4841..8e73416 100644
--- a/front_end/devtools_app.json
+++ b/front_end/devtools_app.json
@@ -10,7 +10,6 @@
     { "name": "browser_debugger" },
     { "name": "css_overview" },
     { "name": "cookie_table" },
-    { "name": "dagre_layout", "type": "remote" },
     { "name": "devices" },
     { "name": "elements" },
     { "name": "emulated_devices" },
diff --git a/front_end/lighthouse_worker.js b/front_end/lighthouse_worker.js
index 9e982df..593119b 100644
--- a/front_end/lighthouse_worker.js
+++ b/front_end/lighthouse_worker.js
@@ -5,6 +5,7 @@
 import './RuntimeInstantiator.js';
 import './platform/platform.js';
 import './worker_service/worker_service.js';
+import './lighthouse_worker/lighthouse_worker.js';
 
 import {startWorker} from './RuntimeInstantiator.js';
 
diff --git a/front_end/lighthouse_worker.json b/front_end/lighthouse_worker.json
index 16cb591..8054828 100644
--- a/front_end/lighthouse_worker.json
+++ b/front_end/lighthouse_worker.json
@@ -2,6 +2,6 @@
     "worker": true,
     "modules": [
         { "name": "worker_service", "type": "autostart" },
-        { "name": "lighthouse_worker", "type": "remote" }
+        { "name": "lighthouse_worker", "type": "autostart" }
     ]
 }
diff --git a/front_end/lighthouse_worker/BUILD.gn b/front_end/lighthouse_worker/BUILD.gn
new file mode 100644
index 0000000..eedd424
--- /dev/null
+++ b/front_end/lighthouse_worker/BUILD.gn
@@ -0,0 +1,14 @@
+# Copyright 2020 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("../../scripts/build/ninja/copy.gni")
+
+copy_sources_to_resources("bundle") {
+  sources = [
+    "LighthouseService.js",
+    "lighthouse_worker.js",
+  ]
+
+  deps = [ "../third_party/lighthouse" ]
+}
diff --git a/front_end/lighthouse_worker/LighthouseService.js b/front_end/lighthouse_worker/LighthouseService.js
index ddfec4c..4ed2971 100644
--- a/front_end/lighthouse_worker/LighthouseService.js
+++ b/front_end/lighthouse_worker/LighthouseService.js
@@ -2,6 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+// @ts-nocheck
+// TODO(crbug.com/1011811): Enable TypeScript compiler checks
+
 /**
  * @interface
  */
diff --git a/front_end/lighthouse_worker/lighthouse_worker.js b/front_end/lighthouse_worker/lighthouse_worker.js
new file mode 100644
index 0000000..adf0bea
--- /dev/null
+++ b/front_end/lighthouse_worker/lighthouse_worker.js
@@ -0,0 +1,6 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import './LighthouseService.js';
+import '../third_party/lighthouse/lighthouse-dt-bundle.js';
diff --git a/front_end/lighthouse_worker/module.json b/front_end/lighthouse_worker/module.json
index 38c3b9e..e68f89f 100644
--- a/front_end/lighthouse_worker/module.json
+++ b/front_end/lighthouse_worker/module.json
@@ -9,7 +9,7 @@
       "name": "LighthouseService"
     }
   ],
-  "scripts": [
+  "modules": [
     "LighthouseService.js",
     "../third_party/lighthouse/lighthouse-dt-bundle.js"
   ],
diff --git a/front_end/main/MainImpl.js b/front_end/main/MainImpl.js
index 3b32481..809164b 100644
--- a/front_end/main/MainImpl.js
+++ b/front_end/main/MainImpl.js
@@ -95,9 +95,6 @@
    */
   _gotPreferences(prefs) {
     console.timeStamp('Main._gotPreferences');
-    if (Host.InspectorFrontendHost.isUnderTest(prefs)) {
-      self.runtime.useTestBase();
-    }
     this._createSettings(prefs);
     this._createAppUI();
   }
diff --git a/front_end/root/Runtime.js b/front_end/root/Runtime.js
index 7a2c7ce..186432e 100644
--- a/front_end/root/Runtime.js
+++ b/front_end/root/Runtime.js
@@ -3,7 +3,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-const REMOTE_MODULE_FALLBACK_REVISION = '@9c7912d3335c02d62f63be2749d84b2d0b788982';
 const instanceSymbol = Symbol('instance');
 
 const originalConsole = console;
@@ -12,9 +11,7 @@
 /** @type {!URLSearchParams} */
 const queryParamsObject = new URLSearchParams(location.search);
 
-// The following two variables are initialized all the way at the bottom of this file
-/** @type {?string} */
-let remoteBase;
+// The following variable are initialized all the way at the bottom of this file
 /** @type {string} */
 let importScriptPathPrefix;
 
@@ -214,13 +211,6 @@
     l10nCallback = localizationFunction;
   }
 
-  useTestBase() {
-    remoteBase = 'http://localhost:8000/inspector-sources/';
-    if (Runtime.queryParam('debugFrontend')) {
-      remoteBase += 'debug/';
-    }
-  }
-
   /**
    * @param {string} moduleName
    * @return {!Module}
@@ -469,11 +459,6 @@
      */
     this.condition;
 
-    /**
-     * @type {boolean|undefined}
-     */
-    this.remote;
-
     /** @type {string|null} */
     this.experiment;
   }
@@ -627,7 +612,6 @@
 
     this._pendingLoadPromise = Promise.all(dependencyPromises)
                                    .then(this._loadModules.bind(this))
-                                   .then(this._loadScripts.bind(this))
                                    .then(() => {
                                      this._loadedForTest = true;
                                      return this._loadedForTest;
@@ -666,17 +650,6 @@
   }
 
   /**
-   * @return {!Promise.<void>}
-   */
-  _loadScripts() {
-    if (!this._descriptor.scripts || !this._descriptor.scripts.length) {
-      return Promise.resolve();
-    }
-
-    return loadScriptsPromise(this._descriptor.scripts.map(this._modularizeURL, this), this._remoteBase());
-  }
-
-  /**
    * @param {string} resourceName
    */
   _modularizeURL(resourceName) {
@@ -684,20 +657,12 @@
   }
 
   /**
-   * @return {string|undefined}
-   */
-  _remoteBase() {
-    return !Runtime.queryParam('debugFrontend') && this._descriptor.remote && remoteBase || undefined;
-  }
-
-  /**
    * @param {string} resourceName
    * @return {!Promise.<string>}
    */
   fetchResource(resourceName) {
-    const base = this._remoteBase();
-    const sourceURL = getResourceURL(this._modularizeURL(resourceName), base);
-    return base ? loadResourcePromiseWithFallback(sourceURL) : loadResourcePromise(sourceURL);
+    const sourceURL = getResourceURL(this._modularizeURL(resourceName));
+    return loadResourcePromise(sourceURL);
   }
 
   /**
@@ -1067,79 +1032,6 @@
 }
 
 /**
- * @type {!Object<string,boolean>}
- */
-const loadedScripts = {};
-
-/**
- * @param {!Array.<string>} scriptNames
- * @param {string=} base
- * @return {!Promise.<void>}
- */
-function loadScriptsPromise(scriptNames, base) {
-  /** @type {!Array<!Promise<void>>} */
-  const promises = [];
-  /** @type {!Array<string>} */
-  const urls = [];
-  const sources = new Array(scriptNames.length);
-  let scriptToEval = 0;
-  for (let i = 0; i < scriptNames.length; ++i) {
-    const scriptName = scriptNames[i];
-    const sourceURL = getResourceURL(scriptName, base);
-
-    if (loadedScripts[sourceURL]) {
-      continue;
-    }
-    urls.push(sourceURL);
-    const promise = base ? loadResourcePromiseWithFallback(sourceURL) : loadResourcePromise(sourceURL);
-    promises.push(promise.then(scriptSourceLoaded.bind(null, i), scriptSourceLoaded.bind(null, i, undefined)));
-  }
-  return Promise.all(promises).then(undefined);
-
-  /**
-   * @param {number} scriptNumber
-   * @param {string=} scriptSource
-   */
-  function scriptSourceLoaded(scriptNumber, scriptSource) {
-    sources[scriptNumber] = scriptSource || '';
-    // Eval scripts as fast as possible.
-    while (typeof sources[scriptToEval] !== 'undefined') {
-      evaluateScript(urls[scriptToEval], sources[scriptToEval]);
-      ++scriptToEval;
-    }
-  }
-
-  /**
-   * @param {string} sourceURL
-   * @param {string=} scriptSource
-   */
-  function evaluateScript(sourceURL, scriptSource) {
-    loadedScripts[sourceURL] = true;
-    if (!scriptSource) {
-      // Do not reject, as this is normal in the hosted mode.
-      console.error('Empty response arrived for script \'' + sourceURL + '\'');
-      return;
-    }
-    self.eval(scriptSource + '\n//# sourceURL=' + sourceURL);
-  }
-}
-
-/**
- * @param {string} url
- * @return {!Promise.<string>}
- */
-function loadResourcePromiseWithFallback(url) {
-  return loadResourcePromise(url).catch(err => {
-    const urlWithFallbackVersion = url.replace(/@[0-9a-f]{40}/, REMOTE_MODULE_FALLBACK_REVISION);
-    // TODO(phulce): mark fallbacks in module.json and modify build script instead
-    if (urlWithFallbackVersion === url || !url.includes('lighthouse_worker_module')) {
-      throw err;
-    }
-    return loadResourcePromise(urlWithFallbackVersion);
-  });
-}
-
-/**
  * @param {string} url
  * @return {!Promise.<string>}
  */
@@ -1162,18 +1054,6 @@
   return sourceURL.substring(0, pathIndex) + Runtime.normalizePath(sourceURL.substring(pathIndex));
 }
 
-(function validateRemoteBase() {
-  if (location.href.startsWith('devtools://devtools/bundled/')) {
-    const queryParam = Runtime.queryParam('remoteBase');
-    if (queryParam) {
-      const versionMatch = /\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(queryParam);
-      if (versionMatch) {
-        remoteBase = `${location.origin}/remote/serve_file/${versionMatch[1]}/`;
-      }
-    }
-  }
-})();
-
 (function() {
 const baseUrl = self.location ? self.location.origin + self.location.pathname : '';
 importScriptPathPrefix = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
diff --git a/front_end/third_party/lighthouse/BUILD.gn b/front_end/third_party/lighthouse/BUILD.gn
index a6c9514..cf5af72 100644
--- a/front_end/third_party/lighthouse/BUILD.gn
+++ b/front_end/third_party/lighthouse/BUILD.gn
@@ -3,14 +3,29 @@
 # found in the LICENSE file.
 
 import("../../../all_devtools_files.gni")
-import("../../../scripts/build/ninja/devtools_pre_built.gni")
+import("../../../scripts/build/ninja/copy.gni")
 
-devtools_pre_built("lighthouse") {
-  sources = lighthouse_locale_files + [
-              "lighthouse-tsconfig.json",
-              "report-assets/report.js",
-              "report-assets/report.d.ts",
-              "report-assets/report-generator.js",
-              "report-assets/report-generator.d.ts",
-            ]
+lighthouse_sources = lighthouse_locale_files + [
+                       "lighthouse-tsconfig.json",
+                       "report-assets/report.js",
+                       "report-assets/report.d.ts",
+                       "report-assets/report-generator.js",
+                       "report-assets/report-generator.d.ts",
+                       "lighthouse-dt-bundle.js",
+                       "lighthouse-dt-bundle.d.ts",
+                     ]
+
+group("lighthouse") {
+  public_deps = [
+    ":lighthouse-gen",
+    ":lighthouse-resources",
+  ]
+}
+
+copy_sources_to_resources("lighthouse-resources") {
+  sources = lighthouse_sources
+}
+
+copy_to_gen("lighthouse-gen") {
+  sources = lighthouse_sources
 }
diff --git a/front_end/third_party/lighthouse/lighthouse-dt-bundle.d.ts b/front_end/third_party/lighthouse/lighthouse-dt-bundle.d.ts
new file mode 100644
index 0000000..693da49
--- /dev/null
+++ b/front_end/third_party/lighthouse/lighthouse-dt-bundle.d.ts
@@ -0,0 +1 @@
+export {}
\ No newline at end of file
diff --git a/front_end/third_party/lighthouse/lighthouse-tsconfig.json b/front_end/third_party/lighthouse/lighthouse-tsconfig.json
index e03b09e..d49f037 100644
--- a/front_end/third_party/lighthouse/lighthouse-tsconfig.json
+++ b/front_end/third_party/lighthouse/lighthouse-tsconfig.json
@@ -4,6 +4,7 @@
   },
   "files": [
     "report-assets/report.js",
-    "report-assets/report-generator.js"
+    "report-assets/report-generator.js",
+    "lighthouse-dt-bundle.js"
   ]
 }
\ No newline at end of file
diff --git a/scripts/build/build_release_applications.py b/scripts/build/build_release_applications.py
index c00ef3e..26777f0 100644
--- a/scripts/build/build_release_applications.py
+++ b/scripts/build/build_release_applications.py
@@ -109,7 +109,7 @@
 
     def build_app(self):
         self._build_app_script()
-        for module in filter(lambda desc: (not desc.get('type') or desc.get('type') == 'remote'),
+        for module in filter(lambda desc: (not desc.get('type')),
                              self.descriptors.application.values()):
             self._concatenate_dynamic_module(module['name'])
 
diff --git a/scripts/build/ninja/devtools_pre_built.gni b/scripts/build/ninja/devtools_pre_built.gni
index a80ab35..a41e6d0 100644
--- a/scripts/build/ninja/devtools_pre_built.gni
+++ b/scripts/build/ninja/devtools_pre_built.gni
@@ -11,6 +11,8 @@
 
   copy_to_gen(_copy_to_gen_target_name) {
     sources = invoker.sources
+
+    deps = invoker.deps
   }
 
   copy_sources_to_resources(target_name) {
@@ -30,3 +32,7 @@
         "$_filtered_target_outputs are not listed in all_typescript_module_sources")
   }
 }
+
+set_defaults("devtools_pre_built") {
+  deps = []
+}
diff --git a/scripts/check_gn.js b/scripts/check_gn.js
index 5b6a2b3..317e003 100644
--- a/scripts/check_gn.js
+++ b/scripts/check_gn.js
@@ -34,7 +34,7 @@
     ];
   }
   const text = lines.join('\n');
-  const modules = manifestModules.filter(m => m.type !== 'autostart' && m.type !== 'remote').map(m => m.name);
+  const modules = manifestModules.filter(m => m.type !== 'autostart').map(m => m.name);
 
   const missingModules = modules.filter(m => !text.includes(`${m}/${m}_module.js`));
   if (missingModules.length) {
diff --git a/test/unittests/front_end/root/Runtime_test.ts b/test/unittests/front_end/root/Runtime_test.ts
index 0812d1b..d5d3b6f 100644
--- a/test/unittests/front_end/root/Runtime_test.ts
+++ b/test/unittests/front_end/root/Runtime_test.ts
@@ -21,7 +21,6 @@
         modules: [],
         resources: [],
         condition: undefined,
-        remote: false,
         experiment: null,
       });
     });