ClojureScript

A compiler support for non-Closure transforms (JSX, etc)

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 0.0-3126
  • Fix Version/s: GSoC
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

There are now a variety of JS dialects, JSX, TypeScript etc. which need to be transformed first into regular JS before module processing. We should devise a standard way to deal with this. As we cannot predict what various dialects may arise in the future it's probably best to provide something like :preprocess-module option to cljs.closure/build.

Activity

Hide
David Nolen added a comment -

We should verify with Babel now that React is moving away from JSX.

Show
David Nolen added a comment - We should verify with Babel now that React is moving away from JSX.
Hide
David Nolen added a comment -

I went ahead and looked into this a bit. Looks like getting Babel to work will take some time. Babel has difficulties loading into Nashorn due to code size limits that originate from Lodash usage. JSX while deprecated is still the most widely used option so we have some time yet and the interface supplied by both tools is exactly the same. So we should test this feature with JSX and switch to Babel when the issues are resolved.

Show
David Nolen added a comment - I went ahead and looked into this a bit. Looks like getting Babel to work will take some time. Babel has difficulties loading into Nashorn due to code size limits that originate from Lodash usage. JSX while deprecated is still the most widely used option so we have some time yet and the interface supplied by both tools is exactly the same. So we should test this feature with JSX and switch to Babel when the issues are resolved.
Hide
Maria Geller added a comment -

Attached a patch for adding support for foreign libs preprocessing. Users can add support for a JS dialect by implementing the js-transforms function and using the :preprocess foreign lib compiler option. Both, js-transforms and convert-js-modules, now take an IJavaScript and return an IJavaScript.

Show
Maria Geller added a comment - Attached a patch for adding support for foreign libs preprocessing. Users can add support for a JS dialect by implementing the js-transforms function and using the :preprocess foreign lib compiler option. Both, js-transforms and convert-js-modules, now take an IJavaScript and return an IJavaScript.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: