ClojureScript

Allow nodejs target preambles

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

Description

Currently targeting nodejs precludes the use of a preamble. There are cases where you might want to add arbitrary code (besides the node hashbang) at the top of the compiled file. (see brief discussion at https://groups.google.com/forum/#!topic/clojurescript/CuInr2L5yFo)

  1. CLJS-771.2.patch
    21/Feb/14 1:23 PM
    3 kB
    Michael Glaesemann
  2. CLJS-771.patch
    21/Feb/14 1:11 PM
    4 kB
    Michael Glaesemann

Activity

Hide
David Nolen added a comment - - edited

Thanks but it appears your patch is dirty - it includes compiler version information. Will apply if we get a cleaned up version. Thanks!

Show
David Nolen added a comment - - edited Thanks but it appears your patch is dirty - it includes compiler version information. Will apply if we get a cleaned up version. Thanks!
Hide
Michael Glaesemann added a comment -

Updated (git -a is not always helpful).

Show
Michael Glaesemann added a comment - Updated (git -a is not always helpful).
Hide
Travis Vachon added a comment -

Arg, sorry I missed this - the problem is that not all node-like environments need a hashbang. As this code used to be it was up to the creator of the preamble to include the hashbang if they wanted one - the idea was that the hashbang was just the default preamble in a node environment.

I've replied to the list addressing the original motivation for this patch, but I'd very much like to see it reconsidered (except for the test, which is great! though of course I'd want it updated for the behavior I think is correct ;-D )

happy to submit a followup patch if needed

Show
Travis Vachon added a comment - Arg, sorry I missed this - the problem is that not all node-like environments need a hashbang. As this code used to be it was up to the creator of the preamble to include the hashbang if they wanted one - the idea was that the hashbang was just the default preamble in a node environment. I've replied to the list addressing the original motivation for this patch, but I'd very much like to see it reconsidered (except for the test, which is great! though of course I'd want it updated for the behavior I think is correct ;-D ) happy to submit a followup patch if needed
Hide
Michael Glaesemann added a comment -

That'd be an option, though it's also possible to set the value of the hashbang. Does :hashbang "" do what you want?

Show
Michael Glaesemann added a comment - That'd be an option, though it's also possible to set the value of the hashbang. Does :hashbang "" do what you want?
Hide
Michael Glaesemann added a comment -

Scratch that, it doesn't, does it. The code prepends #! to the path to node.

Show
Michael Glaesemann added a comment - Scratch that, it doesn't, does it. The code prepends #! to the path to node.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: