firefox-devtools / firefox-devtools/profiler
Consider including source maps in the profiler-cli npm package
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
Currently we only generate a single bundle for profiler-cli and it's minified. It would be good to include its source map too, so in case we want to profile it or debug it we can use it easily.
Note that node cpuprofiles don't actually support source maps. And there were some discussions around it which didn't go anywhere: https://github.com/nodejs/node/issues/50894
But we can still make that work it in the Firefox Profiler with the addition of "Apply sourcemaps..." button that I'm adding. It will require some editing, either in the chrome importer or maybe as a `profile-edit` script.
I guess the only thing that makes me wonder is the size difference. Currently the cli bundle is around ~1.1MB and the source map is around ~5.7MB. So it will increase the package size a lot, but probably that's an okay compromise. as the whole thing will still be under 10MB.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-1370)
Contributor guide
Research direction
Start by tracing how the profiler-cli's single minified bundle is produced and included in the npm package. Confirm that the generated source map is shipped alongside it and verify the resulting package remains under 10 MB; Node cpuprofiles do not consume source maps, so Firefox Profiler support is the relevant use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100