Skip to content

Suggest enabling the "JavaScript Sources" feature in the source view#6144

Open
canova wants to merge 1 commit into
firefox-devtools:mainfrom
canova:js-feature
Open

Suggest enabling the "JavaScript Sources" feature in the source view#6144
canova wants to merge 1 commit into
firefox-devtools:mainfrom
canova:js-feature

Conversation

@canova

@canova canova commented Jul 6, 2026

Copy link
Copy Markdown
Member

Main | Deploy preview

When source code fails to load for a JS source, show a hint pointing users to the "JavaScript Sources" recording feature on about:profiling. The hint only appears when the source has a valid id, so it doesn't show for native or other files.

Fixes #5640

I also had an older PR in #5643 that was trying to achieve something similar that I decided not to land. It was always adding this suggestion no matter what, and the reason was that we didn't have the source table fully available at the time. Now that we always output the source table, we can check and only warn the users when the source table entry has an Id.

@canova canova requested a review from mstange July 6, 2026 08:19
@canova canova requested a review from a team as a code owner July 6, 2026 08:19
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.48%. Comparing base (c765a85) to head (f822199).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/components/app/BottomBox.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6144      +/-   ##
==========================================
+ Coverage   83.46%   83.48%   +0.02%     
==========================================
  Files         342      342              
  Lines       36346    36349       +3     
  Branches    10208    10211       +3     
==========================================
+ Hits        30335    30346      +11     
+ Misses       5583     5575       -8     
  Partials      428      428              

☔ View full report in Codecov by Harness.
📢 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.

Comment thread locales/en-US/app.ftl Outdated
# enabled in the recording settings before capturing a profile.
# "JavaScript Sources" and "about:profiling" should not be translated.
SourceView--enable-js-sources-feature-hint =
To view the source of this JavaScript file, enable the “JavaScript Sources” feature in the recording settings on about:profiling before recording the profile.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
To view the source of this JavaScript file, enable the “JavaScript Sources” feature in the recording settings on about:profiling before recording the profile.
To view the source of this JavaScript file, before recording the profile enable the “JavaScript Sources” feature in the recording settings in about:profiling.

I would probably turn it around a bit for readability.

on about:profiling, or in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, updated the wording.I'm very bad in general with English prepositions so I'll take your word for it! 😄

When source code fails to load for a JS source, show a hint pointing
users to the "JavaScript Sources" recording feature on about:profiling.
The hint only appears when the source has a valid id, so it doesn't show
for native or other files.

Fixes firefox-devtools#5640
@mstange

mstange commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

At what point can we make that feature always-on (i.e. remove it)?

@canova

canova commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

At what point can we make that feature always-on (i.e. remove it)?

I'm not super sure if we want to remove the feature completely. I filed a bug to make it on by default for the "Web Developer" preset here, but I wasn't sure if we wanted to make it on by default in the platform preset yet (we might as well do it?). And I was also thinking that it might make sense to make it off by default on some cases like graphics/media presets.

@mstange mstange left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems fine but I don't understand how this distinguishes just-captured profiles from uploaded profiles. Do uploaded profiles not have valid source IDs? Why not?

@mstange

mstange commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

At what point can we make that feature always-on (i.e. remove it)?

I'm not super sure if we want to remove the feature completely. I filed a bug to make it on by default for the "Web Developer" preset here,

Ok, continuing this conversation there. In the meantime I'm fine with this fix.

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.

Should the source view suggest enabling the "JS Sources" feature?

3 participants