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

CoffeeScript source map support. #82

Closed
wants to merge 3 commits into from
Closed

Conversation

vjpr
Copy link
Contributor

@vjpr vjpr commented Apr 19, 2013

If you have a file foo.coffee or foo.js.coffee, when you load foo.js, the X-SourceMap header is added to the response with value foo.js.map.
Inside this source map is a reference to foo.coffee. When the browser makes a request to foo.coffee it will return the uncompiled CoffeeScript source.
This allows debugging CoffeeScript source in a browser and also works with IntelliJ Remote Javascript debugger too.

Includes tests.

See Issue #39.

If you have a file `foo.coffee` or `foo.js.coffee`, when you load `foo.js`, the `X-SourceMap` header is added to the response with value `foo.js.map`.
Inside this source map is a reference to `foo.coffee`. When the browser makes a request to `foo.coffee` it will return the uncompiled CoffeeScript source.
This allows debugging CoffeeScript source in a browser and also works with IntelliJ Remote Javascript debugger too.

Includes tests.

See Issue js-kyle#39.
@vjpr
Copy link
Contributor Author

vjpr commented Apr 20, 2013

The source map should be generated when the Coffeescript is compiled. This is easy, its just a Coffeescript compiler option. The question I have is where to save the source map?

Should I create a sourcemap property in Asset?

…cessedAsset.

An additional parameter was added to the `Context#evaluate` callback called `extra` which allows
us to pass back the original source (CoffeeScript code) and the source map from the engine.
@vjpr
Copy link
Contributor Author

vjpr commented Apr 20, 2013

I've changed how this works. Source maps are now generated during compilation and cached in a ProcessedAsset which should be much faster than before.

@vjpr
Copy link
Contributor Author

vjpr commented Apr 20, 2013

TODO: Need to add an option to Mincer#createServer to prevent serving Coffee files or unbundled files.

@ixti
Copy link
Collaborator

ixti commented Apr 21, 2013

Impressive. 👏 I tend to merge it, but with small improvements :D Thanks.

@inossidabile
Copy link

Can the community take on these improvements? :) We really require this functionality.

@puzrin
Copy link
Contributor

puzrin commented Dec 20, 2013

Closed pull-request as outdated. But ticket about sourcemaps is still open and has reference here.

@puzrin puzrin closed this Dec 20, 2013
@puzrin
Copy link
Contributor

puzrin commented Mar 23, 2014

@vjpr , coffescript sourcemaps are now ok on sourcemap branch. Enjoy! 1.0.0 will be released soon.

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

Successfully merging this pull request may close these issues.

4 participants