Skip to content

Conversation

@canova
Copy link
Member

@canova canova commented Sep 29, 2025

I went ahead and checked if the Map or Set objects had unknown types at the time of their declaration in the language server. These are the things I found.

This fixes #5617.

@canova canova requested a review from mstange September 29, 2025 09:07
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 96.10390% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.63%. Comparing base (27f4f53) to head (2ff1b40).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/actions/profile-view.ts 66.66% 1 Missing ⚠️
src/profile-logic/process-profile.ts 0.00% 1 Missing ⚠️
src/selectors/profile.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5623   +/-   ##
=======================================
  Coverage   85.63%   85.63%           
=======================================
  Files         312      312           
  Lines       30892    30892           
  Branches     8420     8420           
=======================================
  Hits        26453    26453           
  Misses       4009     4009           
  Partials      430      430           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mstange
Copy link
Contributor

mstange commented Oct 29, 2025

Sorry for the delay here.

I'm curious why you picked const set: Set<TheType> = new Set() over const set = new Set<TheType>(); . Do you have a preference? I mostly ended up using the latter during the conversion, I think. And I think one of the type-aware lints (which we haven't enabled yet) will remove the : Set<TheType> part because it thinks it's unnecessary, so if we want to enable that lint we'll need to switch to the other form.

@canova
Copy link
Member Author

canova commented Oct 29, 2025

Heh, I knew I would get this review comment while writing this patch :) I pretty much started with writing it as new Set<TheType> and then I wanted to check the count of the existing code. So I ran rg ":.*new (Map|Set)\(\)" | wc -l and it returned 86. I ran rg "new (Map|Set)<" | wc -l and it returned 62. So I went with the most used one in the codebase.

What do you mean the type-aware lints? I'm not really familiar with them.

@canova
Copy link
Member Author

canova commented Oct 29, 2025

Actually more accurate regexp would be rg ":.*=.*new (Map|Set)\(\)" | wc -l for the first one. Still 65 though.

@mstange
Copy link
Contributor

mstange commented Nov 6, 2025

What do you mean the type-aware lints? I'm not really familiar with them.

See #5620.
Specifically I think it was @typescript-eslint/no-unnecessary-type-assertion that I had trouble with when I experimented in that PR.

Copy link
Contributor

@mstange mstange left a comment

Choose a reason for hiding this comment

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

Let's switch to the new Map<T>() syntax instead.

@canova
Copy link
Member Author

canova commented Dec 3, 2025

Oh, I thought I had already updated the PR, but apparently not. Updated it now!

Copy link
Contributor

@mstange mstange left a comment

Choose a reason for hiding this comment

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

Thanks!

@mstange mstange merged commit 698b341 into firefox-devtools:main Dec 3, 2025
21 checks passed
@canova canova mentioned this pull request Dec 18, 2025
canova added a commit that referenced this pull request Dec 18, 2025
Changes:

[Markus Stange] Use a longer test timeout when debugging with VS code.
(#5679)
[Markus Stange] Move Jest config from package.json to jest.config.js
(#5680)
[Markus Stange] Make binary profile format parsing use Uint8Array
instead of ArrayBuffer (#5678)
[Markus Stange] Use workbox-cli to generate the service worker (#5681)
[Nazım Can Altınova] Migrate from Appveyor to GitHub Actions Windows
runners (#5660)
[Nazım Can Altınova] Remove some unused dependencies (#5696)
[Nazım Can Altınova] Update the document links and sections (#5705)
[Nazım Can Altınova] Clear selected and expanded call node paths on
browser back button if it removes transforms (#5701)
[Nazım Can Altınova] Properly type the Map and Set objects (#5623)
[Valentin Gosu] Add priorityHeader field to network requests (#5707)
[Nazım Can Altınova] Redirect unpublished url loads to the homepage
similar to from-file (#5712)
[Florian Quèze/Nazım Can Altınova] Add an importer for the text format
taken as input by flamegraph.pl. (#5359)
[Florian Quèze] Improve the import of profiles generated from clang
-ftime-trace=file.json (#5714)
[Markus Stange] Move React stuff out of marker schema logic module.
(#5720)

And thanks to our localizers:

en-CA: chutten
en-CA: Paul
es-CL: ravmn
fr: Théo Chevalier
fur: Fabio Tomat
ru: berry
tr: Selim Şumlu
zh-CN: Olvcpr423
zh-CN: wxie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check the Map constructions in the codebase to make sure that they are all typed properly

2 participants