cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 160 forks source link

Pure Java candies #6

Closed renaudpawlak closed 8 years ago

renaudpawlak commented 8 years ago

Currently, candies are extracted from TSD definition files. The JSweet transpiler relies both on the Java definitions and on the TypeScript ones to transpile (double check). Programmers can submit to TSD new definition files and can also write @Ambiant definitions to support new APIs, however, they cannot write candies directly in Java (in theory they could, but the tsc compiler will complain because it cannot find the TypeScript definition file).

We probably need a way to support pure Java definition so that programmers can write their own candies in Java.

Troubleshooting: This feature can become a problem if people start writing definitions in parallel of the TSD (which should remain the reference). In the future, we also need to sort out this issue by proposing a full equivalence between JSweet and TypeScript definitions (maybe automatize the publication of both format at once).

renaudpawlak commented 8 years ago

Actually, this feature works from 1.0.0. We just need to use the "definition" option, which generates the d.ts files from the JSweet code.