getsentry / rust-sourcemap

A library for rust that implements basic sourcemap handling
Other
224 stars 28 forks source link

ref: Sort tokens in SourceMap #91

Closed loewenheim closed 3 months ago

loewenheim commented 5 months ago

The fact that the tokens in a sourcemap can be arbitrarily ordered causes a substantial amount of complication (we have to keep a sorted index in addition) for no benefit that I've ever seen. Therefore, we now sort tokens upon creation and remove all the Index rigmarole. This is a breaking change because it removes some types and functions.

loewenheim commented 5 months ago

lgtm. you still keep the index around in some places. does that really make sense to still expose it in some way? if it still exists internally, you might as well keep the APIs around for backwards compatibility.

That's unintentional then, I'll have to take another look.

kdy1 commented 3 months ago

Can we have this merged/publsihed?

loewenheim commented 3 months ago

Can we have this merged/publsihed?

Sorry, I lost track of this for a bit. Will give it a once-over and merge it soon.

loewenheim commented 3 months ago

@Swatinem I just looked over this again; I don't think there's any index left (in the sense of the field of SourceMap that orders tokens). Did you mean something else?

Swatinem commented 3 months ago

Yeah, I also lost context by now. Anyway, I approved the PR back then, so just merge and profit :-)

kdy1 commented 3 months ago

Thank you!

loewenheim commented 3 months ago

@kdy1 It's released.