silkapp / rest

Packages for defining APIs, running them, generating client code and documentation.
http://silkapp.github.io/rest
390 stars 52 forks source link

Allow the use of the Google Closure compiler for minifying and optimizing generated javascript #126

Open octopuscabbage opened 9 years ago

octopuscabbage commented 9 years ago

Fixes issue #122

octopuscabbage commented 9 years ago

I didn't write any additional tests for this because none of the functions seemed particularly testable.

octopuscabbage commented 9 years ago

Forgot to add the dependencies, but they are there now. Adds one additional dependency 'network-uri'

octopuscabbage commented 9 years ago

having a hell of a time satisfying the network uri dependency

bergmark commented 9 years ago

Thanks for the pull request,

Unfortunately there are a number of issues i see with this approach:

Extending what I wrote in https://github.com/silkapp/rest/issues/122#issuecomment-110306186 I'd rather we introduce a function generateJs :: JsConfig -> IO ByteString or similar, then you can easily use your approach without modifying rest-gen further.

bergmark commented 9 years ago

Actually, this is already possible by calling mkJsApi directly instead of using generate. But It would be nice to be able to use the predefined flags anyway, I started working on this on the gen-modular branch.

octopuscabbage commented 9 years ago

When are you planning to merge your gen modular branch? I could try moving some of the code over there and also adding in a command line compiler.

As for the dependencies, I can use http-client instead of HTTP I just thought you were already using network (because of yaml file for jenkins)