chrome-devtools-frontend 1.0.967610 → 1.0.969345

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/config/gni/devtools_grd_files.gni +20 -0
  2. package/front_end/core/host/UserMetrics.ts +2 -1
  3. package/front_end/core/i18n/locales/en-US.json +6 -0
  4. package/front_end/core/i18n/locales/en-XL.json +6 -0
  5. package/front_end/core/root/Runtime.ts +1 -0
  6. package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
  7. package/front_end/devtools_compatibility.js +0 -36
  8. package/front_end/entrypoints/main/MainImpl.ts +4 -0
  9. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +265 -0
  10. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  11. package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
  12. package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
  13. package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
  14. package/front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
  15. package/front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md +1 -0
  16. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md +1 -0
  17. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md +1 -0
  18. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataNoResponse.md +1 -0
  19. package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
  20. package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md +1 -0
  21. package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
  22. package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
  23. package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
  24. package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
  25. package/front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
  26. package/front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md +1 -0
  27. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +1 -0
  28. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +1 -0
  29. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +1 -0
  30. package/front_end/panels/application/InterestGroupStorageView.ts +21 -7
  31. package/front_end/panels/console/ConsoleViewMessage.ts +3 -5
  32. package/front_end/panels/console/ErrorStackParser.ts +5 -3
  33. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +6 -3
  34. package/front_end/panels/sources/CSSPlugin.ts +2 -0
  35. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  36. package/front_end/panels/sources/ScopeChainSidebarPane.ts +31 -0
  37. package/front_end/panels/sources/SourceMapNamesResolver.ts +15 -9
  38. package/front_end/third_party/codemirror.next/README.chromium +10 -0
  39. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  40. package/front_end/third_party/codemirror.next/chunk/cpp.js +2 -1
  41. package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -2
  42. package/front_end/third_party/codemirror.next/chunk/python.js +2 -1
  43. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +574 -553
  44. package/front_end/third_party/codemirror.next/package.json +11 -11
  45. package/front_end/ui/components/settings/settingCheckbox.css +2 -0
  46. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +13 -34
  47. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
  48. package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -25
  49. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  50. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -2
  51. package/package.json +1 -1
  52. package/scripts/build/devtools_plugin.js +32 -1
  53. package/scripts/build/esbuild.js +1 -24
  54. package/scripts/build/tests/plugins_test.js +60 -1
  55. package/scripts/devtools_paths.js +1 -29
@@ -607,7 +607,7 @@ export class DebuggerPlugin extends Plugin {
607
607
  return null;
608
608
  }
609
609
  while (
610
- node && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
610
+ node && node.name !== 'this' && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
611
611
  node.name !== 'MemberExpression' &&
612
612
  !(node.name === 'PropertyName' && node.parent?.name === 'PatternProperty' &&
613
613
  node.nextSibling?.name !== ':') &&
@@ -90,6 +90,8 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
90
90
  private readonly expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController;
91
91
  private readonly linkifier: Components.Linkifier.Linkifier;
92
92
  private infoElement: HTMLDivElement;
93
+ #scopesScript: SDK.Script.Script|null = null;
94
+
93
95
  private constructor() {
94
96
  super(true);
95
97
 
@@ -126,6 +128,34 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
126
128
  }
127
129
  }
128
130
 
