mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
This reverts commit340bd16cd3. Reason for revert: devtools_pre_built no longer makes hardlinks Original change's description: > Revert "Reland "Updates elements to devtools_module"" > > This reverts commit04858cf7dd. > > Reason for revert: This seems to trigger the known issue that > TSC is rewriting source files because of left-over hard-links. > See https://ci.chromium.org/p/devtools-frontend/builders/ci/Stand-alone%20Linux/2582 > > To reproduce locally, check out the commit before this revision, > do a clean build, then check out this revision, and do a build. > This will succeed but rewrite source files (which it shouldn't). > > > Original change's description: > > Reland "Updates elements to devtools_module" > > > > This reverts commit22d876ca02. > > > > Reason for revert: Build issues on bots should be fixed > > > > Original change's description: > > > Revert "Updates elements to devtools_module" > > > > > > This reverts commit81e818fad8. > > > > > > Reason for revert: Anticipating build errors on bots > > > > > > Original change's description: > > > > Updates elements to devtools_module > > > > > > > > Bug: 1101738 > > > > Change-Id: I294d366c95a3b5dc7ac5b757855846a7b31ac60b > > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2329779 > > > > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> > > > > Commit-Queue: Paul Lewis <aerotwist@chromium.org> > > > > > > TBR=aerotwist@chromium.org,jacktfranklin@chromium.org > > > > > > Change-Id: I3e36a1520e34be3ce1779ecdf2b4cead6a293971 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: 1101738 > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332815 > > > Reviewed-by: Paul Lewis <aerotwist@chromium.org> > > > Commit-Queue: Paul Lewis <aerotwist@chromium.org> > > > > TBR=aerotwist@chromium.org,jacktfranklin@chromium.org > > > > # Not skipping CQ checks because this is a reland. > > > > Bug: 1101738 > > Change-Id: Ia0d06bb75f2610459f4d0b31ff6b770b1031d982 > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335060 > > Reviewed-by: Paul Lewis <aerotwist@chromium.org> > > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> > > Commit-Queue: Paul Lewis <aerotwist@chromium.org> > > TBR=aerotwist@chromium.org,jacktfranklin@chromium.org > > Change-Id: Iabfbe2aad94033078eac41338d64ca069f49332f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 1101738 > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335273 > Reviewed-by: Sigurd Schneider <sigurds@chromium.org> > Commit-Queue: Sigurd Schneider <sigurds@chromium.org> TBR=sigurds@chromium.org,aerotwist@chromium.org,jacktfranklin@chromium.org # Not skipping CQ checks because this is a reland. Bug: 1101738 Change-Id: I42579d6cac06ec45377789253588ba94ee72a226 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336715 Commit-Queue: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
77 lines
2.3 KiB
JavaScript
77 lines
2.3 KiB
JavaScript
// Copyright 2019 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.
|
|
|
|
// @ts-nocheck
|
|
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
|
|
|
|
import * as Components from '../components/components.js';
|
|
import * as SDK from '../sdk/sdk.js';
|
|
import * as UI from '../ui/ui.js';
|
|
|
|
/**
|
|
* @unrestricted
|
|
*/
|
|
export class NodeStackTraceWidget extends UI.ThrottledWidget.ThrottledWidget {
|
|
constructor() {
|
|
super(true /* isWebComponent */);
|
|
this.registerRequiredCSS('elements/nodeStackTraceWidget.css');
|
|
|
|
this._noStackTraceElement = this.contentElement.createChild('div', 'gray-info-message');
|
|
this._noStackTraceElement.textContent = ls`No stack trace available`;
|
|
this._creationStackTraceElement = this.contentElement.createChild('div', 'stack-trace');
|
|
|
|
this._linkifier = new Components.Linkifier.Linkifier(MaxLengthForLinks);
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
*/
|
|
wasShown() {
|
|
self.UI.context.addFlavorChangeListener(SDK.DOMModel.DOMNode, this.update, this);
|
|
this.update();
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
*/
|
|
willHide() {
|
|
self.UI.context.removeFlavorChangeListener(SDK.DOMModel.DOMNode, this.update, this);
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
* @protected
|
|
* @return {!Promise<undefined>}
|
|
*/
|
|
async doUpdate() {
|
|
const node = self.UI.context.flavor(SDK.DOMModel.DOMNode);
|
|
|
|
if (!node) {
|
|
this._noStackTraceElement.classList.remove('hidden');
|
|
this._creationStackTraceElement.classList.add('hidden');
|
|
return;
|
|
}
|
|
|
|
const creationStackTrace = await node.creationStackTrace();
|
|
if (creationStackTrace) {
|
|
this._noStackTraceElement.classList.add('hidden');
|
|
this._creationStackTraceElement.classList.remove('hidden');
|
|
|
|
const stackTracePreview = Components.JSPresentationUtils.buildStackTracePreviewContents(
|
|
node.domModel().target(), this._linkifier, {stackTrace: creationStackTrace});
|
|
this._creationStackTraceElement.removeChildren();
|
|
this._creationStackTraceElement.appendChild(stackTracePreview.element);
|
|
} else {
|
|
this._noStackTraceElement.classList.remove('hidden');
|
|
this._creationStackTraceElement.classList.add('hidden');
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @const
|
|
* @type {number}
|
|
*/
|
|
export const MaxLengthForLinks = 40;
|