[HN Gopher] How devtools map minified JS code back to your TypeS...
___________________________________________________________________
How devtools map minified JS code back to your TypeScript source
code
Author : manojvivek
Score : 57 points
Date : 2025-11-04 15:21 UTC (7 hours ago)
(HTM) web link (www.polarsignals.com)
(TXT) w3m dump (www.polarsignals.com)
| tantalor wrote:
| > Notice how the decoded values give relative positions, each
| value represents the difference from the previous position, not
| absolute coordinates. This is crucial: instead of encoding large
| column numbers like 27698 in minified files, source maps only
| store small deltas like +7 or +15, making the encoded strings
| much more compact.
|
| Wouldn't "offset" be a more apt term?
| manojvivek wrote:
| To me, "offset" sounds more like the distance from the start,
| whereas here the values are relative to the previous segment.
| Not a native english speaker, so I could be wrong.
| tantalor wrote:
| Offset is difference from a starting point or a previous
| position
| jagged-chisel wrote:
| "Offset" is not enough on its own. Offset from what? Start
| of file? Absolute offset. Previous offset? Relative offset.
| willrshansen wrote:
| 2nd order offset. The offset from the <offset from the
| start of the file>
| eat_veggies wrote:
| perhaps the delta between offsets
| recursive wrote:
| It sounds equally apt to my ear. I've used both words for this
| concept in the past.
| hanikesn wrote:
| Delta Encoding is the common term
| accrual wrote:
| In this case I feel it's like six of one and a half-dozen of
| the other.
|
| Delta definition 4: (mathematics, physics, engineering) The
| symbol D; A change in a quantity, likely from "d" for
| "difference"
|
| Offset definition 7: The distance by which one thing is out of
| alignment with another.
|
| Got these from Wiktionary:
|
| * https://en.wiktionary.org/wiki/delta
|
| * https://en.wiktionary.org/wiki/offset
| paulddraper wrote:
| Delta and offset mean the same thing -- the difference between
| two amounts.
|
| Delta is perhaps slightly more obscure outside of a math
| setting. Perhaps.
| zb3 wrote:
| Tangentially related, but last year I've made a tool to recover
| original sources from web apps which expose source maps (with the
| sourcesContent value present), including enumerating all lazily
| loaded chunks:
|
| https://github.com/zb3/getfrontend
___________________________________________________________________
(page generated 2025-11-04 23:00 UTC)