Compiler: javascript sourcemaps

Created on 1 Feb 2016  路  8Comments  路  Source: elm/compiler

I know you said in 2013 that you are not planning on adding sourcemaps
https://github.com/elm-lang/elm-compiler/issues/208
But you are open to someone adding it.
Has there been any progress on this issue in the past few years?
Is it all possible?

Most helpful comment

Having talked to pretty much all companies using Elm in production, I have never heard this feature requested from them.

If we were ClojureScript or TypeScript where you would see runtime errors in practice, this would make a ton more sense. For the existing production users of Elm, they just do not have Elm-related runtime errors, so they never find themselves in a position where they want this feature.

That said, it could be added, but I'm not sure it makes sense to make the compiler more complicated for a feature that _Elm_ users do not want. It could maybe still be valuable just because people worry about it independent of how Elm works, but this kind of PR perspective would make it relatively low-priority for now.

All 8 comments

Obviously this question is not directed to me. But as Evan does not currently have notifications enabled for this repository, let me at least provide a pointer so you don't wait indefinitely for an answer. Most recent discussion of source maps was, I think, this: http://elm-discuss.narkive.com/mALY9prW/source-maps-was-elm-dev-tools

Ok so basically its a prioritization issue.
I guess this issue is more important for me to be able to recommend elm to my team https://github.com/elm-lang/elm-compiler/issues/873
But sourcemaps are important for me to be able to recommend it to other teams. Maybe I am wrong.

Having talked to pretty much all companies using Elm in production, I have never heard this feature requested from them.

If we were ClojureScript or TypeScript where you would see runtime errors in practice, this would make a ton more sense. For the existing production users of Elm, they just do not have Elm-related runtime errors, so they never find themselves in a position where they want this feature.

That said, it could be added, but I'm not sure it makes sense to make the compiler more complicated for a feature that _Elm_ users do not want. It could maybe still be valuable just because people worry about it independent of how Elm works, but this kind of PR perspective would make it relatively low-priority for now.

Thank you for your reply. I am going to assume I am wrong about the need for sourcemaps until I find that I personally require them.

Sorry to bump and old (closed) issue but I can think of a use case with respect to unit testing and code coverage. Note this discussion of a code coverage tool for Elm:

https://groups.google.com/forum/#!topic/elm-discuss/t3ENhYAFx2U

The suggestion is that a Javascript tool such as Istanbul could generate coverage for the generated JS and then use source maps to translate that and generate coverage for the original Elm source. I'm not sure how it would really translate though. A real coverage tool would be preferred.

@evancz as an observer trying to learn more about Elm I'm not sure exactly what you mean. The question in my mind relating to source maps is, how does one set breakpoints, pause and step through the code in the browser debug tools if something isn't working right -- even if no errors are being thrown? Is the JS generated by Elm easy enough to recognize for the purpose of debugging?

@jedwards1211 in a recent blog post about elm 0.18 it seems that the better alternative to the dev tools and source maps is just to build a better debugger made for elm.

from what I've seen of the JS generated, it is simple enough to follow along in most places...at least for me.

Here I am trying to debug an infinite loop in my Elm code (a runtime bug!) wishing I had source maps. :)

Was this page helpful?
0 / 5 - 0 ratings