Skip to content
Renaud Pawlak edited this page Nov 18, 2016 · 37 revisions

Welcome to the JSweet wiki!

Current target version

Current target: 1.2.0 (see all issues).

Next version (1.3 or 2.0) wishlist

Mixins

Current mixins are not standard and too complicated to use in a regular Java environment (they require a plugin or a specific classpath configuration). We need to make mixins easier. Something like:

public class MyClass extends jsweet.lang.Object { }
@Mixin
public class MyMixin extends MyClass {
  public void addedMethod();
  public String addedProperty
}

Usage:

MyClass o = ...;
o.$mixin(MyMixin.class).addedMethod();

Better jsweet.lang.Object and util APIs

Add/change the following utility methods:

  • <T> T $mixin(Class<T> mixinClass)
  • jsweet.lang.Object $get(String key)
  • String $getString(String key)
  • boolean $getBoolean(String key)
  • double $getNumber(String key)
  • Object $getObject(String key)
  • jsweet.lang.Object $apply(Object... args)
  • String $applyForString(Object... args)
  • boolean $applyForBoolean(Object... args)
  • double $applyForNumber(Object... args)
  • Object $applyForObject(Object... args)

Change the current convention of apply() as $apply()

Remove the jsweet.util.Globals.$apply(), jsweet.util.Globals.$get(), jsweet.util.Globals.$set() utility methods (should use the new Object API instead).

Rename jsweet.util.Globals.object() to jsweet.util.Globals.$object() for consistency reason and avoid clashes with local variables. Same for string, number utility methods?

Handle system APIs as regular candies

  • jsweet.dom -> def.dom
  • jsweet.lang -> def.js

We then need to be able to declare the "system" packages to handle special cases (could be a transpiler option or an annotation on the package).

Clone this wiki locally