6 ms·
The way Elm outputs JS today, it doesn't really have much to gain from being Closure compliant. Even uglify manages to remove most dead code from an Elm "blob",
by Skinney 10y ago
The way Elm outputs JS today, it doesn't really have much to gain from being Closure compliant. Even uglify manages to remove most dead code from an Elm "blob", because Elm outputs javascript with a single scope. An Elm app is smaller than both a Cljs+React(om, reagent) and a JS+React app.
- hellofunk 10y agoDead code elimination is only part of the benefits of Closure. The advanced compilation mode does a lot to optimize the final JS.
- bjz_ 10y agoI haven't had much luck the the advanced setting for Elm - seems to optimise too much away, and I get undefined field errors when I try to run the code.
- hellofunk 10y agoThat's because Elm does not output JavaScript in the standardized format for Closure.
- Skinney 10y agoClosure doesn't really have a standardized format. It does, however, not like that you mix string and dot access for object (obj['str'] vs obj.str), which Elm does a couple of places.