ClojureScript

relativize source map urls

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The user provides :output-dir and :source-map. We should simply combine these to generate the relative paths based on :output-dir. We already copy all JS & CLJS files from jars into :output-dir, we should also copy any of user's CLJS files to :output-dir if :source-map enabled. This should satisfy both the server-less and web server source map use cases.

Activity

Hide
David Nolen added a comment -

Before moving on this I wonder if Chrome's flexibility for resolving source map location sufficiently addresses this?

Show
David Nolen added a comment - Before moving on this I wonder if Chrome's flexibility for resolving source map location sufficiently addresses this?
Hide
Eric Normand added a comment -

Note that I am using ClojureScript in a Chrome extension.

Chrome seems to look in the original location using an absolute path. This is the URL I see in Chrome Dev Tools for one of my source-mapped files:

chrome-extension://eplaphehkbcdfhogfgblgcgggpccmcbl/Users/eric/sec/chrome/src/editor/com/secondchance/chrome/editor.cljs

Each extension gets its own "space" (the noisy host part of the URL). But /Users/eric/sec... is the full, absolute path on the hard drive, not a path relative to that extension directory.

Is this related to the way paths are passed to Google Closure? They should be passed relative to the location of the source map.

Show
Eric Normand added a comment - Note that I am using ClojureScript in a Chrome extension. Chrome seems to look in the original location using an absolute path. This is the URL I see in Chrome Dev Tools for one of my source-mapped files: chrome-extension://eplaphehkbcdfhogfgblgcgggpccmcbl/Users/eric/sec/chrome/src/editor/com/secondchance/chrome/editor.cljs Each extension gets its own "space" (the noisy host part of the URL). But /Users/eric/sec... is the full, absolute path on the hard drive, not a path relative to that extension directory. Is this related to the way paths are passed to Google Closure? They should be passed relative to the location of the source map.
Hide
David Nolen added a comment -

Happy to take a patch if you can confirm that making the paths relatively to the location of the source map will actually work. Such a patch would also need to properly handle files in JARs and those not actually local to the build (since arbitrary URLs are actually supported).

Show
David Nolen added a comment - Happy to take a patch if you can confirm that making the paths relatively to the location of the source map will actually work. Such a patch would also need to properly handle files in JARs and those not actually local to the build (since arbitrary URLs are actually supported).

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: