regenerator icon indicating copy to clipboard operation
regenerator copied to clipboard

Support source maps for generated code

Open benjamn opened this issue 10 years ago • 8 comments

The best place to implement source map support is probably in https://github.com/benjamn/recast, which is a dependency, but I wanted to have an issue here so that people know source maps are on the roadmap.

benjamn avatar Oct 21 '13 22:10 benjamn

How come you guys didn't use escodegen? When used with esprima, it can magically generate the source maps for you already. Just curious.

jlongster avatar Oct 22 '13 20:10 jlongster

@jlongster That's an interesting idea. I used https://github.com/benjamn/recast only because it's a tool I wrote and understand, but the dependency is very small/swappable (essentially confined to https://github.com/facebook/regenerator/blob/master/main.js). Want to try using escodegen instead and submit a PR? If you don't, I probably will!

benjamn avatar Oct 22 '13 20:10 benjamn

I'm booked for the next month, otherwise I would! I will if it hasn't been done by then. Glad to hear it should be pluggable; I thought recast also provided some tools for transformation that you were using. I choose my own tools too :) But in this case, I think you would win a lot from escodegen.

Great job in the library. I've seen several attempts at this and none of them come close.

jlongster avatar Oct 22 '13 20:10 jlongster

Are there any plans to implement this in the nearby future?

mgol avatar Aug 04 '14 11:08 mgol

It looks like recast supports source maps now, so is this still an issue?

appden avatar Jan 13 '15 23:01 appden

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

ghost avatar Aug 04 '15 18:08 ghost

So is this still an issue ?

matthiasg avatar Oct 07 '16 14:10 matthiasg

Yes i believe it is. My workaround is to not transpile generators when debugging locally as the latest version of chrome supports them anyway. In my case that meant removing the es2015 preset and installing and using its plugins as necessary to get a working system again (only "transform-es2015-modules-commonjs" for me but perhaps I'm behind the curve ;) )

jon-node28 avatar Apr 26 '17 13:04 jon-node28