You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Injection is incredibly buggy, mostly because we only inject at a line boundary, even though sometimes the correct place is in the middle of a line. This creates frustration for users and hurts debug id adoption. Splitting lines apart would mean we would need to edit the sourcemap in a nontrivial way, however.
A possible way forward—my preferred option, if it works out the way I imagine it—is as follows.
Use the Rust port of magic-string to inject in exactly the right place and generate a sourcemap from the injected file to the pre-injected one. In my preliminary tests this works nicely.
Add a composition operation to rust-sourcemap. Given a sourcemap ab.map from file a to file b and a sourcemap bc.map from file b to files c₁, …, cₙ, this would produce a sourcemap ac.map from a to c₁, …, cₙ by composing the mappings from ab.map and bc.map.
Compose the sourcemap obtained in (1) with the one we already have to obtain a correct sourcemap from the injected file to the unminified files.
The content you are editing has changed. Please copy your edits and refresh the page.
Injection is incredibly buggy, mostly because we only inject at a line boundary, even though sometimes the correct place is in the middle of a line. This creates frustration for users and hurts debug id adoption. Splitting lines apart would mean we would need to edit the sourcemap in a nontrivial way, however.
A possible way forward—my preferred option, if it works out the way I imagine it—is as follows.
magic-string
to inject in exactly the right place and generate a sourcemap from the injected file to the pre-injected one. In my preliminary tests this works nicely.rust-sourcemap
. Given a sourcemapab.map
from filea
to fileb
and a sourcemapbc.map
from fileb
to filesc₁, …, cₙ
, this would produce a sourcemapac.map
froma
toc₁, …, cₙ
by composing the mappings fromab.map
andbc.map
.Tasks
The text was updated successfully, but these errors were encountered: