Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate SourceMaps #57

Open
pgbakker opened this issue Apr 28, 2014 · 2 comments
Open

Generate SourceMaps #57

pgbakker opened this issue Apr 28, 2014 · 2 comments

Comments

@pgbakker
Copy link

Theseus rewrites your JavaScript Source, but it doesn't generate sourcemaps.

Hence if you install the the Console Tools plugin to help debugging issues in the code for example, the line numbers are completely screwed.

Also when you open the Developer Tools in Google Chrome you see the unreadable instrumented code, instead of the code you wrote.

@alltom
Copy link
Member

alltom commented Apr 28, 2014

It does optionally generate source maps, but it's really slow and turned off by default. It's really slow! Theseus makes a lot of edits so the maps are large.

I even forked falafel just to make it work. :) But stepping through source-mapped code in Chrome was so buggy at the time, and it made pages take so much longer to load, that I just turned it off.

Generation of source maps is turned back on by passing { source_map: true } to traceFilter. You can hack that in yourself, but for something I can release, a little work would be needed in each of the three projects:

  • fondue: Pass source_map: true/false here by getting from the options provided to instrument().
  • node-theseus: instrument is called from here. A command-line argument should be created for it here.
  • Theseus (the Brackets extension): instrument is called from here (JavaScript files) and here (embedded script tags). An argument for it should be added to the getServer command, which is called from here. The parameter for whether to generate source maps should probably provided from a preference that works like the Static/Proxy options in the File menu (which is all handled by main.js).

Bonus:

  • Make it tolerable with caching. Checksum the input files and store the instrumented versions on disk.

If anyone wants to take any part of this on, let me know! The node-theseus case is pretty simple. As with all issues, this is going on my to-do list but it might take me a little while to get to it. :)

@OKNoah
Copy link

OKNoah commented Jul 8, 2015

Yeah this is kind of a deal breaker for Brackets/Theseus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants