> The first step would be just to get the compiler to emit an optional source map.That's definitely the first step! After that, there's going to need to be some way to serve those source maps via HTTP upon request from the browser.However, there's a first step to the first step: Getting column data. The reader currently seems to only produce a :line key in the metadata map.
Could you please clarify? Do you mean for multi-level mapping?
See the "Multi-level Mapping Notes" section in the v3 spec:It seems like once they agree upon a header (as opposed to the javascript comment syntax) this would also be useful for providing pre-macro-expansion vs post-macro-expansion source maps.
We could also decide to handle multi-mapping ourselves - that is write the code that can produce a merged source map.
I'm going to forge ahead and see if I can get some symbols mapped & get something working in the Chrome Canary environment.
I'm going to forge ahead and see if I can get some symbols mapped & get something working in the Chrome Canary environment.It looks like this could take quite some time :-)
In the meantime, I've cleaned up a branch which implements what I think is a necessary first step for anyone who wants to implement source-maps: Tracking the line and column of the generated javascript.See this branch here: https://github.com/brandonbloom/clojurescript/compare/clojure:master...brandonbloom:track-posIt's basically two commits. The first replaces all calls to print, println, emits, etc, such that all code generation funnels through the new emitx and emitln. The second commit modifies emitx and emitln to track *position* as a 2-tuple vector of [line, column], zero-based. The line and column information is a prerequisite for generating correct source maps.David (and other core contributors): Does this seem like a sane approach? I've got decent confidence in the patches' quality, as I was diffing the compiled output of the twitterbuzz sample as I worked. Is it worth scrutinizing and merging this patch before further development on source-maps?
I don't know how the cljs core team likes to work, but I prefer to make small, targeted changes and get them into main line, rather than suffer through merging long-lived branches. Especially considering I might not get a free day to dedicate to Clojure again anytime soon :-)
It looks like this could take quite some time :-)I'm assuming you're referring to the source map generation part?
Again, sounds like a good starting point - I've made a new track-pos branch on the main repo with your changes. Would love to have somebody take it the rest of the way.
Great. If I get any spare time (maybe next weekend?) I'll take a look at getting the corresponding column numbers from the Clojure reader. I figure if it's way too late for 1.4, that change should get made early, so it's got a fighting chance for 1.5 :-)
David: I'm pretty new to the community, so I'd appreciate some help navigating the processes and norms.What should I do to help move the source maps forward? What should I expect in terms of getting my two patches vetted, improved as necessary, and applied?
I'd like to contribute more time to this project, but I want to make sure I'm not just spinning my wheels.
--To view this discussion on the web visit https://groups.google.com/d/msg/clojure-dev/-/Bk4ogHDfVD4J.
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To post to this group, send email to cloju...@googlegroups.com.
To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.
[1] If you've got a git repo with your changes, this is pretty easy. Instructions here:
http://dev.clojure.org/display/design/JIRA+workflow
Look under the "Development" heading.
Andy
I applied your other minor patches.
The Clojure column patch will need to wait for post 1.4.0 release.
I've been a bit busy with CLJS @ JSConf things so I haven't had time to look over at your CLJS compiler patch. If somebody doesn't get to it first with notes I'll probably have some time later next week.
This is no guarantee of quickness of accepting your changes into Clojure/JVM, but if you create a git format patch of your changes and attach it to the JIRA ticket [1], my prescreening automation process will pick it up and check it for some easily-automated things (e.g. applies cleanly, builds, passes tests), and go on my what-might-become-weekly updated list of prescreened patches.
[1] If you've got a git repo with your changes, this is pretty easy.
--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/clojure-dev/-/z9My_wIIgWkJ.
Thanks!David
To unsubscribe from this group, send email to clojure-dev+unsubscribe@googlegroups.com.