Open
Conversation
Overall package sizeSelf size: 2.05 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | pprof-format | 2.2.1 | 163.06 kB | 163.06 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
f55cf32 to
b7c7986
Compare
…le comments
When a JS file has a sourceMappingURL annotation but no map file is found
after both phases of directory scanning, the file path is tracked in
SourceMapper.declaredMissingMap. mappingInfo() for such files returns a
SourceLocation with missingMapFile: true.
In serialize(), unique paths with missingMapFile: true are collected and
emitted into profile.comment as pairs of string IDs:
[dedup("dd:missing-map-file-for"), dedup(filePath)]
This uses the otherwise-unused comment section and avoids bloating the
string table since paths are already present via Function.filename.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers serializeTimeProfile and serializeHeapProfile emitting dd:missing-map-file-for comment pairs, no comments without a source mapper or when all maps are resolved, and deduplication of paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ath pairs Replace the per-path comment pairs with a single well-known token in the profile comment section. This is sufficient to signal that at least one file referenced in the profile locations declared a sourceMappingURL but no map was found, without bloating the profile with individual paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b7c7986 to
69692ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(This builds on #292.)
Rationale
In the backend, we want to better identify profiles that might require server-side unminification because their source maps were not present locally in the application. We will depend on customers emitting generated/minified sources with the
sourceMappingURLannotation present, but I think that's fair; most modern tools will add it by default and users must go out of their way to set a flag for the annotation to not be emitted. If we don't support server-side unminification for those, I think that's fine. We'll have to document it like that once when we roll out the feature.I expect rolling this out will massively reduce the number of profile candidates for server-side unminification.
Summary
sourceMappingURLannotation but for which no map file is found after both phases of source map discoverySourceMapper.mappingInfo()returnsmissingMapFile: trueon theSourceLocationfor such filesserialize()in the profile serializer emits a singledd:has-missing-map-filestoken intoprofile.commentwhen at least one such file is encountered during serializationDetails
Only files that declare a
sourceMappingURLare flagged — files with no annotation that simply have no map are not reported. A file resolved via the.map-file fallback (Phase 2) is not flagged even if its annotation pointed to a missing path.The token approach (single well-known string in
comment) keeps profile size impact minimal: the string is only added to the string table when needed, and no per-path data is emitted.Test plan
SourceMapperunit tests:missingMapFile=trueset when annotation declares missing map, not set for plain files or files resolved via fallbackserialize()tests: token emitted for bothserializeTimeProfileandserializeHeapProfile, not emitted when no source mapper is used or when all maps are resolved🤖 Generated with Claude Code
Jira: PROF-13985