Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[DevTools] Add explanatory comments to $FlowFixMe annotations for Pop…
…over API

  Added descriptive comments to all $FlowFixMe annotations related to the Popover API,
  specifying that "Flow doesn't recognize Popover API" to make the code more maintainable and improve clarity for other developers.
  • Loading branch information
yongsk0066 committed Mar 17, 2025
commit 938ad0e4d45f85da1cb7d707a24912da7cdbec1b
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/edge/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Adds React debugging tools to the Microsoft Edge Developer Tools.",
"version": "6.1.1",
"version_name": "6.1.1",
"minimum_chrome_version": "102",
"minimum_chrome_version": "114",
"icons": {
"16": "icons/16-production.png",
"32": "icons/32-production.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ function drawWeb(nodeToData: Map<HostInstance, Data>) {
// if there are no nodes to draw, detach from top layer
if (nodeToData.size === 0) {
if (canvas !== null) {
try {
if (canvas.matches(':popover-open')) {
// $FlowFixMe[prop-missing]
// $FlowFixMe[incompatible-use]
canvas.hidePopover();
}
} catch (e) {}
if (canvas.matches(':popover-open')) {
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.hidePopover();
}
}
return;
}
Expand All @@ -62,8 +60,8 @@ function drawWeb(nodeToData: Map<HostInstance, Data>) {
} else {
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, you don't need it to wrap it in try / catch, since we bumped minimum versions for the extension

Please also check other calls below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! I've removed all try/catch blocks around Popover API calls.

if (!canvas.matches(':popover-open')) {
// $FlowFixMe[prop-missing]
// $FlowFixMe[incompatible-use]
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
}
} catch (e) {}
Expand Down Expand Up @@ -214,8 +212,8 @@ function destroyNative(agent: Agent) {
function destroyWeb() {
if (canvas !== null) {
try {
// $FlowFixMe[prop-missing]
// $FlowFixMe[incompatible-use]
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.hidePopover();
} catch (e) {}

Expand All @@ -234,9 +232,9 @@ export function destroy(agent: Agent): void {

function initialize(): void {
canvas = window.document.createElement('canvas');
// canvas.setAttribute('popover', 'manual');
canvas.setAttribute('popover', 'manual');

// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.style.cssText = `
xx-background-color: red;
xx-opacity: 0.5;
Expand All @@ -256,8 +254,8 @@ function initialize(): void {
root.insertBefore(canvas, root.firstChild);

try {
// $FlowFixMe[prop-missing]
// $FlowFixMe[incompatible-use]
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
} catch (e) {}
}
Loading