Skip to content

Commit

Permalink
overhaul dirac changes to fight typescript hell
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Nov 1, 2020
1 parent 452cf94 commit a8be8e7
Show file tree
Hide file tree
Showing 42 changed files with 2,583 additions and 2,821 deletions.
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ generated_non_autostart_non_remote_modules = [
"$resources_out_dir/timeline_model/timeline_model_module.js",
"$resources_out_dir/timeline/timeline_module.js",
"$resources_out_dir/web_audio/web_audio_module.js",
"$resources_out_dir/dirac_lazy/dirac_lazy_module.js",
"$resources_out_dir/webauthn/webauthn_module.js",
"$resources_out_dir/workspace_diff/workspace_diff_module.js",
"$resources_out_dir/emulated_devices/emulated_devices_module.js",
Expand Down
11 changes: 3 additions & 8 deletions all_devtools_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ all_devtools_files = [
"front_end/console/dirac-codemirror.css",
"front_end/console/dirac-theme.css",
"front_end/console/dirac-prompt.css",
"front_end/dirac/module.json",
"front_end/dirac/parinfer.js",
"front_end/dirac/parinfer-codemirror.js",
"front_end/dirac/keysim.js",
"front_end/dirac/dirac.js",
"front_end/dirac/require-implant.js",
"front_end/dirac_lazy/module.json",
"front_end/dirac_lazy/dirac_lazy.js",
# dirac - end
"front_end/shell.js",
"front_end/accessibility_test_runner/accessibility_test_runner.js",
Expand Down Expand Up @@ -111,6 +103,9 @@ all_devtools_files = [
"front_end/device_mode_test_runner/module.json",
"front_end/devices/module.json",
"front_end/diff/module.json",
# dirac start
"front_end/dirac/module.json",
# dirac end
"front_end/dom_extension/module.json",
"front_end/elements_test_runner/elements_test_runner.js",
"front_end/elements_test_runner/EditDOMTestRunner.js",
Expand Down
18 changes: 10 additions & 8 deletions all_devtools_modules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import("./scripts/build/ninja/vars.gni")
generated_typescript_modules = []

all_typescript_module_sources = [
# dirac - start
# "dirac/parinfer.js",
# "dirac/parinfer-codemirror.js",
# "dirac/keysim.js",
"third_party/codemirror/package/addon/runmode/runmode.js",
"third_party/codemirror/package/addon/display/placeholder.js",
"console/ConsoleDiracPrompt.js",
# dirac - end
"accessibility/ARIAAttributesView.js",
"accessibility/ARIAMetadata.js",
"accessibility/AXBreadcrumbsPane.js",
Expand Down Expand Up @@ -129,6 +121,16 @@ all_typescript_module_sources = [
"devices/DevicesView.js",
"diff/DiffWrapper.js",
"diff/diff_match_patch.js",
# dirac - start
"dirac/dirac.js",
"dirac/DiracAngel.js",
"dirac/parinfer.js",
"dirac/parinfer-codemirror.js",
"dirac/keysim.js",
"third_party/codemirror/package/addon/runmode/runmode.js",
"third_party/codemirror/package/addon/display/placeholder.js",
"console/ConsoleDiracPrompt.js",
# dirac - end
"dom_extension/DOMExtension.js",
"elements/Adorner.js",
"elements/CSSAngle.js",
Expand Down
17 changes: 10 additions & 7 deletions devtools_grd_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
# are missed from the GRD.

grd_files_release_sources = [
# dirac - start
# "front_end/dirac/dirac.js",
# "front_end/dirac/parinfer.js",
# "front_end/dirac/parinfer-codemirror.js",
# "front_end/dirac/keysim.js",
# "front_end/dirac_lazy/dirac_lazy_module.js",
# dirac - end
"front_end/Images/accelerometer-back.svg",
"front_end/Images/accelerometer-bottom.png",
"front_end/Images/accelerometer-front.svg",
Expand Down Expand Up @@ -142,6 +135,7 @@ grd_files_release_sources = [
"front_end/diff/diff-legacy.js",
"front_end/diff/diff.js",
"front_end/diff/diff_module.js",
"front_end/dirac/dirac.js",
"front_end/dom_extension/dom_extension.js",
"front_end/elements/elements-legacy.js",
"front_end/elements/elements.js",
Expand Down Expand Up @@ -460,6 +454,9 @@ grd_files_debug_sources = [
"front_end/console/ConsoleView.js",
"front_end/console/ConsoleViewMessage.js",
"front_end/console/ConsoleViewport.js",
# dirac start
"front_end/console/ConsoleDiracPrompt.js",
# dirac end
"front_end/console_counters/WarningErrorCounter.js",
"front_end/cookie_table/CookiesTable.js",
"front_end/coverage/CoverageDecorationManager.js",
Expand All @@ -483,6 +480,12 @@ grd_files_debug_sources = [
"front_end/devices/DevicesView.js",
"front_end/diff/DiffWrapper.js",
"front_end/diff/diff_match_patch.js",
# dirac start
"front_end/dirac/DiracAngel.js",
"front_end/dirac/parinfer.js",
"front_end/dirac/parinfer-codemirror.js",
"front_end/dirac/keysim.js",
# dirac end
"front_end/dom_extension/DOMExtension.js",
"front_end/elements/Adorner.js",
"front_end/elements/CSSAngle.js",
Expand Down
1 change: 1 addition & 0 deletions devtools_module_entrypoints.gni
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ generated_typescript_entrypoint_sources = [
"$resources_out_dir/devices/devices.js",
"$resources_out_dir/diff/diff-legacy.js",
"$resources_out_dir/diff/diff.js",
"$resources_out_dir/dirac/dirac.js",
"$resources_out_dir/dom_extension/dom_extension.js",
"$resources_out_dir/elements/elements-legacy.js",
"$resources_out_dir/elements/elements.js",
Expand Down
1 change: 1 addition & 0 deletions front_end/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ group("front_end") {
"developer_resources:bundle",
"devices:bundle",
"diff:bundle",
"dirac:bundle",
"dom_extension:bundle",
"elements:bundle",
"emulated_devices/optimized:optimized_emulated_devices",
Expand Down
1 change: 0 additions & 1 deletion front_end/accessibility/ARIAAttributesView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
// Copyright 2016 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.
Expand Down
7 changes: 0 additions & 7 deletions front_end/bindings/ResourceScriptMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,6 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper {
Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this);
}

/**
* @return {?SDK.Script.Script}
*/
getScript() {
return this._script;
}

/**
* @param {!Array.<!SDK.Script.Script>} scripts
* @return {boolean}
Expand Down
9 changes: 9 additions & 0 deletions front_end/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export {UIString} from '../platform/platform.js';

export const ls = Platform.UIString.ls;

function getDiracAngel() {
// @ts-ignore
const angel = globalThis.diracAngel;
if (!angel) {
throw 'getDiracAngel called too early';
}
return angel;
}

/**
* @type {!Settings.Settings}
Expand Down Expand Up @@ -75,4 +83,5 @@ export {
Trie,
Worker,
WasmDisassembly,
getDiracAngel
};
7 changes: 4 additions & 3 deletions front_end/components/Linkifier.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
Expand Down Expand Up @@ -845,10 +844,12 @@ export class Linkifier {
result.push(action);
}
}
if (dirac.hasLinkActions) {
const diracAction = Components.Linkifier.diracLinkHandlerAction;
const diracAngel = Common.getDiracAngel();
if (diracAngel.toggles.hasLinkActions) {
const diracAction = diracAngel.diracLinkHandlerAction;
if (diracAction) {
result.unshift({
section: 'reveal',
title: diracAction.title,
handler: diracAction.handler.bind(null, result, contentProvider.contentURL(), lineNumber, columnNumber)
});
Expand Down
3 changes: 0 additions & 3 deletions front_end/components/components-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ Components.Linkifier.LinkHandlerSettingUI = ComponentsModule.Linkifier.LinkHandl
/** @constructor */
Components.Linkifier.ContentProviderContextMenuProvider = ComponentsModule.Linkifier.ContentProviderContextMenuProvider;

/** @type {?Object} */
Components.Linkifier.diracLinkHandlerAction = null;

/** @interface */
Components.LinkDecorator = ComponentsModule.Linkifier.LinkDecorator;

Expand Down
1 change: 1 addition & 0 deletions front_end/console/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ devtools_module("console") {
"../platform:bundle",
"../sdk:bundle",
"../text_utils:bundle",
"../text_editor:bundle", # for dirac
"../theme_support:bundle",
"../ui:bundle",
]
Expand Down
Loading

0 comments on commit a8be8e7

Please sign in to comment.