tc39 / source-map

Source map specification, RFCs and new proposals.
https://tc39.es/source-map/
Other
130 stars 17 forks source link

Future-proof "Scopes" encoding #158

Open szuend opened 1 week ago

szuend commented 1 week ago

@jridgewell and I brainstormed a bit how we could make the "Scopes" encoding forward compatible without making it too complex or heavy handed. I'll implement some of these in the coming days to get some numbers to compare.

Future-proof "Scopes" encoding

The current "Scopes" encoding is not ideal w.r.t. to future extension:

We should aim for an encoding that is both forwards-compatible and is purely VLQ based: So the only difference between the current JSON source map format and a potential future binary format is how VLQs are encoded.

The crux of the issue is to find the right balance between

This sourcemap-scopes-encoding repository proposes some potential "Scopes" encodings that keep both goals in mind while aiming for a healthy balance.

szuend commented 5 days ago

I moved the various encoding schemes to a separate repository: https://github.com/ChromeDevTools/sourcemap-scopes-encoding

The repo has implementations, some example source maps and a small runner that compares the encoding schemes.