September 5, 2015
GSoC Recap
Google's Summer of Code has been over for two weeks now. The official "pencils down" date was on August 27th. Since then students were required to submit a final evaluation and some code samples. I want to use this post to look back at the 13 weeks of my Google Summer of Code project and the things we've achieved during this time.
JavaScript module support
An important part of the project was to add CommonJS, AMD and ECMAScript 6 support to the ClojureScript compiler. We were able to add the necessary changes for this to the ClojureScript compiler relatively early in week 4. As it turned out, to be able to use this feature with most of the existing JavaScript libraries, we needed to add UMD support to the Google Closure compiler. Additionally, there was a small inconsistency in the way the Google Closure compiler converted JavaScript modules to Google Closure modules which resulted in a problem when trying to use the converted modules in the ClojureScript Node REPL. Fortunately, we were able to fix this problem. Those changes should be included in the most recent release (v20150901) of the Google Closure compiler.JavaScript preprocessing
Another feature that we added to the ClojureScript compiler is JavaScript preprocessing. For example, this can be useful when you want to include a React component which uses JSX. If you want to know more about this feature, have a look at one of my previous posts.Externs inference
Finally, we started to work on externs inference, meaning that externs should be generated automatically based on the use of JavaScript interop. We already have a first working version of this feature for simple JavaScript interop, such as(.-bar js/foo)
. However, before this feature can be merged, we still need to add support for generating externs for more complicated uses of JavaScript interop and would also like to add an extern type hint.