131
+ private sourceMapAttached(
132
+ event: Common.EventTarget.EventTargetEvent<{client: SDK.Script.Script, sourceMap: SDK.SourceMap.SourceMap}>):
133
+ void {
134
+ if (event.data.client === this.#scopesScript) {
135
+ void this.update();
136
+ }
137
+ }
138
+
139
+ private setScopeSourceMapSubscription(callFrame: SDK.DebuggerModel.CallFrame|null): void {
140
+ const oldScript = this.#scopesScript;
141
+ this.#scopesScript = callFrame?.script ?? null;
142
+
143
+ // Shortcut for the case when we are listening to the same model.
144
+ if (oldScript?.debuggerModel === this.#scopesScript?.debuggerModel) {
145
+ return;
146
+ }
147
+
148
+ if (oldScript) {
149
+ oldScript.debuggerModel.sourceMapManager().removeEventListener(
150
+ SDK.SourceMapManager.Events.SourceMapAttached, this.sourceMapAttached, this);
151
+ }
152
+
153
+ if (this.#scopesScript) {
154
+ this.#scopesScript.debuggerModel.sourceMapManager().addEventListener(
155
+ SDK.SourceMapManager.Events.SourceMapAttached, this.sourceMapAttached, this);
156
+ }
157
+ }
158
+
129
159
  private async update(): Promise<void> {
130
160
  // The `resolveThisObject(callFrame)` and `resolveScopeChain(callFrame)` calls
131
161
  // below may take a while to complete, so indicate to the user that something
@@ -137,6 +167,7 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
137
167
  this.linkifier.reset();
138
168
 
139
169
  const callFrame = UI.Context.Context.instance().flavor(SDK.DebuggerModel.CallFrame);
170
+ this.setScopeSourceMapSubscription(callFrame);
140
171
  const [thisObject, scopeChain] = await Promise.all([resolveThisObject(callFrame), resolveScopeChain(callFrame)]);
141
172
  // By now the developer might have moved on, and we don't want to show stale
142
173
  // scope information, so check again that we're still on the same CallFrame.
@@ -10,9 +10,14 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
10
10
  import type * as Workspace from '../../models/workspace/workspace.js';
11
11
  import * as Protocol from '../../generated/protocol.js';
12
12
 
13
- const scopeToCachedIdentifiersMap = new WeakMap<SDK.DebuggerModel.ScopeChainEntry, Promise<Map<string, string>>>();
13
+ interface CachedScopeMap {
14
+ sourceMap: SDK.SourceMap.SourceMap|null;
15
+ identifiersPromise: Promise<Map<string, string>>;
16
+ }
14
17
 
18
+ const scopeToCachedIdentifiersMap = new WeakMap<SDK.DebuggerModel.ScopeChainEntry, CachedScopeMap>();
15
19
  const cachedMapByCallFrame = new WeakMap<SDK.DebuggerModel.CallFrame, Map<string, string>>();
20
+
16
21
  export class Identifier {
17
22
  name: string;
18
23
  lineNumber: number;
@@ -79,17 +84,17 @@ export const resolveScopeChain =
79
84
  };
80
85
 
81
86
  export const resolveScope = async(scope: SDK.DebuggerModel.ScopeChainEntry): Promise<Map<string, string>> => {
82
- let identifiersPromise = scopeToCachedIdentifiersMap.get(scope);
83
- if (!identifiersPromise) {
87
+ let cachedScopeMap = scopeToCachedIdentifiersMap.get(scope);
88
+ const script = scope.callFrame().script;
89
+ const sourceMap = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().sourceMapForScript(script);
90
+
91
+ if (!cachedScopeMap || cachedScopeMap.sourceMap !== sourceMap) {
84
92
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
85
93
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
94
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
87
95
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
- identifiersPromise = (async(): Promise<Map<any, any>> => {
96
+ const identifiersPromise = (async(): Promise<Map<any, any>> => {
89
97
  const namesMapping = new Map<string, string>();
90
- const script = scope.callFrame().script;
91
- const sourceMap =
92
- Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().sourceMapForScript(script);
93
98
  if (sourceMap) {
94
99
  const textCache = new Map<string, TextUtils.Text.Text>();
95
100
  // Extract as much as possible from SourceMap and resolve
@@ -111,9 +116,10 @@ export const resolveScope = async(scope: SDK.DebuggerModel.ScopeChainEntry): Pro
111
116
  }
112
117
  return namesMapping;
113
118
  })();
114
- scopeToCachedIdentifiersMap.set(scope, identifiersPromise);
119
+ cachedScopeMap = {sourceMap, identifiersPromise};
120
+ scopeToCachedIdentifiersMap.set(scope, {sourceMap, identifiersPromise});
115
121
  }
116
- return await identifiersPromise;
122
+ return await cachedScopeMap.identifiersPromise;
117
123
 
118
124
  async function resolveSourceName(
119
125
  script: SDK.Script.Script, sourceMap: SDK.SourceMap.SourceMap, id: Identifier,
@@ -16,3 +16,13 @@ To update this package, adjust the version ranges in package.json if necessary,
16
16
  ```
17
17
 
18
18
  It will use npm to locally install the necessary packages and their dependencies, and bundle them into a single file (codemirror.js and codemirror.d.ts) with rollup.
19
+
20
+ If you want to easily obtain all the latest versions of the packages, run the following:
21
+
22
+ ```
23
+ npm i
24
+ npm outdated
25
+ ```
26
+
27
+ This will show you a table with all the latest versions of each package.
28
+ You will need to manually update the versions in the `package.json` file.