ClojureScript

Send inline source map information for form evaluation

Details

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

Description

Send inline source map information for form evaluation

When evaluating forms from a repl it is nice to see and get errors referencing source information. To achieve that:

1. Send a sourceMappingURL with a data url using a base64 encoded source map
2. Include sourcesContent in the source map based on the form being evaluated
3. Use sourceURL to name the eval block as the generated file referenced in the source map.

The included patch (inline_source_map.patch) provides a working implementation, but some possible downsides:

1. In order to have proper line numbers, handle additional changes based on `wrap`, and present nicely formatted source from just a form, it`pprint`s to a string and reads the input again.
2. It names the generated and source files based on the System/currentTimeMillis.
3. Generating the source maps is not currently optional, and might be useless overhead for non-browser repl-environments.

Activity

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: