jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Re-use existing elm.json for the compilation #121

Closed jfmengels closed 1 year ago

jfmengels commented 1 year ago

Before this PR, when we compiled the configuration, we created a temporary folder every time.

@dillonkearns gave a tip on the elm-watch Elm Radio episode, where he said that if the Elm compiler notices that elm.json has changed, then it will recompute a lot of things. Meaning that if you want it to be faster, you'd avoid touching that file. So we stop building a temporary folder, and instead we have the build-folder somewhere in elm-stuff, where we also keep all the elmi/elmo files the compiler makes.

This shaves about 0.5s-0.7s on my machine when the configuration changes (tested with elm-review --force-rebuild) in the right conditions, so this is a nice improvement :blush:

This should also be done for the parser application and for --template configurations, but that will be for a later PR.

@dillonkearns If you have additional advice, I'm all eyes :eyes: