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 when converting Module with Template (UMD / AMD / nodejs / combined) #24

Open
anodynos opened this Issue Sep 28, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@anodynos
Owner

anodynos commented Sep 28, 2013

Generating SourceMaps when converting Modules with Template (UMD / AMD / nodejs / combined) would be very desirable in the future - there is no code that deals with it as of v0.6.

Currently you can only compile to .js (NOT template) and keep the SourceMaps info, with the help of a ResourceConverter.

This one for example finds and adjusts the build-in coffee-script RC :

  • it downgrades it to mark the files it deals with to TextResource (instead of Module)
  • It changes it 'convert' callback, taking advantage of resource.sourceMapInfo
          ->
             # The '#' flag in front of search, downgrades found RC to type:'text',
             # marking files it deals with as `TextResource`!
            (coffeeRC = @ '#coffee-script').convert = (r)->   
              compiled = (require 'coffee-script').compile r.source, {sourceMap:true}
              compiled.js + r.sourceMapInfo.sourceMappingURL
            return coffeeRC 

Changes are needed in Module + ModuleGeneratorTemplates.

@sholladay

This comment has been minimized.

Show comment
Hide comment
@sholladay

sholladay Apr 12, 2015

Hey @anodynos, I would like to adopt uRequire, but solid source maps support is a blocker for me. Any word on this? Is it just lack of time / priority or is this ticket really hard to do?

Hey @anodynos, I would like to adopt uRequire, but solid source maps support is a blocker for me. Any word on this? Is it just lack of time / priority or is this ticket really hard to do?

@anodynos

This comment has been minimized.

Show comment
Hide comment
@anodynos

anodynos Apr 15, 2015

Owner

Hey @sholladay - on v0.7.x (still beta, but very stable) there is some progress made on how the templates are rendered, but no actual work on SourceMaps.
I guess there is quite a level of difficulty if we want to make transparent for the user, having all the involved parties (coffeescript, coco, livescript, uglify, esprima, escodegen & urequire's templating system - and soon es6 etc) all transforming and passing the relevant sourcemap down the line. But I haven't worked with any source maps libs yet, so it might be easier that I thought. I do hope I can work on this the next few months, but no guarantees!
Surely you can adopt it as it is and see if it suit you - INMHO I think in 95% of the cases an average-and-above developer can understand where they are, without sourcemaps.

Owner

anodynos commented Apr 15, 2015

Hey @sholladay - on v0.7.x (still beta, but very stable) there is some progress made on how the templates are rendered, but no actual work on SourceMaps.
I guess there is quite a level of difficulty if we want to make transparent for the user, having all the involved parties (coffeescript, coco, livescript, uglify, esprima, escodegen & urequire's templating system - and soon es6 etc) all transforming and passing the relevant sourcemap down the line. But I haven't worked with any source maps libs yet, so it might be easier that I thought. I do hope I can work on this the next few months, but no guarantees!
Surely you can adopt it as it is and see if it suit you - INMHO I think in 95% of the cases an average-and-above developer can understand where they are, without sourcemaps.

@sholladay

This comment has been minimized.

Show comment
Hide comment
@sholladay

sholladay Apr 15, 2015

Unfortunately, my use case is for 3rd party enterprise SaaS, meaning our product goes on other people's websites and has to be as small as possible, so we have to minify and debugging is already hard with that as is.

Would a bounty help?

Unfortunately, my use case is for 3rd party enterprise SaaS, meaning our product goes on other people's websites and has to be as small as possible, so we have to minify and debugging is already hard with that as is.

Would a bounty help?

@anodynos

This comment has been minimized.

Show comment
Hide comment
@anodynos

anodynos Apr 16, 2015

Owner

Oh, if you have to use minification only, then yes you're in a tough place. I was stating its easy to follow but for coffee compiled code or the template conversion / decoration etc, not the minification!

A bounty would perhaps help - I think I will post it as a bounty after I release v0.7.0 & improve the docs!

Regards

Regards

Owner

anodynos commented Apr 16, 2015

Oh, if you have to use minification only, then yes you're in a tough place. I was stating its easy to follow but for coffee compiled code or the template conversion / decoration etc, not the minification!

A bounty would perhaps help - I think I will post it as a bounty after I release v0.7.0 & improve the docs!

Regards

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment