migrate JS API compiler to new framework