firefox-devtools / firefox-devtools/profiler
Source mapping for class constructors should contain the class name
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
Testcase: https://polite-mochi-ddca0f.netlify.app/index.min.html
(Repo: https://github.com/mstange/profiler-sourcemap-testcase-constructor-name )
I get this source-mapped profile, showing time spent in a function named `constructor`: https://share.firefox.dev/4ft1z5a
In the original source code, this is the constructor of the `SlowThingy` class.
Can we get the `SlowThingy` name into the constructor name?
If the class name hasn't been minified, the pre-sourcemapping name of the function is just the class name. And then source mapping removes the class name and substitutes it with the word "constructor".
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-1388)
Contributor guide
Research direction
Start with the linked minified testcase and source-mapped profile to reproduce the constructor name shown as `constructor`. Trace the profiler's source-mapping handling for class constructors; done means a constructor from the `SlowThingy` example is displayed with the `SlowThingy` class name without regressing other mapped function names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100