remove JS file, migrate link generation to C++