Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Emit compiled JS to stdout #39
(Moved from elm/compiler#961)
Right now it's a bit annoying to build Elm integrations because the compiler can only write to files. When we want the compiled JS to be immediately consumed elsewhere (e.g. by Sprockets or Node), we end up writing a temporary file, reading it in, and then deleting it afterwards.
It would be cleaner if we could instead just consume the output directly and send it along to the next process in the pipeline, without having to deal with a throwaway file along the way.
Something like an
I was about to raise this as a new issue, but spotted this one.
Is the book closed completely on this? I think it's possible without complicating the command line interface much. As it stands, "Experts" have to mess around with tempfiles, which makes things like streaming output much harder.
This could be something along the lines of a
# Generate JS file elm-make Main.elm --output=elm.js # Generate JS file on stdout elm-make Main.elm --output=elm.js --stdout # Generate HTML file on stdout elm-make Main.elm --output=index.html --stdout
To make this work, all other informational output would need to be on stderr. This would also make the
Issue closed, but I felt like agreeing with arguably diametrically opposed views on that.
And IMHO the
But I do agree with @evancz:
So the only thing unclear here is: is that a matter of prioritizing other things or, is this issue/request closed for good, declined for good? (I really don't want to go all over the arguments you probably had offline — I trust you guys — but just asking to decide upon the architecture of future deploy environments).
Just to pipe in to this, I'm in the planning stage of writing a server-side compiler for an online elm sandbox tool, and being able to pipe elm-make directly to a client rather than a temp file makes way more sense, and is allowed on way more free webhost platforms (where npm can install, but I may not be able to create tmp files).
I'm perfectly happy with a