<< Back to previous view

[CLJS-1755] Support sourcesContent in source maps Created: 16/Aug/16  Updated: 16/Aug/16

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Daniel Compton Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: sourcemap


 Description   

This issue adds sourcesContent support for source maps: https://github.com/google/closure-compiler/issues/1890. This means that your source maps can include your source as well in one bundled file. This makes handling sourcemaps much easier for things like error tracking services. It could also simplify config for source mapping as everything is included in the source map and you don't need to specify relative paths, e.t.c.

This will need to wait for the next release of the Closure Compiler.






[CLJS-618] Source map "sources" is not created correctly on windows Created: 13/Oct/13  Updated: 27/Oct/13  Resolved: 27/Oct/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Jacob Mortensen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: sourcemap
Environment:

Windows 7


Attachments: File fix-windows-sourcemap-path     Text File fix-win-path.patch    
Patch: Code

 Description   

To reproduce on windows 7:

  • clone clojurescript
  • run cljsc test.clj '{:source-map "test.js.map"}' > test.js
    The generated source map "sources" field contains a path to core.js.

Expected: "sources" field should contain path to core.cljs, not core.js.

Problem (closure.clj):
compiled-cljs is a map from a string to JavaScriptFile record like so:

{"c:\\src\\hacking\\out\\cljs
core.js" #cljs.closure.JavaScriptFile [...]

On windows:
for a file: (.getPath (io/file path)) => "c:\src\hacking\out\cljs\core.js"
for a url: (.getPath ^URL url) => "/c:/src/hacking/out/cljs/core.js"

To check if resulting source map should be merged with the source map of a compiled file, the code does a lookup in compiled-cljs by url path. This does not match on windows because of / vs \.

Fix:
Convert to file by (.getPath (io/file path)) then the core.clj is picked up from compiled-cljs.

I have tested on windows 7 and linux.



 Comments   
Comment by David Nolen [ 24/Oct/13 9:07 AM ]

This patch no longer applies to master can we get a new one that does? Thanks!

Comment by Jacob Mortensen [ 24/Oct/13 11:03 PM ]

I have attached an updated patch (fix-win-path.patch).

I did run into an error when I added :source-map to options (related to source maps), but the compiler did output a source map file that looks ok on windows.
I will take a look at the error I am seeing.

Comment by Jacob Mortensen [ 27/Oct/13 12:58 PM ]

The error I had has been fixed and applied: http://dev.clojure.org/jira/browse/CLJS-637.





[CLJS-540] Switch to tools.reader for cljs.analyzer/forms-seq Created: 15/Jul/13  Updated: 29/Jul/13  Resolved: 29/Jul/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Sean Grove Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: analyzer, cljs, reader, sourcemap
Environment:

CLJS master


Attachments: Text File tools_reader_with_passing_tests.patch    
Patch: Code

 Description   

Switches cljs.analyzer to use tools.reader, so we can get more accurate column location for symbols, prepping for more fleshed-out source maps.



 Comments   
Comment by David Nolen [ 15/Jul/13 10:43 AM ]

Excellent, we need two more things in this patch, can you update bootstrap.sh and the POM file? Thanks.

Comment by Sean Grove [ 15/Jul/13 11:00 AM ]

Updated with POM information and bootstrap update

Comment by Sean Grove [ 22/Jul/13 2:20 PM ]

CA's been processed and I'm listed on the contributing page, so shouldn't be blocked by that any longer.

Comment by David Nolen [ 27/Jul/13 2:09 PM ]

I tried applying this patch and rerunning the bootstrap script. This works but when I try to run script/test I get an error about the tools.reader not being on the classpath. Even trying to require tools.reader at via the repl doesn't work for me.

Comment by David Nolen [ 29/Jul/13 11:14 AM ]

fixed http://github.com/clojure/clojurescript/commit/9f010ff5d4a122b0f1dc93905647f309cc45c699





Generated at Wed Aug 24 07:22:54 CDT 2016 using JIRA 4.4#649-r158309.