deoptigate icon indicating copy to clipboard operation
deoptigate copied to clipboard

Support sourcemaps

Open OliverUv opened this issue 6 years ago • 3 comments

When running deoptigate on my large project, which has been compiled from TypeScript to JavaScript, I get this:

scrot

The file, and most files that it requires do have inline sourcemaps. Adding support for those could help move these arrows to their correct positions.

Even with this flaw, the tool is really useful already, since I can see the function names referred to on the right hand side for each of the items. Big thanks!

OliverUv avatar Aug 15 '18 09:08 OliverUv

oh, and:

> node --version
v9.4.0
> uname -srvpoi
Linux 4.13.0-43-generic #48-Ubuntu SMP Wed May 16 12:18:48 UTC 2018 x86_64 x86_64 GNU/Linux

Using deoptigate 0.3.0

OliverUv avatar Aug 15 '18 09:08 OliverUv

I agree that would be a great feature. However deoptigate doesn't necessarily know how to resolve those easily, all it has are paths to the files that ran.

I don't think it's impossible, but wouldn't be trivial. Maybe there is a way to tell deoptigate where to look for map files for the files.

Then it still would have to translate where the markers would go (and wouldn't be able to syntax highlight as it only supports JS ATM).

So a pretty large chunk of work .. I'm open to have someone take this on and help where I can. It would definitely be an interesting feature.

thlorenz avatar Aug 23 '18 17:08 thlorenz

On the other hand just stripping inline source maps before creating the data file with the included sources should be trivial with convert-source-map. Would that solve the larger part of your problem?

If so could you take a stab of adding that step as part of file source resolution and file a PR?

thlorenz avatar Aug 23 '18 19:08 thlorenz