You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Nami-Doc That's a good question. The current v3 specification allows it by using a data uri as sourceMappingUrl and additional parameter "sourcesContent". I'm not sure about the browser support though.
@kelp404 Yes, I'm aware of how to use it, thank you. The question is about supporting source maps right in the browser. @mintplant I use it for development & testing of my product extensively. The benefit is that you can do frontend-only development with a basic static files server (I mock server requests anyway).
I created manually the source map, encoded original text to js string, created property sourcesContent in the source map, then base64-encoded source map and added as a sourceMapUrl to the .js file. Then viewed it in Chrome Dev Tools. Chrome 25 for Linux.
Got it working in Canary, too. I think this is possible if we could...
port JSON.stringify() since it's not supported in IE6
port a permissive base64 encoder that supports utf-8, because...
utf-8 strings are expected in source codes
and btoa() is not supported in IE
I'm afraid both of them adds significant LOC to existing code base.
In other hand, If we compile to js with horrible inline source mapping, none of these limits will apply, any thought?
See what's been done by browserify for detail.
Got it working in Canary, too. I think this is possible if we could...
port JSON.stringify() since it's not supported in IE6
port a permissive base64 encoder that supports utf-8, because...
utf-8 strings are expected in source codes
and btoa() is not supported in IE
I'm afraid both of them adds significant LOC to existing code base.
In other hand, If we compile to js with horrible inline source mapping like what's been done by browserify, none of these limits will apply, any thought?
—
Reply to this email directly or view it on GitHub.
Because extras/coffee-script.js need to run in all the browser that is currently supported.
Or do you suggest a user agent string or a global object check to exclude source mapping in whatever browser that does not support it?
I would suggest first making it optional (needs to be enabled in config hash), and then check for availability of both JSON and btoa. Imho we need not rely on user agent.
This is a small feature and I agree that we should minimize impact on both cycles and file size.
Because extras/coffee-script.js need to run in all the browser that is currently supported.
Or do you suggest a user agent string or a global object check to exclude source mapping in whatever browser that does not support it?
—
Reply to this email directly or view it on GitHub.
Activity
vendethiel commentedon Mar 5, 2013
Do browsers even support that?
kelp404 commentedon Mar 5, 2013
👍
ashtuchkin commentedon Mar 5, 2013
@Nami-Doc That's a good question. The current v3 specification allows it by using a data uri as sourceMappingUrl and additional parameter "sourcesContent". I'm not sure about the browser support though.
ashtuchkin commentedon Mar 5, 2013
Just checked - it works in Chrome 25.
kelp404 commentedon Mar 5, 2013
include coffee-script.js
https://github.com/jashkenas/coffee-script/blob/master/extras/coffee-script.js
vendethiel commentedon Mar 5, 2013
indeed. I suppose it may be useful for testing purposes ;).
ashtuchkin commentedon Mar 6, 2013
@kelp404 Yes, I'm aware of how to use it, thank you. The question is about supporting source maps right in the browser.
@mintplant I use it for development & testing of my product extensively. The benefit is that you can do frontend-only development with a basic static files server (I mock server requests anyway).
kelp404 commentedon Mar 6, 2013
@ashtuchkin Sorry, I got a mistake.
hden commentedon Mar 11, 2013
@ashtuchkin How did you checked comparability? Canary seems to ignore the sourcesContent option.
ashtuchkin commentedon Mar 11, 2013
I created manually the source map, encoded original text to js string, created property sourcesContent in the source map, then base64-encoded source map and added as a sourceMapUrl to the .js file. Then viewed it in Chrome Dev Tools. Chrome 25 for Linux.
hden commentedon Mar 13, 2013
Got it working in Canary, too. I think this is possible if we could...
JSON.stringify()since it's not supported in IE6btoa()is not supported in IEI'm afraid both of them adds significant LOC to existing code base.
In other hand, If we compile to js with
horribleinline source mapping, none of these limits will apply, any thought?See what's been done by browserify for detail.
ashtuchkin commentedon Mar 14, 2013
Source mapping is only supported in latest Chromes & Firefox, why should we support it in IE6?
Sent from my iPhone
On 12.03.2013, at 20:38, Hao-kang Den [email protected] wrote:
hden commentedon Mar 14, 2013
Because
extras/coffee-script.jsneed to run in all the browser that is currently supported.Or do you suggest a user agent string or a global object check to exclude source mapping in whatever browser that does not support it?
ashtuchkin commentedon Mar 14, 2013
I would suggest first making it optional (needs to be enabled in config hash), and then check for availability of both JSON and btoa. Imho we need not rely on user agent.
This is a small feature and I agree that we should minimize impact on both cycles and file size.
Sent from my iPhone
On 13.03.2013, at 20:27, Hao-kang Den [email protected] wrote:
mehcode commentedon Mar 14, 2013
Just a thought. Perhaps http://yepnopejs.com/ to load https://github.com/davidchambers/Base64.js and https://github.com/douglascrockford/JSON-js.
hden commentedon Mar 14, 2013
It seems that encoded data aren't interpreted in eval'd codestI wan wrong see the reply from @ashtuchkin below
ashtuchkin commentedon Mar 16, 2013
I've managed to make it work by adding sourceURL statement in addition to sourceMappingURL. Please, see https://github.com/ashtuchkin/coffee-browser-sourcemaps
hden commentedon Mar 16, 2013
Awsome! @ashtuchkin Are you going to make a PR? I've have a working branch based on your idea.
jashkenas commentedon Mar 17, 2013
@hden. Want to finalize and submit your branch as a PR, if it's working?
ashtuchkin commentedon Mar 17, 2013
@hden no, feel free to submit your PR, I'll be happy to review it if needed.
jashkenas commentedon Mar 18, 2013
It's on master now, thanks to @hden.
braco commentedon Mar 18, 2013
I'm not clear on this pull, is this supposed to just work with
?