How to write external functions, variables, classes from third party js libraries when targetting to js

As the title described.

The only way right now is to use inline js + abstract type:

type URL

pub extern "js" fn URL::make(url : String) -> URL =
  #| (url) => new URL(url)

So I assume it will need dynamic import to use third part js libraries

#| (arguments) => import("@some/library").f(arguments)

or maybe one can import the generated js file in some other js file that does the import job for you?

1 Like

The FFI is quite inconvenient currently.